Skip to content

Port FractRAG multi-scale retrieval as RetrieverPlugin - #1

Merged
deesatzed merged 1 commit into
mainfrom
port/fractal-retriever-plugin
Aug 28, 2026
Merged

Port FractRAG multi-scale retrieval as RetrieverPlugin#1
deesatzed merged 1 commit into
mainfrom
port/fractal-retriever-plugin

Conversation

@deesatzed

Copy link
Copy Markdown
Owner

Summary

  • Port fractLrag's three-level self-similar index (sentence / paragraph / document) with derivative signals and retrieve_adaptive into CAM-RAG as cam_rag.retrieval.fractal.
  • Add opt-in FractalRetrieverPlugin (name="fractal") that implements RetrieverPlugin.index / retrieve. It is not enabled in the default RAGAppSpec; callers pass it via retriever_plugins.
  • HashEmbedding works without sentence-transformers or GPU. CAM-RAG HashEmbeddingBackend is also accepted.

Test plan

  • HashEmbedding fractal retrieve returns ranked RetrievalResults
  • Plugin satisfies RetrieverPlugin protocol (isinstance, name, empty query, pipeline RRF when requested)
  • Existing CAM-RAG retrieval tests still pass
  • Skip live PubMed / BGE / sentence-transformers paths
python -m pytest tests/test_fractal_plugin.py tests/test_fractal_chunking.py tests/test_fractal_rrf.py tests/test_fractal_query_classifier.py tests/test_fractal_virtual_paragraphs.py tests/test_fractal_weighted_pooling.py tests/test_fractal_diversity_scoring.py tests/test_fractal_benchmark.py tests/test_fractal_storage.py tests/test_fractal_metadata.py tests/test_retriever_plugin.py tests/test_retrieval_dense.py tests/test_retrieval_sparse.py tests/test_retrieval_fusion.py -q
# 173 passed

Not ported

  • legacy/ (doctronic / xAI demos) — excluded by request
  • medical_corpus.json / medical_queries.json — corpus dumps; corpus-only classifier/chunking cases omitted
  • Original test_benchmark_fractal_vs_flat.py imported legacy engines; rewritten against unified FractalRAG + HashEmbedding
  • Live BGE / PubMed / SentenceTransformerEmbedding load paths — optional, not required for HashEmbedding tests

Adds a cam_rag.retrieval.fractal package (three-level index, derivative
signals, retrieve_adaptive) and FractalRetrieverPlugin (name="fractal")
that callers register on RAGAppSpec.retriever_plugins. HashEmbedding
works without sentence-transformers or GPU.
@deesatzed
deesatzed merged commit 0732505 into main Aug 28, 2026
0 of 2 checks passed
@deesatzed
deesatzed deleted the port/fractal-retriever-plugin branch August 28, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant