Part of the DEVIN ecosystem
Track: Understand · Nature: product
For: Developers, AI engineers, Data Scientists
Interface: CLI / Python library
Path: Data Scientists · step 1/4 — beforedevin-search
devin-graph
Unofficial community project. Not affiliated with, endorsed by, or sponsored by Cognition AI. "Devin" is a trademark of Cognition AI.
Linux · Personal Windows · Corporate Windows
Part of the awesome-devin ecosystem: the curated hub for the devin-* tools.
A knowledge graph over Devin sessions: sessions, projects, files and tools become nodes — queryable ("which sessions touched file X?", "which tools does project Y depend on?") and exportable for visualization.
The problem
After dozens of Devin sessions you lose the thread: which sessions touched
that config file, which tools a project relies on, which projects share the
same files. The data exists in sessions.db (tool_call_state records every
call the agent made) but there is no way to query across sessions — only
per-session scrolling in the UI.
Prior art
- Code-knowledge graphs (Sourcegraph, Glean-style indexes) map code, not agent activity; they don't know what your AI sessions touched.
devin-internals-specprovides the schema + typed read-only parsers this tool builds on;devin-historyexports the same store to notes but has no cross-session structure.- You could hand-write SQL — but the
tool_call_jsonpayload format is undocumented and changes; here it's extracted defensively in one place.
What makes it Devin-native
Edges come from ground truth, not prose: file_touched edges are
extracted from tool_call_state payloads (file paths in fs/terminal tool
calls) and anchored to the session's working_directory. That data simply
doesn't exist outside Devin's store — remove Devin and there is no graph to
build. Schema drift is gated by devin-internals-spec's version detector.
Install
Requires Python ≥ 3.10 and pipx or uv. Per-OS setup lives in the platform guides: Linux · Personal Windows · Corporate Windows.
Usage
# build the graph (auto-detects the Devin sessions.db for your OS) — safe to
# re-run: unchanged sessions are skipped
devin-graph build --graph graph.db
# canned queries
devin-graph query file "src/app.py" --graph graph.db
devin-graph query tool "execute" --graph graph.db
devin-graph query project "my-repo" --graph graph.db
devin-graph query shared-files --graph graph.db
devin-graph query projects-graph --graph graph.db --json
# D3-friendly dump: {"meta", "nodes", "edges"}
devin-graph export --format json --graph graph.db --out graph.json
# diagnostics: edge-less nodes (report-only) and per-session blame
devin-graph orphans --graph graph.db
devin-graph blame-session <id-or-prefix> --graph graph.db
Matching is forgiving (src/app.py finds /repo/alpha/src/app.py);
everything has --json. query shared-files lists every file touched
by two or more distinct projects, with the project and session lists —
exportable as JSON like the other queries. The source DB is opened
mode=ro and never written — tests assert its hash is unchanged.
orphans lists nodes with no incident edges (id, kind, owner, a
prunable flag marking the subset the next build would drop —
shared, ownerless nodes; owned orphans persist with their owner). It is
report-only and never deletes. blame-session <id> shows what a
session produced and touched: its owned nodes and edges plus the
resolved files, tools, projects and commits reachable through them,
with the extraction-ledger timestamp. <id> accepts a unique prefix;
a missing or ambiguous match exits 2 and lists candidates.
Works with Devin alone (Devin-only mode)
devin-graph builds graph.db locally from Devin's session stores — the whole
pipeline is offline. Note that the derived database contains the same
sensitive content as the sessions themselves (prompts, paths, commands):
keep it private like the originals.
Platform support
Tested on Windows and Linux (windows-latest + ubuntu-latest in CI).
The CLI session DB is auto-detected: %APPDATA%/devin/cli/sessions.db on
Windows and $XDG_DATA_HOME/devin/cli/sessions.db on Linux (default
~/.local/share/devin/cli/sessions.db). A legacy ~/.config/devin location
is also checked. Pass --sessions-db to override.
commit nodes + produced/referenced edges attribute sessions to git SHAs seen in tool calls (exact when the SHA appears in a git commit/git push call, seen otherwise). devin-graph sql "SELECT ..." runs read-only SQL over graph.db (SELECT/WITH only, query_only pragma).
--vscdb (auto-detected on build) adds GUI coverage: gui_session nodes keyed by the generated session slug, gui_workspace edges to their workspace project, enriched with lastAccessed when a resourceToSpace editor URI links a space to the slug. Best-effort: only the observed windsurfSpace.* keys are read; unknown/malformed keys are skipped. Pass --vscdb none to disable.
devin-graph view --out file.html renders the graph as a self-contained HTML page (embedded JSON + vanilla-JS force layout — zero CDN, works fully offline). --limit caps nodes (highest-degree kept, flagged TRUNCATED in the header).
Limitations
- Schema-gated. Only
sessions.dbschema v15–v17; newer fails loudly (updatedevin-internals-specfirst). - Heuristic path extraction.
tool_call_*_jsonis an unstable, opaque format: paths are collected from path-ish keys plus path-looking tokens in command strings — best-effort, not contractual. A brand-new tool payload shape may yield partial edges. - CLI sessions only (M1). GUI sessions (
acp-messages/*.db) andstate.vscdbare planned for M2. - Not a code index. Nodes are files the agent touched, not repo contents; no symbol/AST knowledge.
- Read-only by design on Devin stores;
graph.dbis the only thing it writes.
Development
pip install -e ".[dev]"
python -m pytest
Fixtures are generated at test time by devin_internals.fixtures (real v17
DDL, synthetic rows) — no binary fixtures are committed. See
docs/SPEC.md for the graph model and
STATUS.md for the roadmap.
Adapters (MCP server, Devin skill, plugin)
devin_graph.mcp_server exposes one read-only tool via the
devin-graph-mcp entry point (pip install 'devin-graph[mcp]'):
graph_query (same JSON as devin-graph query <what> --json).
adapters/ is a self-contained Devin plugin root
(adapters/.devin-plugin/plugin.json +
adapters/skills/devin-graph/SKILL.md), installed with
devin plugins install Icaro0310/devin-explore#packages/graph/adapters — it ships in the
repo, not inside the wheel. The manifest launches the server through
uvx --from 'devin-graph[mcp]' devin-graph-mcp, which resolves the
published PyPI release — no local install needed. To run the server
from a source checkout instead, install it editable
(pip install -e '.[mcp]') and call devin-graph-mcp directly, or
point a local manifest copy at the checkout
(uvx --from './packages/graph[mcp]' devin-graph-mcp).
MCP host configs
Same stdio server in other hosts — server name devin-graph:
Zed — context_servers in ~/.config/zed/settings.json:
{ "context_servers": { "devin-graph": { "command": { "path": "devin-graph-mcp", "args": [] } } } }
JetBrains AI Assistant — Settings → Tools → AI Assistant → Model Context Protocol → Add:
{ "mcpServers": { "devin-graph": { "command": "devin-graph-mcp" } } }
Antigravity — ~/.gemini/config/mcp_config.json:
{ "mcpServers": { "devin-graph": { "command": "devin-graph-mcp" } } }
When to use this
- You need cross-session questions: which sessions touched file X, which tools project Y depends on, which projects share files.
- You want edges from ground truth — real
tool_call_statepayloads, not heuristics over chat text. - You want a graph export to visualize agent activity
(
devin-graph export --format jsonproduces a D3-ready dump). - You want incremental builds — re-running
devin-graph buildskips unchanged sessions.
When NOT to use this
- You need a code index — nodes are files the agent touched, not repo contents; there is no symbol/AST knowledge.
- You need message-content search (use
devin-search) or activity/context metrics (usedevin-metrics). - You need GUI session data — M1 covers CLI
sessions.dbonly;acp-messagesis planned for M2.
FAQ
What is devin-graph? A local tool that turns Devin's session database
into a knowledge graph: sessions, projects, files, and tools become nodes,
with edges extracted from real tool-call payloads. You query it with
devin-graph query file|tool|project|shared-files and export it as JSON
for visualization.
How is devin-graph different from devin-search? devin-search finds text: ranked full-text hits inside session content. devin-graph finds structure: which sessions touched which files, which tools which projects use, and which projects share files — relationships, not text matches.
Does it write to Devin's databases? No. The source sessions.db is
opened mode=ro and never written — the test suite asserts its hash is
unchanged. The only file devin-graph creates is its own graph.db.
License
MIT — see LICENSE.
Metadata
Release files for devin-graph 0.1.2
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 |
|---|---|---|---|---|
| devin_graph-0.1.2.tar.gz | 43.8 kB | With provenance | Details for devin_graph-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devin_graph-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for devin_graph-0.1.2-py3-none-any.whl |
Total release size: 75.0 kB
Release files / devin_graph-0.1.2.tar.gz
| Download URL | devin_graph-0.1.2.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b79d13ed2bd8d1afff284b1d8848c5fe0ba94db40dae14af85713b2a77cc9dc
|
|
BLAKE2b-256 checksum How to use checksums |
9774f476e221821e40238c76e34a3107b7dcc7faed9418363eb17818695849c8
|
| 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 30, 2026.
Transparency logRelease files / devin_graph-0.1.2-py3-none-any.whl
| Download URL | devin_graph-0.1.2-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2333efb48c1906e7f830f8f59d34bdeba790c7994f63c66c1e14bed723fe1665
|
|
BLAKE2b-256 checksum How to use checksums |
8afd0bffb5daf9314a8a9a01358aa88132058b37d24b38ef480c36d35f9c30f7
|
| 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 30, 2026.
Transparency logSecurity for devin-graph 0.1.2
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
Both files in this release have been uploaded with provenance metadata.
Attestation for devin_graph-0.1.2.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 30, 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.