Graph memory MCP server for codebases (MRAgent-style reconstruction)
Project description
Delfos
A graph-memory MCP server for codebases. Delfos implements the active reconstruction model from "Memory is Reconstructed, Not Retrieved: Graph Memory for LLM Agents" (arXiv 2606.06036) over a code repository, and exposes it as tools any MCP-compatible agent (Claude Code, Cursor, etc.) can consume — no knowledge of the graph internals required.
Memory access is an iterative, LLM-driven traversal of a persistent
Cue → Tag → Content graph rather than one-shot retrieval. See
ARCHITECTURE.md for the architecture overview and
docs/decisions.md for the design decisions and rationale.
Architecture
Two layers meet at a single boundary — the GraphStore ABC. No component ever
touches the C++ engine directly. The summary below is the short version; the
full contributor-facing walkthrough is ARCHITECTURE.md.
libdelfos/— the C++ storage engine: an in-memory CSR directed property graph (graph.hpp), an HNSW vector index over USearch (vector_index.hpp), and crash-safe snapshot persistence via FlatBuffers + USearch native format (snapshot.hpp). Exposed to Python as thedelfos._delfosextension through nanobind bindings.delfos.schema— the code-specific Cue-Tag-Content schema as Pydantic models (CueNode,TagNode,ContentNode), theEdgemodel, and the closed enum vocabularies. Cue and content nodes carrysource_file+git_shaprovenance (for delete-and-reindex; tags are shared across files and carry none) and optional embedding metadata (embedding_model) for embedding versioning.delfos.store— theGraphStoreabstract base class (the single database boundary every other component goes through) andNativeGraphStore, the concrete backend over the C++ engine.delfos.indexer— the construction pipeline (parser,extractor,embedder,pipeline) that turns a repository into graph nodes and edges.
Configuration
Delfos is configured via DELFOS_* environment variables, resolved with this
precedence (highest first):
- Real environment variables
- A
.envfile at the repo root passed to--repo/DELFOS_REPO— loaded explicitly at startup (copy.env.exampleto.envand edit) .delfos/config.toml(non-secret settings only — keep API keys out of it).delfos/manifest.json, recorded at index time (embed.model/embed.dimonly — these must match what the index was built with)- Built-in defaults (
nomic-embed-text, dim 768)
| Variable | Purpose |
|---|---|
DELFOS_EMBED_MODEL |
Embedding model name |
DELFOS_EMBED_DIM |
Embedding output dimension (must match the model) |
DELFOS_EMBED_BASE_URL |
OpenAI-compatible embedding endpoint (unset = OpenAI) |
DELFOS_EMBED_API_KEY |
Embedding endpoint API key (required when DELFOS_EMBED_BASE_URL is unset) |
DELFOS_LLM_MODEL |
Chat model for the reconstruct hop planner |
DELFOS_LLM_BASE_URL |
OpenAI-compatible chat endpoint (unset = OpenAI) |
DELFOS_LLM_API_KEY |
Chat endpoint API key |
DELFOS_REPO |
Repo whose .delfos/ workspace to serve (delfos-mcp only) |
DELFOS_VERBOSE |
1 for per-file DEBUG logging |
A query against an already-indexed repo needs only credentials — the model and
dimension come from the manifest. DELFOS_EMBED_BASE_URL and
DELFOS_LLM_BASE_URL each point at their own endpoint independently; there is
no fallback between them.
Development
This project uses uv.
uv sync # install Python deps + dev tools
uv pip install -e . # build + install the _delfos C++ extension
uv run ruff check . # lint
uv run ruff format . # format
uv run pyright # type-check (strict)
uv run pytest # run tests
C++ engine
The standalone C++ build/test flow uses the Ninja generator (brew install ninja):
cmake --preset debug # configure (ASan + UBSan)
cmake --build build/debug
ctest --test-dir build/debug --output-on-failure
Note: CMake 4.x dropped compatibility with
cmake_minimum_required < 3.5, which the vendored USearch dependency still declares. The build passes-DCMAKE_POLICY_VERSION_MINIMUM=3.5(wired intopyproject.tomland the CMake presets) to configure under modern CMake.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file delfos-0.1.0.tar.gz.
File metadata
- Download URL: delfos-0.1.0.tar.gz
- Upload date:
- Size: 187.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4881829fabb987b252373a8452715c12889d8140f6ea5ad3f12f4668895649cc
|
|
| MD5 |
e184c8dd60005a5812fc7215f1c537bc
|
|
| BLAKE2b-256 |
1245b01aa3cc255752ae4ba45c18a8b8a7590520c7f1fd5b272c9ec0b3a0b5d6
|
Provenance
The following attestation bundles were made for delfos-0.1.0.tar.gz:
Publisher:
release.yml on MiltMont/Delfos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delfos-0.1.0.tar.gz -
Subject digest:
4881829fabb987b252373a8452715c12889d8140f6ea5ad3f12f4668895649cc - Sigstore transparency entry: 2074851158
- Sigstore integration time:
-
Permalink:
MiltMont/Delfos@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MiltMont
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Trigger Event:
release
-
Statement type:
File details
Details for the file delfos-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: delfos-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 280.3 kB
- Tags: CPython 3.12+, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
145f1a775988ba179a0c1b36880e2b135b052c70c9ceff1e9c1665c3d48d33eb
|
|
| MD5 |
80efceb787807680ccc2624f2138ba08
|
|
| BLAKE2b-256 |
391d3af3c5f2b2172df8e75e12005ec0958c5c7170332059df94eaf1b23c0678
|
Provenance
The following attestation bundles were made for delfos-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on MiltMont/Delfos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delfos-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
145f1a775988ba179a0c1b36880e2b135b052c70c9ceff1e9c1665c3d48d33eb - Sigstore transparency entry: 2074851894
- Sigstore integration time:
-
Permalink:
MiltMont/Delfos@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MiltMont
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Trigger Event:
release
-
Statement type:
File details
Details for the file delfos-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: delfos-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 197.6 kB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72031c94b5feca45f8dedb63a058bbd956f9a3c59da36264be2d42064be7ff1d
|
|
| MD5 |
c9d1f08815878ff32031c04e84a17156
|
|
| BLAKE2b-256 |
d515cfd889607e2add36634b7b635bca775ac186307c512078511cc592362a68
|
Provenance
The following attestation bundles were made for delfos-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on MiltMont/Delfos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delfos-0.1.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
72031c94b5feca45f8dedb63a058bbd956f9a3c59da36264be2d42064be7ff1d - Sigstore transparency entry: 2074851489
- Sigstore integration time:
-
Permalink:
MiltMont/Delfos@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MiltMont
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e10114177a31a4663f2603033e16d70ad3a7f68 -
Trigger Event:
release
-
Statement type: