Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Icaro0310Public archive

About

Queryable knowledge graph over Devin sessions: projects, files touched, tools used

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

devin-graph — MOVED

This repository was absorbed into the devin-explore monorepo.

The code now lives at packages/graph/ and the CLI is unchanged: pip install devin-graph / uv tool install devin-graph still installs the same package, now released from devin-explore.

# development moved
git clone https://github.com/Icaro0310/devin-explore
cd devin-explore/packages/graph

The repository is archived; open issues and PRs belong to devin-explore. History remains readable here for reference.


Original README (pre-archive)
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
Interface: CLI / Python library

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.

Source-only distribution. This tool is not yet published to PyPI. Install from source:

pipx install git+https://github.com/Icaro0310/devin-graph.git
# or
uv tool install git+https://github.com/Icaro0310/devin-graph.git

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.

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.

About

Queryable knowledge graph over Devin sessions: projects, files touched, tools used

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages