Metadata-Version: 2.5
Name: athenaeum
Version: 0.26.0
Summary: Open source knowledge management pipeline — append-only intake, tiered compilation, configurable schemas
Project-URL: Homepage, https://github.com/Kromatic-Innovation/athenaeum
Project-URL: Repository, https://github.com/Kromatic-Innovation/athenaeum
Project-URL: Issues, https://github.com/Kromatic-Innovation/athenaeum/issues
Author-email: Kromatic Innovation <open-source@kromatic.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,compilation,knowledge-management,llm,memory
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.13
Requires-Dist: anthropic<3.0,>=0.39.0
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: pyyaml<7,>=6.0
Provides-Extra: bench
Requires-Dist: pytest-benchmark<6.0,>=4.0; extra == 'bench'
Requires-Dist: pytest>=8.0; extra == 'bench'
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: cryptography<51,>=42; extra == 'dev'
Requires-Dist: fastmcp<5.0,>=2.11.1; extra == 'dev'
Requires-Dist: hatchling; extra == 'dev'
Requires-Dist: httpx2<3.0,>=2.0; extra == 'dev'
Requires-Dist: httpx<1.0,>=0.27; extra == 'dev'
Requires-Dist: joserfc<2.0,>=1.0; extra == 'dev'
Requires-Dist: jsonschema<5,>=4.20; extra == 'dev'
Requires-Dist: mcp<3.0,>=2.0; extra == 'dev'
Requires-Dist: packaging<27,>=23.2; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-github-actions-annotate-failures>=0.2.0; extra == 'dev'
Requires-Dist: pytest-xdist<4,>=3.5; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff==0.17.3; extra == 'dev'
Provides-Extra: maya-eval
Requires-Dist: torch<3.0,>=2.2; extra == 'maya-eval'
Requires-Dist: transformers<6.0,>=4.40; extra == 'maya-eval'
Provides-Extra: mcp
Requires-Dist: fastmcp<5.0,>=2.11.1; extra == 'mcp'
Requires-Dist: jsonschema<5,>=4.20; extra == 'mcp'
Requires-Dist: mcp<3.0,>=2.0; extra == 'mcp'
Provides-Extra: signing
Requires-Dist: cryptography<51,>=42; extra == 'signing'
Provides-Extra: types
Requires-Dist: mypy==2.4.1; extra == 'types'
Provides-Extra: vector
Requires-Dist: chromadb<2.0,>=0.5.0; extra == 'vector'
Requires-Dist: numpy<3,>=1.24; extra == 'vector'
Provides-Extra: witness-anchor
Requires-Dist: opentimestamps>=0.4; extra == 'witness-anchor'
Provides-Extra: witness-sign
Requires-Dist: cryptography<51,>=42; extra == 'witness-sign'
Description-Content-Type: text/markdown

# Athenaeum

[![PyPI version](https://img.shields.io/pypi/v/athenaeum.svg)](https://pypi.org/project/athenaeum/)
[![Python versions](https://img.shields.io/pypi/pyversions/athenaeum.svg)](https://pypi.org/project/athenaeum/)
[![License](https://img.shields.io/pypi/l/athenaeum.svg)](https://github.com/Kromatic-Innovation/athenaeum/blob/main/LICENSE)

**Compiled, provenance-carrying memory for AI agents whose knowledge has outgrown a flat memory file.**

```bash
uv tool install --python 3.13 'athenaeum[mcp]'
```

Then run `athenaeum init` and follow the [Quick start](#quick-start) below.

<p align="center">
  <img src="https://github.com/Kromatic-Innovation/athenaeum/raw/main/docs/assets/athena.png" alt="Athena with her owl companion, holding an open book showing a knowledge graph" width="360">
</p>

## What is this?

A context window forgets everything the moment a session ends, and even within a session
it can't tell a durable fact ("Acme is a client") from a passing remark not worth
remembering ("the weather is nice"). And when two sessions disagree, most memory systems
resolve the contradiction silently rather than escalating it to a source of truth — such as
a human authority.

Athenaeum is a memory layer that sits outside any one agent session. Agents **write**
observations to an append-only intake log. A separate compiler — **the librarian** — turns
that raw stream into a structured, deduplicated **wiki** of entities. A **sidecar** injects
the relevant slice of that wiki back into context automatically, on every turn.

The result is memory that survives across sessions, across agents, and across a team — not
just across turns of one conversation.

> **Is this for me?** Three cases, in order of how well they are established:
>
> - **Your corpus no longer fits your agent's native memory.** Claude Code's auto memory
>   loads the first 200 lines or 25KB of its index and nothing more; past a few hundred
>   pages the agent is grepping a directory. If you have thousands of pages of people,
>   projects, decisions and retros, you are already past that line. This is the case
>   Athenaeum is being measured against, head to head, and the result decides whether the
>   project continues — see [use cases](docs/use-cases.md) §1.
> - **You need to know where a fact came from before you act on it.** Relationship and
>   client memory where a stale scraped value must never overwrite what a person told
>   you, and where contact data has to stay off the searchable corpus.
> - **Several agents, or agents and humans, write the same knowledge.** This is what the
>   write path is built for. It is the design goal, not yet a validated market: we run it
>   this way ourselves, but we have not confirmed that teams want it.
>
> If you are building a single-user chatbot that needs conversational continuity and
> your memory fits in a file, [mem0](https://github.com/mem0ai/mem0),
> [Letta](https://github.com/letta-ai/letta), or the agent's own memory is a better fit.

The full argument, including how this differs from Claude's built-in memory, Anthropic's
memory tool, RAG, and the existing agent-memory libraries, is in
[**Why Athenaeum**](docs/why-athenaeum.md).

## Quick start

**Requires Python 3.13+.** See [Install](docs/guides/install.md) for the
`PATH` setup `uv tool install` needs, and the wrong-interpreter warning to
check against if `athenaeum --version` ever looks stale. `git` must be
installed; no git identity is needed (`init` sets a repo-local one if you have none).

```bash
# Install (Python 3.13+; the [mcp] extra is needed for `serve` and `test-mcp`)
uv tool install --python 3.13 'athenaeum[mcp]'
# ...or, into an activated Python 3.13+ environment:
pip install 'athenaeum[mcp]'

# Create a knowledge directory (default: ~/knowledge)
athenaeum init

# Wire it into Claude Code — it auto-starts with every session
claude mcp add --scope user athenaeum -- athenaeum serve --path ~/knowledge

# Check the setup (read-only). FAILs are expected at this point; see below.
athenaeum doctor
```

`athenaeum doctor` is a read-only health check. **On a fresh install it will
show FAILs, and that is expected.** Right after the commands above it is
expected to report FAILs for `mcp`, `hooks` and `search_index` (plus
`key_mode` when neither an API key nor the `claude` CLI is available)
until the steps below are complete; each FAIL names its fix. Run it again
once you have finished the quick start, and it should come back clean.

The `[mcp]` extra above is all a fresh install needs. `athenaeum init`'s
default config (`search_backend: vector`) wants the optional `[vector]`
extra for semantic search, but without it `recall`, `reindex` and
`session-end` all degrade to the `fts5` backend automatically, with a
one-time warning on stderr — never a hard failure. Add the `[vector]`
extra to the install command above later if you want semantic (not just
keyword) matching.

Want to confirm it works before wiring anything up or spending API budget?

```bash
athenaeum test-mcp    # smoke-tests remember/recall against a scratch dir — no API key needed
```

That gives your agent two tools: `remember` to write an observation, `recall` to search
the compiled wiki. A round-trip looks like this:

> **You:** Jordan's partner is Priya; they met at Stanford GSB.
>
> *Claude calls `remember(...)`. A raw observation lands in
> `~/knowledge/raw/claude-session/…md`.*

Nothing is in the wiki yet — `remember` only appends. Compile it:

```bash
export ANTHROPIC_API_KEY=...     # or configure the claude-cli backend
athenaeum run                    # add --dry-run to inspect without writing
athenaeum status
```

The librarian creates or updates Jordan's entity page, creates Priya's, and links them.
A later session asking *"who is Priya?"* gets the compiled page back from `recall`.

Two more commands you will use daily:

```bash
athenaeum session-end   # make this session's memories recallable now, not tonight
athenaeum decisions     # anything the pipeline refused to resolve on its own
```

→ [Daily operation](docs/guides/daily-operation.md) ·
[Passive recall via hooks](docs/guides/sidecar.md) ·
[MCP tool reference](docs/modules/mcp.md)

## Key features

**A single librarian writes the wiki.** Multiple agents writing the same store produce
duplicate, drifting, and contradictory pages that nobody can arbitrate. One compiler is the
only writer, so the schema stays consistent, duplicates merge, contradictions get caught —
and every run is git-snapshotted, so a bad merge is one `revert` away.
→ [modules/librarian](docs/modules/librarian.md)

**Agents append; they never edit.** Once a bad write is in the store it is
indistinguishable from a good one. Intake is append-only, so the raw record is always
recoverable and safety is a property of the structure rather than of trusting every agent
to be a careful writer. → [modules/intake](docs/modules/intake.md)

**Sources rank; they don't race.** Last-write-wins lets a stale scraped fact quietly
overwrite something the user said directly. Every claim carries a source and conflicts
resolve through a fixed nine-tier precedence order, so low-authority data can never clobber
high-authority data. → [modules/conflicts](docs/modules/conflicts.md)

**Unresolvable conflicts go to a human, not a coin flip.** A memory system that silently
picks a side on every ambiguity will eventually pick the wrong one, and nobody will know to
check. Conflicts the pipeline can't settle land in a durable decisions queue you can list,
answer, and audit — `athenaeum decisions` is the one queue for every pending item (questions,
merge proposals, and more). → [guides/decisions](docs/guides/decisions.md)

**Recall is scoped, and fails closed.** A scheduled agent that needs operational context
must not be able to reach PII or client-confidential pages — and "visible unless labeled
private" means one missed label is a leak. A restricted reader sees only what it is
explicitly authorized for; untagged pages stay hidden.
→ [modules/sensitivity](docs/modules/sensitivity.md)

**The background compiler is bounded.** An unattended LLM batch job with no ceiling turns a
bad day into an unbounded bill, and two overlapping runs writing the same store is a
correctness bug. Every run takes a single-writer lock and enforces a hard per-run API
budget. → [modules/librarian](docs/modules/librarian.md)

**Page recompile restructures oversized pages automatically, on by default.** A page that
keeps growing becomes a page nobody can read and the compiler cannot merge into cleanly.
Every night the
librarian looks for pages over `librarian.page_size_threshold_chars` (the one setting that
decides which pages are picked up) and cuts the biggest few into a parent page plus linked
sub-pages. **This costs model calls every night**: up to
`librarian.page_recompile.max_pages_per_run` pages a run (3, or `opening_max_pages_per_run` —
10 — while any page is still over the hard ceiling), bounded further by
`max_input_chars_per_run` and `max_api_calls_per_run`. A plan that only restructures the page
itself — nothing moved to another page, nothing attached, no alias moved — is applied right
then, with no question asked; a plan that touches another page, or names a page `type:` you
listed in `never_auto_types`, is still raised in `athenaeum decisions` as a `page-recompile`
item for you to approve or reject, and stops raising new ones once `max_open_items` (5) are
unanswered. **See what the pass has done** with `athenaeum recompile list --applied` or
`athenaeum status` (which fills "applied in the last 7 days"); **undo one** with
`athenaeum recompile undo <plan-id>` — reversible either way, auto-applied or
operator-approved. **To ask before every write, or turn it off entirely, set
`librarian.page_recompile.mode`:**

```yaml
librarian:
  page_recompile:
    mode: queue   # off | shadow | queue | auto (default) -- queue asks before every write
```

`shadow` keeps drafting plans and recording them without asking or writing, which is the
cheapest way to see what the pass would do.
→ [guides/daily-operation](docs/guides/daily-operation.md)

**Recall happens without being asked.** Memory an agent has to remember to look things up
in is memory that goes unused. A sidecar injects the relevant slice of the wiki into
context on every turn, no tool call required. → [guides/sidecar](docs/guides/sidecar.md)

**Runs on an API key or your Claude subscription.** Metering a separate API key for a
nightly batch job is a barrier when you already pay for Claude Code. One provider seam, two
transports, identical prompts either way. → [modules/provider](docs/modules/provider.md)

**Can be served remotely (experimental).** A host that cannot launch a local process,
such as ChatGPT or the Grok apps, can't reach a stdio memory server at all.
`athenaeum serve --transport http` serves the store over HTTPS behind your reverse proxy,
with OIDC bearer-token auth (`serve.auth.*`) and a `remote` serve profile that narrows
what leaves your machine, and each remote tool call is written to an audit log
(digests and page ids only, never page text). Experimental, and not covered by the `athenaeum.__all__`
compatibility promise: flags and keys may change in a minor release.
→ [guides/remote](docs/guides/remote.md)

**Transcript authorship can be attested (experimental).** `promptwitness` is a separate
package and console script that keeps a hash-chained ledger recording that a human typed
each prompt, with no prompt text stored, so a transcript can later be checked against it.
Experimental, and not part of `athenaeum.__all__`: its CLI and formats may change in a
minor release. → [design/witness-ledger](docs/design/witness-ledger.md)

## Stability and versioning

- **Pre-1.0.** Athenaeum follows semantic versioning, but until 1.0 a minor
  version (0.x) may make breaking changes. Read the [CHANGELOG](CHANGELOG.md)
  before upgrading across a minor.
- **Public API.** Only the names in `athenaeum.__all__` are public API and carry the
  compatibility promise. Everything else, including every other importable module
  and each CLI flag, config key and file format not documented as stable, is
  internal and may change.
- **Experimental surfaces** are marked as such where they are documented (remote
  serving with OIDC auth, `promptwitness`, and the source trust graph). They sit
  outside `athenaeum.__all__` and may change in any minor release without a
  deprecation cycle.
- **Removed surfaces.** 0.24.0 removed `athenaeum merges` and `athenaeum questions`
  (use `athenaeum decisions`), `athenaeum rebuild-index` (use `athenaeum reindex`),
  `athenaeum split-oversize` (use `athenaeum recompile`), seven one-shot repair
  commands, the legacy `block` / `error` / `resolved_block` keys in MCP responses,
  and a set of config keys and switches that had no effect or only turned
  always-on behaviour off. See [Upgrading](docs/guides/upgrading.md) for the
  command-by-command mapping and the [CHANGELOG](CHANGELOG.md) for the full list.
- **Security fixes** go to the latest release only; see [SECURITY.md](SECURITY.md)
  for supported versions and how to report a vulnerability.

## Where to go next

| | |
|---|---|
| **Why this exists** | [Why Athenaeum](docs/why-athenaeum.md) · [North star](docs/north-star.md) |
| **Get it running** | [Install](docs/guides/install.md) · [What runs unattended, and what happens when a prerequisite is missing](docs/guides/install.md#what-runs-unattended-after-install) · [Other clients and platforms](docs/guides/clients.md) · [Reading a shared store from a second install](docs/guides/shared-store-reader.md) · [Daily operation](docs/guides/daily-operation.md) · [Troubleshooting](docs/guides/troubleshooting.md) |
| **How it works** | [Module reference](docs/index.md#modules) — what each part does, reads, writes, and refuses |
| **Every knob** | [Configuration](docs/reference/configuration.md) · [Environment](docs/reference/environment.md) · [Data formats](docs/reference/data-formats.md) |
| **Extend it** | [Adapter contracts](docs/extending/) · [Storage surfaces](docs/extending/storage-adapter-contract.md) |
| **Everything** | [**docs/index.md**](docs/index.md) — the complete map |

## Known limitations

Stated plainly, because you will hit these:

- **Anthropic only.** The provider seam has two backends — the Anthropic API and the
  `claude` CLI. There is no OpenAI, local-model, or Ollama backend. But it's extensible and other providers can be added.
- **Single-owner, not multi-tenant.** Audience scoping is a read filter the operator pins
  at serve time. It is not a multi-user ACL and there is no per-user memory isolation **yet**.
- **The librarian is a batch job.** Compilation is nightly by default; `session-end` closes
  the same-day gap, but there is no streaming write path to the wiki.
- **Storage is markdown on disk.** The storage-adapter seam exists, but no database-backed
  wiki ships in-tree today.
- **Reasoning-tier screening is off by default.** The T2 tier can auto-apply a merge with
  no human review, so it stays opt-in.

Full list: [docs/index.md#limitations](docs/index.md#limitations).

## Contributing

Development setup, branch flow, and the review gate are in
[CONTRIBUTING.md](CONTRIBUTING.md). Security policy: [SECURITY.md](SECURITY.md).

## Getting help

Open an issue at
[Kromatic-Innovation/athenaeum](https://github.com/Kromatic-Innovation/athenaeum/issues).

## License

Apache 2.0. See [LICENSE](LICENSE).
