Pandion
Retrieval pipelines you can inspect, step by step.
Pandion parses your documents, cleans and chunks them, embeds and stores them, then searches, reranks and answers questions. Every step is a strategy you can swap, and every step tells you what it did. Each result is cached under a hash of its settings, so the same files with the same settings are never processed twice.
Pandion is named after the osprey, which spots a fish under the water and dives to retrieve it. It is the engine of RAG Playground, a web app that shows every step of a pipeline on a PDF.
Install
Pandion needs Python 3.13.
pip install "pandion[pdfium,lancedb,local]"
The base install is small. Parsers, stores and models are extras, and a step whose extra is missing tells you which one to install:
| Extra | What it brings | Needed by |
|---|---|---|
pdfium |
pypdfium2 | the fast pdfium parser |
docling |
Docling and its OCR engine | the docling parser, for layout, tables and scans |
lancedb |
LanceDB and pyarrow | the index, and the dense, bm25 and hybrid_rrf search |
local |
sentence-transformers and torch | the local embedders, and the mmr and cross_encoder rerankers |
anthropic |
the Anthropic SDK | llm_rewrite, llm_rerank and chat with Claude |
openai |
the OpenAI SDK | the same steps with OpenAI, OpenRouter or a compatible server |
pandion install pipeline.yaml installs the extras a pipeline file needs.
Quick start
from pandion import Pipeline
p = Pipeline(
path="./my-index",
parse="pdfium",
chunk={"use": "recursive_character", "chunk_size": 400, "chunk_overlap": 40},
embed="bge-small-en-v1.5",
store="lancedb",
search="hybrid_rrf",
answer="search",
)
p.index.run("report.pdf")
print(p.ask("What does the report recommend?").text)
The embedder downloads once, on first use. After that, a second p.index.run on the
same file finds every step already stored and reuses it.
What you can do
- Run one step on its own, with no pipeline and no cache:
pandion.parse(pdf, use="pdfium"),pandion.clean(...),pandion.chunk(...). - Write a pipeline three ways: as a YAML file (
Pipeline.from_file("pipeline.yaml")), as a dict per step, or with classes such asfrom pandion.parse import Docling. The three give the same pipeline and the same cache. - Build and update an index:
p.index.run(files)indexes them, andp.index.sync(folder)adds, changes and removes files to match a folder. - Search:
p.retrieve(question)runs the rewrite, search and rerank steps and returns each step's result as well as the hits. - Ask:
p.ask(question)returns the pieces found, or an answer from a chat model that cites them. - Evaluate and compare:
pandion.evaluate(p, "questions.json")scores a pipeline on a question set and says where each miss was lost, andpandion.compareruns one stage with several settings and names the best. - Start from a template:
pandion.compose_template("tables", "precision")joins an index template (how a kind of document is indexed) and a query template (how a kind of question is searched and answered) into a pipeline, andpandion.list_templates()lists them. See Templates. - Write your own strategy for any stage, register it with
@registerfrompandion.extend, and use it by name, from code, fromplugins:in a pipeline file, or with--pluginson the command line. The worked example writes one for every stage.
Start a project
pandion init my-project asks which index and query template to use, then writes a
folder you can run straight away: pipeline.yaml, run.py, requirements.txt, a
README and an empty docs/ for your documents. In code, pandion.new_project(folder, pipeline)
writes the same folder for any pipeline. See
Start a project.
Use Pandion from the command line
pandion validate pipeline.yaml, pandion index pipeline.yaml report.pdf, pandion ask pipeline.yaml "...":
the same pipeline, from the command line. See
the pandion command.
Learn more
- The guide: every step, setting and error.
- Examples: index, sync, search, ask, the three ways to write a pipeline, and your own strategy for every stage.
- RAG Playground: try the same pipelines in the browser.
License
MIT. See LICENSE.
Metadata
Release files for pandion 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pandion-0.3.0.tar.gz | 341.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pandion-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 574.6 kB
Release files / pandion-0.3.0.tar.gz
| Download URL | pandion-0.3.0.tar.gz |
|---|---|
| Size | 341.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6832b614618bb51eeb097a4d812baf47fc8498f64c0b9056bef1f72044a7b320
|
|
BLAKE2b-256 checksum How to use checksums |
d832e9460e3d6f5c5af093959e62250344dce0d5f4620461671fcdaf0aff0e42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / pandion-0.3.0-py3-none-any.whl
| Download URL | pandion-0.3.0-py3-none-any.whl |
|---|---|
| Size | 232.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47710c1e9b639bee2b331e204cadb2f731ffeb88d0a5fd6ab951e17f8293b5e7
|
|
BLAKE2b-256 checksum How to use checksums |
943f132c114efaddc03c652402600666098aa43f3999e9783e8b5017017ebc94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for pandion 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pandion-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.