Skip to content

initial support: Add high-level retrieval pipeline (RRF + optional MMR) #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MagellaX
Copy link

PR description

  • Introduces a non-generated retrieval module at src/zeroentropy/lib/retrieval.py:

    • search_documents and asearch_documents to query multiple collections and fuse results via Reciprocal Rank Fusion.
    • Optional Maximal Marginal Relevance diversification to reduce duplicates.
    • Returns UnifiedDocumentResult with fused score and per-collection provenance.
  • Adds tests tests/test_retrieval.py validating multi-collection fusion (sync/async) with respx.

  • Adds example examples/retrieval_basic.py demonstrating multi-collection retrieval.

Benefits: better retrieval quality out-of-the-box (recall + precision + diversity) without changing generated endpoints; lives in lib/ to avoid codegen conflicts.

@MagellaX
Copy link
Author

Hey @npip99, any thoughts?

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