Pythia
Pythia continuously reads the places where your work happens and extracts atomic claims, each with its provenance and time. It builds and stores syntheses and connections over those claims, and when a claim becomes outdated or is contradicted, it detects the change and rebuilds everything that depended on it. Through hooks (push) and MCP (pull), it delivers to your LLMs only what matters, already worked out, instead of loose information that every LLM would have to reflect on all over again.
It is the spiritual successor of Twin and the goal still the same.
Why
AI assistants forget. Each session starts blank, so you keep explaining how you write, who owns which system, what the team decided last week and what caused that bug. Product memories help inside one assistant; retrieval returns fragments without knowing which are still true. Pythia keeps what is currently true, where it came from, and what changed.
Features
- Claims, not documents. The source of truth is the atomic claim (subject, attribute, value, validity, status, evidence). Pages and narratives are derivatives that cite claims, go stale only when a cited claim changes, and can be regenerated at any time.
- Open-world entity resolution. People, teams, systems and projects are resolved from context by an LLM, seeded by registries such as the incident.io catalog. Merge, split and relink are reversible events.
- Conflict and drift handling. New claims are confronted with what is already known. An adjudicator agent investigates, with live access to the sources (current file, CODEOWNERS, Slack thread, Confluence page), and records a reversible verdict: temporal supersession, real conflict, different scope, outdated source, duplicate. A periodic sweep looks for drift with no trigger.
- You are the authority. There are no approval queues. The system writes its result and you correct it afterwards; your corrections always win and become quality metrics and test examples.
- Edits and deletions are respected. An edit retracts the previous version; a deletion at the source erases the content and every derived text, including old page versions.
- Small external interface. Five MCP tools (
search,open,timeline,correct,define) and a short push briefing whose text is always stored knowledge, never generated prose. - No LLM, no guessing. Judgment is always done by an LLM; there are no regex or heuristic fallbacks. Without a key, network or budget, ingestion continues and reads serve what was already concluded, with a notice.
- Measured. Cost ledger and monthly cap, golden questions with a sealed half and a plain-search baseline, correction rate per role, and a method to measure avoided re-explanation (docs/measuring-value.md).
Sources and consumers
| Sources | Consumers |
|---|---|
| Claude Code sessions (per chat, explicit allowlist) | Claude Code: hook push (SessionStart, UserPromptSubmit) |
| GitHub pull requests (diffs, reviews, comments) | Claude Code and any MCP client: pull |
| Slack channels, threads and DMs (user token, no bot) | |
| Confluence spaces and page trees, with comments | |
| incident.io catalog (entity seed) |
Zoom is planned.
The web interface
| Screen | What it shows |
|---|---|
| Evolution | What changed and why, newest first: one line per cause, with before/after of the claims, page diffs and per-attribute trajectories |
| Explore | Ego graph around any entity with a time slider; correct, relink, merge or retract from the side panel |
| Sources | The allowlist, connector state, backfill estimates and what is being processed right now |
| Usage | Exactly what was pushed to each chat and what each MCP call returned |
| Costs | Spend against the cap, by role, source and model |
| Quality | Correction rate, golden questions and baseline, detector precision, value metrics |
| Config | Models per role, budget, credentials (kept in the OS keychain), Claude Code integration |
How it works
A unit of a source (a settled thread, a merged PR, a chat delta, a page edit) goes through triage → extraction → entity resolution → integration → adjudication (when needed) → regeneration of derivatives, on a single Postgres job queue with separate lanes for I/O, cognition and derivation. State is event-sourced, so the base can answer both what is true and what Pythia believed at time T.
Details: docs/architecture.md.
Getting started
Requirements: Python 3.13 or 3.14, uv, Docker (Postgres 17 with pgvector) and an Anthropic API key. Credentials are stored with the OS keychain (keyring); autostart at login is available on macOS.
Install it from PyPI (the package is pythia-knowledge; the command is pythia):
uv tool install pythia-knowledge
pythia start
Or run it from a source checkout with uv sync and uv run pythia start.
start brings up the database container if needed, then runs the daemon and the web server in the background. Open http://127.0.0.1:7117 and:
- Config: add your Anthropic API key, review the models per role and set the monthly cap.
- Sources: turn on the Claude Code chats to read, and add repositories, Slack conversations or Confluence spaces. Each new source enters paused with a cost estimate for its backfill.
- Config → Claude Code integration: copy the MCP command (pull) and the hooks snippet (push) into your Claude Code setup.
Command line
The CLI only manages the process; everything else is configured on the web.
| Command | Does |
|---|---|
pythia start / stop / status |
Start, stop or inspect the background process |
pythia run |
Run in the foreground |
pythia autostart |
Start at login (macOS LaunchAgent); --off undoes it |
Environment: PYTHIA_HOME (default ~/.pythia: pid file and logs) and PYTHIA_DATABASE_URL (use your own Postgres instead of the container; it needs the vector extension).
Development
Tests run against a real Postgres, a fake LLM and a fake embedder, so they are fast and cost nothing.
docker compose up -d
docker exec pythia-db psql -U pythia -c "create database pythia_test"
.venv/bin/python -m pytest -q
If you change a prompt or schema, bump VERSION in src/pythia/pipeline/prompts.py; the golden questions then run on their own.
Repository layout
| Path | What |
|---|---|
src/pythia/events.py |
Append-only event log, projections and rebuild |
src/pythia/knowledge.py |
Knowledge commands: claims, mentions, verdicts, cascade, tombstones |
src/pythia/connectors/ |
Claude Code, GitHub, Slack, Confluence and incident.io |
src/pythia/pipeline/ |
Triage, extraction, resolution, integration, adjudication, sweep, derivation, corrections |
src/pythia/llm/client.py |
Roles, structured output, agent loop, cost ledger, cap and halt |
src/pythia/consumer.py, mcp_server.py |
The five MCP tools and the push briefing |
src/pythia/web/ |
FastAPI app, templates and the Explore graph |
src/pythia/daemon.py, jobs.py |
Job queue, lanes and scheduler |
src/pythia/migrations/ |
Postgres schema |
Documentation
| Document | About |
|---|---|
| Architecture | Knowledge model, entity resolution, conflicts, ingestion, consumption, stack |
| Decisions | Numbered core decisions (D1–D22) and how each area applies them |
| Design rationale | Why it is the way it is: principles, influences and what real use taught |
| Measuring value | Metrics, experiment design and results |
| Known limitations | Open problems and their proposed fixes |
Principles
- Judgment is always an LLM; determinism is for plumbing only.
- No LLM, no function, and no fallback that pretends otherwise.
- A truth that is wrong but correctable beats a hypothesis waiting for approval.
- Rich agents inside, a lean interface outside.
- Derivatives are disposable; evidence, entities, claims, verdicts and human decisions are the only state that matters.
Contributing and security
See CONTRIBUTING.md before opening a pull request, and SECURITY.md to report a vulnerability.
License
Metadata
Release files for pythia-knowledge 1.0.1
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 | Actions |
|---|---|---|---|---|
| pythia_knowledge-1.0.1.tar.gz | 381.5 kB | With provenance | Details for pythia_knowledge-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pythia_knowledge-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pythia_knowledge-1.0.1-py3-none-any.whl |
Total release size: 609.0 kB
Release files / pythia_knowledge-1.0.1.tar.gz
| Download URL | pythia_knowledge-1.0.1.tar.gz |
|---|---|
| Size | 381.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e732ec11078e1c14b4b86051aadedb871155acb488ffd197b101a16a4a9dd9a
|
|
BLAKE2b-256 checksum How to use checksums |
475bbdb8688475339e92186908fb7ab7b724bf6b3bc3fd06514a5ab551774dfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 24, 2026.
Transparency logRelease files / pythia_knowledge-1.0.1-py3-none-any.whl
| Download URL | pythia_knowledge-1.0.1-py3-none-any.whl |
|---|---|
| Size | 227.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7a5973bbcd3214753e49c191ae4809c71a68cfd00f40364489f3f11f6620b57
|
|
BLAKE2b-256 checksum How to use checksums |
95f3edf873669acab5734e0744f3d38f04bc952d9edba642c682b24e5697dc85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 24, 2026.
Transparency logSecurity for pythia-knowledge 1.0.1
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 pythia_knowledge-1.0.1.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 24, 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.