As a library
The core: multi-size slicer, structural markers, containment forest, and the budget-fitting selection engine. Standard library only, synchronous, and embeddable in any pipeline.
pip install phoropter Library quickstart → Open source · pre-alpha
Phoropter is a multi-view RAG server — and an embeddable Python library — that indexes every document at multiple slice sizes on a shared origin-aligned grid, then fits the most coherent context to the budget you have.
The core is under active development; APIs will change.
The idea
Conventional RAG pipelines choose one chunk size up front and live with it forever: small chunks match precisely but strip away context, large chunks preserve context but crowd the model's window. Phoropter defers that choice to query time.
Because every size is sliced on the same origin-aligned grid, a larger slice provably contains its smaller slices — containment is decided by offset arithmetic and verified with content hashes, not similarity heuristics. So swapping a small relevant slice for its enclosing parent never loses relevant content; it only spends tokens.
That turns token budgeting into a sequence of safe, explainable moves — and every decision comes with a trace.
Each document is sliced at multiple sizes on one shared grid.
A query searches all of them at once, not just one chosen view.
Slices contained inside other slices are detected exactly, and dropped.
Small slices trade up to their enclosing parents while the budget allows.
Get started
The core: multi-size slicer, structural markers, containment forest, and the budget-fitting selection engine. Standard library only, synchronous, and embeddable in any pipeline.
pip install phoropter Library quickstart → Adds FastAPI REST and MCP surfaces over a pluggable vector store (Qdrant by default) and pluggable embedders (Ollama and OpenAI-compatible included).
pip install "phoropter[server,qdrant]" Server quickstart → Documentation
New here? Start with concepts for the method, then architecture for the system.
Community
Phoropter's community lives on GitHub, alongside the code — so questions, bugs, and ideas sit next to the commits that resolve them.
Stuck on setup, tuning, or a concept? Ask in Q&A — answers get marked so the next person finds them.
Something broken or behaving oddly? File an issue, right next to the code that needs fixing.
Propose an idea and vote on others. Ideas with traction shape what gets built next.
Community notes, recipes, and hard-won knowledge that outgrew a single answer.
Contributions are welcome — see CONTRIBUTING and the code of conduct.