Skip to main content
devin-graph

ci

OpenSSF Scorecard License: MIT Python 3.10+ GitHub stars Last commit devin-* ecosystem PRs welcome

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 — before devin-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-spec provides the schema + typed read-only parsers this tool builds on; devin-history exports the same store to notes but has no cross-session structure.
  • You could hand-write SQL — but the tool_call_json payload 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

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.

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.db schema v15–v17; newer fails loudly (update devin-internals-spec first).
  • Heuristic path extraction. tool_call_*_json is 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) and state.vscdb are 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.db is 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_state payloads, not heuristics over chat text.
  • You want a graph export to visualize agent activity (devin-graph export --format json produces a D3-ready dump).
  • You want incremental builds — re-running devin-graph build skips 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 (use devin-metrics).
  • You need GUI session data — M1 covers CLI sessions.db only; acp-messages is 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.1

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

Source distribution (sdist)

Source distribution for devin-graph 0.1.1
File Size Uploaded Provenance Actions
devin_graph-0.1.1.tar.gz 40.4 kB With provenance Details for devin_graph-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devin-graph 0.1.1
File Interpreter ABI Platform Actions
devin_graph-0.1.1-py3-none-any.whl Python 3 none any Details for devin_graph-0.1.1-py3-none-any.whl

Total release size: 69.5 kB

Release files / devin_graph-0.1.1.tar.gz

Download URL devin_graph-0.1.1.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4ba5a2fb137c0bcc9d30ea61c75ed322ddca08a2d8eee2f4187199fe352d9af1
BLAKE2b-256 checksum
How to use checksums
50ee650a0971842f94472908c67336bb95b5fc20a63b0e2d77f061a40868a21b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / devin_graph-0.1.1-py3-none-any.whl

Download URL devin_graph-0.1.1-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
258e16972eb807bf9ce80be7981c6784580a14bbd59abd93ba754ebffc0d2444
BLAKE2b-256 checksum
How to use checksums
283488d3af3fcaf868900c37eb23ba64caabb17aa8fb3eae8af9ce119679f349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Security for devin-graph 0.1.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for devin_graph-0.1.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 20, 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.

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