devin-graph 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- devin_graph/__init__.py +1 -0
- devin_graph/cli.py +297 -0
- devin_graph/extract.py +300 -0
- devin_graph/identity.py +126 -0
- devin_graph/paths.py +92 -0
- devin_graph/query.py +234 -0
- devin_graph/store.py +273 -0
- devin_graph/view.py +144 -0
- devin_graph/vscdb.py +117 -0
- devin_graph-0.1.0.dist-info/METADATA +207 -0
- devin_graph-0.1.0.dist-info/RECORD +15 -0
- devin_graph-0.1.0.dist-info/WHEEL +5 -0
- devin_graph-0.1.0.dist-info/entry_points.txt +2 -0
- devin_graph-0.1.0.dist-info/licenses/LICENSE +21 -0
- devin_graph-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devin-graph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Knowledge graph over Devin sessions — projects, files, tools and decisions as queryable nodes.
|
|
5
|
+
Author: Icaro0310
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: devin-internals-spec<0.4.0,>=0.3.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
|
|
17
|
+
<img src="assets/banner.svg" alt="devin-graph" width="100%"/>
|
|
18
|
+
|
|
19
|
+
<a href="https://github.com/Icaro0310/devin-graph/actions/workflows/ci.yml"><img src="https://github.com/Icaro0310/devin-graph/actions/workflows/ci.yml/badge.svg" alt="ci"/></a>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/Icaro0310/devin-graph"><img src="https://api.scorecard.dev/projects/github.com/Icaro0310/devin-graph/badge" alt="OpenSSF Scorecard"/></a>
|
|
23
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License: MIT"/></a>
|
|
24
|
+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+"/></a>
|
|
25
|
+
<a href="https://github.com/Icaro0310/devin-graph"><img src="https://img.shields.io/github/stars/Icaro0310/devin-graph" alt="GitHub stars"/></a>
|
|
26
|
+
<a href="https://github.com/Icaro0310/devin-graph/commits/main"><img src="https://img.shields.io/github/last-commit/Icaro0310/devin-graph" alt="Last commit"/></a>
|
|
27
|
+
<a href="https://github.com/Icaro0310/awesome-devin"><img src="https://img.shields.io/badge/part%20of-devin--*-ecosystem-7c3aed" alt="devin-* ecosystem"/></a>
|
|
28
|
+
<a href="https://github.com/Icaro0310/devin-graph/issues"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"/></a>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- DEVIN-ECO:BEGIN -->
|
|
32
|
+
> **Part of the [DEVIN ecosystem](https://github.com/Icaro0310/awesome-devin)**
|
|
33
|
+
> Track: Understand · Nature: product
|
|
34
|
+
> For: Developers, AI engineers
|
|
35
|
+
> Interface: CLI / Python library
|
|
36
|
+
<!-- DEVIN-ECO:END -->
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# devin-graph
|
|
40
|
+
|
|
41
|
+
> **Unofficial community project.** Not affiliated with, endorsed by, or
|
|
42
|
+
> sponsored by Cognition AI. "Devin" is a trademark of Cognition AI.
|
|
43
|
+
|
|
44
|
+
**[Linux](README.linux.md)** · **[Personal Windows](README.windows.md)** · **[Corporate Windows](README.corporate-windows.md)**
|
|
45
|
+
|
|
46
|
+
Part of the [awesome-devin](https://github.com/Icaro0310/awesome-devin) ecosystem: the curated hub for the devin-* tools.
|
|
47
|
+
|
|
48
|
+
A knowledge graph over Devin sessions: sessions, projects, files and tools
|
|
49
|
+
become nodes — queryable ("which sessions touched file X?", "which tools does
|
|
50
|
+
project Y depend on?") and exportable for visualization.
|
|
51
|
+
|
|
52
|
+
## The problem
|
|
53
|
+
|
|
54
|
+
After dozens of Devin sessions you lose the thread: which sessions touched
|
|
55
|
+
that config file, which tools a project relies on, which projects share the
|
|
56
|
+
same files. The data exists in `sessions.db` (`tool_call_state` records every
|
|
57
|
+
call the agent made) but there is no way to query across sessions — only
|
|
58
|
+
per-session scrolling in the UI.
|
|
59
|
+
|
|
60
|
+
## Prior art
|
|
61
|
+
|
|
62
|
+
- Code-knowledge graphs (Sourcegraph, Glean-style indexes) map *code*, not
|
|
63
|
+
*agent activity*; they don't know what your AI sessions touched.
|
|
64
|
+
- `devin-internals-spec` provides the schema + typed read-only parsers this
|
|
65
|
+
tool builds on; `devin-history` exports the same store to notes but has no
|
|
66
|
+
cross-session structure.
|
|
67
|
+
- You could hand-write SQL — but the `tool_call_json` payload format is
|
|
68
|
+
undocumented and changes; here it's extracted defensively in one place.
|
|
69
|
+
|
|
70
|
+
## What makes it Devin-native
|
|
71
|
+
|
|
72
|
+
Edges come from **ground truth, not prose**: `file_touched` edges are
|
|
73
|
+
extracted from `tool_call_state` payloads (file paths in fs/terminal tool
|
|
74
|
+
calls) and anchored to the session's `working_directory`. That data simply
|
|
75
|
+
doesn't exist outside Devin's store — remove Devin and there is no graph to
|
|
76
|
+
build. Schema drift is gated by `devin-internals-spec`'s version detector.
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
Requires Python ≥ 3.10 and `pipx` or `uv`. Per-OS setup lives in the platform guides: [Linux](README.linux.md) · [Personal Windows](README.windows.md) · [Corporate Windows](README.corporate-windows.md).
|
|
81
|
+
|
|
82
|
+
<!-- DIST-STATUS:BEGIN — generated from devin-powerups/registry.json -->
|
|
83
|
+
> **Source-only distribution.** This tool is not yet published to PyPI.
|
|
84
|
+
> Install from source:
|
|
85
|
+
>
|
|
86
|
+
> ```bash
|
|
87
|
+
> pipx install git+https://github.com/Icaro0310/devin-graph.git
|
|
88
|
+
> # or
|
|
89
|
+
> uv tool install git+https://github.com/Icaro0310/devin-graph.git
|
|
90
|
+
> ```
|
|
91
|
+
<!-- DIST-STATUS:END -->
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# build the graph (auto-detects the Devin sessions.db for your OS) — safe to
|
|
97
|
+
# re-run: unchanged sessions are skipped
|
|
98
|
+
devin-graph build --graph graph.db
|
|
99
|
+
|
|
100
|
+
# canned queries
|
|
101
|
+
devin-graph query file "src/app.py" --graph graph.db
|
|
102
|
+
devin-graph query tool "execute" --graph graph.db
|
|
103
|
+
devin-graph query project "my-repo" --graph graph.db
|
|
104
|
+
devin-graph query shared-files --graph graph.db
|
|
105
|
+
devin-graph query projects-graph --graph graph.db --json
|
|
106
|
+
|
|
107
|
+
# D3-friendly dump: {"meta", "nodes", "edges"}
|
|
108
|
+
devin-graph export --format json --graph graph.db --out graph.json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Matching is forgiving (`src/app.py` finds `/repo/alpha/src/app.py`);
|
|
112
|
+
everything has `--json`. `query shared-files` lists every file touched
|
|
113
|
+
by two or more distinct projects, with the project and session lists —
|
|
114
|
+
exportable as JSON like the other queries. The source DB is opened
|
|
115
|
+
`mode=ro` and never written — tests assert its hash is unchanged.
|
|
116
|
+
|
|
117
|
+
## Works with Devin alone (Devin-only mode)
|
|
118
|
+
|
|
119
|
+
devin-graph builds `graph.db` locally from Devin's session stores — the whole
|
|
120
|
+
pipeline is offline. Note that the derived database contains the same
|
|
121
|
+
sensitive content as the sessions themselves (prompts, paths, commands):
|
|
122
|
+
keep it private like the originals.
|
|
123
|
+
|
|
124
|
+
## Platform support
|
|
125
|
+
|
|
126
|
+
Tested on **Windows and Linux** (`windows-latest` + `ubuntu-latest` in CI).
|
|
127
|
+
The CLI session DB is auto-detected: `%APPDATA%/devin/cli/sessions.db` on
|
|
128
|
+
Windows and `$XDG_DATA_HOME/devin/cli/sessions.db` on Linux (default
|
|
129
|
+
`~/.local/share/devin/cli/sessions.db`). A legacy `~/.config/devin` location
|
|
130
|
+
is also checked. Pass `--sessions-db` to override.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
`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).
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
`--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.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
`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).
|
|
140
|
+
|
|
141
|
+
## Limitations
|
|
142
|
+
|
|
143
|
+
- **Schema-gated.** Only `sessions.db` schema v15–v17; newer fails loudly
|
|
144
|
+
(update `devin-internals-spec` first).
|
|
145
|
+
- **Heuristic path extraction.** `tool_call_*_json` is an unstable, opaque
|
|
146
|
+
format: paths are collected from path-ish keys plus path-looking tokens in
|
|
147
|
+
command strings — best-effort, not contractual. A brand-new tool payload
|
|
148
|
+
shape may yield partial edges.
|
|
149
|
+
- **CLI sessions only (M1).** GUI sessions (`acp-messages/*.db`) and
|
|
150
|
+
`state.vscdb` are planned for M2.
|
|
151
|
+
- **Not a code index.** Nodes are files *the agent touched*, not repo
|
|
152
|
+
contents; no symbol/AST knowledge.
|
|
153
|
+
- **Read-only by design** on Devin stores; `graph.db` is the only thing it
|
|
154
|
+
writes.
|
|
155
|
+
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pip install -e ".[dev]"
|
|
160
|
+
python -m pytest
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Fixtures are generated at test time by `devin_internals.fixtures` (real v17
|
|
164
|
+
DDL, synthetic rows) — no binary fixtures are committed. See
|
|
165
|
+
[docs/SPEC.md](docs/SPEC.md) for the graph model and
|
|
166
|
+
[STATUS.md](STATUS.md) for the roadmap.
|
|
167
|
+
|
|
168
|
+
## When to use this
|
|
169
|
+
|
|
170
|
+
- You need cross-session questions: which sessions touched file X, which
|
|
171
|
+
tools project Y depends on, which projects share files.
|
|
172
|
+
- You want edges from ground truth — real `tool_call_state` payloads, not
|
|
173
|
+
heuristics over chat text.
|
|
174
|
+
- You want a graph export to visualize agent activity
|
|
175
|
+
(`devin-graph export --format json` produces a D3-ready dump).
|
|
176
|
+
- You want incremental builds — re-running `devin-graph build` skips
|
|
177
|
+
unchanged sessions.
|
|
178
|
+
|
|
179
|
+
## When NOT to use this
|
|
180
|
+
|
|
181
|
+
- You need a code index — nodes are files the agent *touched*, not repo
|
|
182
|
+
contents; there is no symbol/AST knowledge.
|
|
183
|
+
- You need message-content search (use `devin-search`) or activity/context metrics
|
|
184
|
+
(use `devin-metrics`).
|
|
185
|
+
- You need GUI session data — M1 covers CLI `sessions.db` only;
|
|
186
|
+
`acp-messages` is planned for M2.
|
|
187
|
+
|
|
188
|
+
## FAQ
|
|
189
|
+
|
|
190
|
+
**What is devin-graph?** A local tool that turns Devin's session database
|
|
191
|
+
into a knowledge graph: sessions, projects, files, and tools become nodes,
|
|
192
|
+
with edges extracted from real tool-call payloads. You query it with
|
|
193
|
+
`devin-graph query file|tool|project|shared-files` and export it as JSON
|
|
194
|
+
for visualization.
|
|
195
|
+
|
|
196
|
+
**How is devin-graph different from devin-search?** devin-search finds text:
|
|
197
|
+
ranked full-text hits inside session content. devin-graph finds structure:
|
|
198
|
+
which sessions touched which files, which tools which projects use, and
|
|
199
|
+
which projects share files — relationships, not text matches.
|
|
200
|
+
|
|
201
|
+
**Does it write to Devin's databases?** No. The source `sessions.db` is
|
|
202
|
+
opened `mode=ro` and never written — the test suite asserts its hash is
|
|
203
|
+
unchanged. The only file devin-graph creates is its own `graph.db`.
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
devin_graph/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
|
+
devin_graph/cli.py,sha256=E55uOLsuI9qIouEiAxB1KmnW8Bo0xfeRAJAJ9idJfEc,10424
|
|
3
|
+
devin_graph/extract.py,sha256=bXoahp49H2YRoxIj79AB8P6IRlLl1NWcSUByPcYZD84,10780
|
|
4
|
+
devin_graph/identity.py,sha256=n-FuPXeTCeF371UcWdq8rCgcdINQtOCNvkOuNnxwXwo,4334
|
|
5
|
+
devin_graph/paths.py,sha256=SJJQ8qij-ES5IidRw7c29EZo9d1r5x2xDm7ZV0WwOxw,3009
|
|
6
|
+
devin_graph/query.py,sha256=Ed4pJkplqH0hDrF3eY4VWcFJbuk-leMJ2FtPBAy0Kcw,8176
|
|
7
|
+
devin_graph/store.py,sha256=BkI4uvDRLH6yWwmYitr7tGejG2iB4nLZJbmtoBuTJek,9537
|
|
8
|
+
devin_graph/view.py,sha256=pFtGOPDq8PVaW8Q-7qJVLZx0gTqVPzif9aYOlRnP75s,6358
|
|
9
|
+
devin_graph/vscdb.py,sha256=MtpbN9fH3_WW1IovIU6rD_2lPiNGg7CTeC9qoyscZPU,4334
|
|
10
|
+
devin_graph-0.1.0.dist-info/licenses/LICENSE,sha256=dxS8nFGmsVpbMH3Qz4fmf0j6irSSpO4k5H5F6ZealWg,1066
|
|
11
|
+
devin_graph-0.1.0.dist-info/METADATA,sha256=f7mCVdb4jITaT2mS-ZwPgvpecJiPc7LBSMFZFonBg5M,9633
|
|
12
|
+
devin_graph-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
13
|
+
devin_graph-0.1.0.dist-info/entry_points.txt,sha256=5rigqqYfZIXekrjSKnOSxF4cVj7AQZ2FTU3tyTpZfuk,53
|
|
14
|
+
devin_graph-0.1.0.dist-info/top_level.txt,sha256=cAHIhfbOcj8L4IvMrB1eOPckDXc3OJB2WtA0OLkZcjw,12
|
|
15
|
+
devin_graph-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Icaro0310
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
devin_graph
|