Skip to main content

A single agent that answers from your compiled corpus — every claim cited.

Project description

reigner

A single agent that answers from your compiled corpus — every claim cited.

PyPI Python CI License: MIT

📚 Documentation: https://construct-lab.github.io/reigner/

Reigner is a toolkit for building citation-faithful question-answering agents over a knowledge corpus. You compile your sources into bounded, schema-aware artifacts once, then a single retrieval agent answers over them — every factual claim traced back to its source. It is a library first: not a chat app, not a coding-agent harness, not a multi-agent orchestrator.

One core, three surfaces

You meet the same agent core — the harness, the artifact store, and a single REIGNER.md instruction file — at three points in its lifecycle:

  • Build — define a per-project agent as a library: a schema, @tools, an extractor, a recipe, plugins. This is what you ship.
  • Test — iterate from the CLI: ingest, chat, then session fork / replay and eval to A/B/C variants of your REIGNER.md, tools, or model.
  • Ship — serve the same agent over HTTP (FastAPI + SSE) so your apps consume it with no rewrite. (MCP export is planned; see status below.)

Features

  • Compiled artifacts — ingestion compiles raw documents into a bounded, schema-aware store. The agent queries the compiled graph, never your raw files.
  • Bounded, self-describing tools — every tool result reports has_more, truncated, and available_keys, so a finite-context model always knows whether it got everything.
  • Citations are first-class — numeric and factual claims register a CitationEvent with provenance; the eval suite fails answers that make uncited claims.
  • Forkable sessions — durable JSONL sessions on disk that you can fork and replay to compare variants without re-running from scratch.
  • One typed event protocol — CLI, HTTP, and MCP all consume the same typed events.
  • Provider-agnostic — Anthropic, OpenAI, and Gemini adapters behind one interface.

Quickstart

uv add 'reigner[anthropic,ingestion]'      # model adapter + PDF/URL loaders

reigner init mydocs --recipe document_qa   # scaffold a project
# drop your PDFs/text into mydocs/, then:
cd mydocs
reigner ingest                             # compile documents into artifacts
reigner chat                               # ask questions, get cited answers

reigner chat answering a question with per-claim citations

The full walkthrough — every command with real output and a per-feature status flag — is in the usage guide.

Install

uv add reigner

Reigner ships a thin core; each capability is an opt-in extra:

Extra Purpose
reigner[anthropic] Anthropic model adapter
reigner[openai] OpenAI model adapter
reigner[gemini] Gemini model adapter
reigner[server] FastAPI HTTP server with SSE
reigner[mcp] MCP server export (planned — not wired yet)
reigner[ingestion] PDF/URL loaders for the ingestion pipeline
reigner[otel] OpenTelemetry metrics plugin
reigner[all] Everything above

License note

Reigner itself is MIT-licensed. The [ingestion] extra pulls in PyMuPDF, which is AGPL-3.0. Downstream projects that distribute or network-serve a closed-source product on top of reigner[ingestion] must comply with AGPL or obtain a PyMuPDF Pro commercial license. To avoid the AGPL entirely, override LLMExtractor.raw_to_text with a permissive-licensed loader of your choice.

Learn more

Development

uv sync --all-extras --group dev
uv run pre-commit install
uv run pytest

CI runs ruff check, ruff format --check, mypy, and pytest on every PR.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reigner-0.9.0.tar.gz (191.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reigner-0.9.0-py3-none-any.whl (260.0 kB view details)

Uploaded Python 3

File details

Details for the file reigner-0.9.0.tar.gz.

File metadata

  • Download URL: reigner-0.9.0.tar.gz
  • Upload date:
  • Size: 191.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for reigner-0.9.0.tar.gz
Algorithm Hash digest
SHA256 7e18480423c45b13a6387c54051f0aa47f4c2892a2a276a2899914c2432b45d1
MD5 44f77390c02666d8a1556e95bb9e50da
BLAKE2b-256 2328f2d65db35628c03f9a834e15fc7b8b6fd03c73c5d1c9a040a4d6a0975559

See more details on using hashes here.

File details

Details for the file reigner-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: reigner-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 260.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for reigner-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 168b0878835162e4d2387d54b9b9fe6f307c2bf95cae5c2c9d3c4cae8d3a6cbb
MD5 ab385dd06c6cbfed7bf714c67975d7ed
BLAKE2b-256 66c79ce040b37649fb5428f86ef67a243f2d6be2fbae70b441ecec4ed7c2d0a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page