Skip to main content

Pythia — a personal knowledge oracle

tests Python 3.13 | 3.14 MCP, 5 tools MIT

Pythia

Pythia continuously reads the places where your work happens, keeps a base of atomic claims with provenance and time, detects when knowledge becomes outdated or contradictory, and delivers what matters to your LLMs, automatically through hooks (push) and on demand through MCP (pull).

It is the spiritual successor of Twin and the goal is 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

How Pythia works: sources become evidence, mentions, entities and claims; conflicts become tensions and verdicts; claims feed pages, narratives and the map that serve the push hook and the MCP tools

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:

  1. Config: add your Anthropic API key, review the models per role and set the monthly cap.
  2. 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.
  3. 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

  1. Judgment is always an LLM; determinism is for plumbing only.
  2. No LLM, no function, and no fallback that pretends otherwise.
  3. A truth that is wrong but correctable beats a hypothesis waiting for approval.
  4. Rich agents inside, a lean interface outside.
  5. 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

MIT

Metadata

Release files for pythia-knowledge 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythia-knowledge 1.0.0
File Size Uploaded Provenance Actions
pythia_knowledge-1.0.0.tar.gz 381.3 kB With provenance Details for pythia_knowledge-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pythia-knowledge 1.0.0
File Interpreter ABI Platform Actions
pythia_knowledge-1.0.0-py3-none-any.whl Python 3 none any Details for pythia_knowledge-1.0.0-py3-none-any.whl

Total release size: 608.7 kB

Release files / pythia_knowledge-1.0.0.tar.gz

Download URL pythia_knowledge-1.0.0.tar.gz
Size 381.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5bcbde531899b807b049b8b1db2e27d3ef559ce563e9edc3480fc271555f563
BLAKE2b-256 checksum
How to use checksums
790e69300a5ca603af0b2904b8fb05ddf43724de32bdd75d24b8d744d00d2ec7
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 23, 2026.

Transparency log

Release files / pythia_knowledge-1.0.0-py3-none-any.whl

Download URL pythia_knowledge-1.0.0-py3-none-any.whl
Size 227.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73fb589ad4cfb4953998423d8aa7b54137f3824d4bfaed57098b3630bb6bd04f
BLAKE2b-256 checksum
How to use checksums
a8571cf2c42817d4da709fc964e2647744cf6c7f1017d788b842f0224943aa74
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 23, 2026.

Transparency log

Security for pythia-knowledge 1.0.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.

Select from 2 files

Attestation for pythia_knowledge-1.0.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 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page