devin-search 0.1.0__tar.gz
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_search-0.1.0/LICENSE +21 -0
- devin_search-0.1.0/PKG-INFO +212 -0
- devin_search-0.1.0/README.md +198 -0
- devin_search-0.1.0/pyproject.toml +27 -0
- devin_search-0.1.0/setup.cfg +4 -0
- devin_search-0.1.0/src/devin_search/__init__.py +1 -0
- devin_search-0.1.0/src/devin_search/cli.py +221 -0
- devin_search-0.1.0/src/devin_search/extract.py +112 -0
- devin_search-0.1.0/src/devin_search/fmt.py +96 -0
- devin_search-0.1.0/src/devin_search/history.py +52 -0
- devin_search-0.1.0/src/devin_search/index.py +355 -0
- devin_search-0.1.0/src/devin_search/misslog.py +91 -0
- devin_search-0.1.0/src/devin_search/paths.py +87 -0
- devin_search-0.1.0/src/devin_search/query.py +118 -0
- devin_search-0.1.0/src/devin_search.egg-info/PKG-INFO +212 -0
- devin_search-0.1.0/src/devin_search.egg-info/SOURCES.txt +26 -0
- devin_search-0.1.0/src/devin_search.egg-info/dependency_links.txt +1 -0
- devin_search-0.1.0/src/devin_search.egg-info/entry_points.txt +2 -0
- devin_search-0.1.0/src/devin_search.egg-info/requires.txt +4 -0
- devin_search-0.1.0/src/devin_search.egg-info/top_level.txt +1 -0
- devin_search-0.1.0/tests/test_cli.py +155 -0
- devin_search-0.1.0/tests/test_fmt.py +84 -0
- devin_search-0.1.0/tests/test_history.py +136 -0
- devin_search-0.1.0/tests/test_index.py +149 -0
- devin_search-0.1.0/tests/test_offline_core.py +81 -0
- devin_search-0.1.0/tests/test_paths.py +35 -0
- devin_search-0.1.0/tests/test_query.py +110 -0
- devin_search-0.1.0/tests/test_smoke.py +4 -0
|
@@ -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,212 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devin-search
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Full-text search across all Devin sessions — find that command, that error, that decision.
|
|
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-search" width="100%"/>
|
|
18
|
+
|
|
19
|
+
<a href="https://github.com/Icaro0310/devin-search/actions/workflows/ci.yml"><img src="https://github.com/Icaro0310/devin-search/actions/workflows/ci.yml/badge.svg" alt="ci"/></a>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/Icaro0310/devin-search"><img src="https://api.scorecard.dev/projects/github.com/Icaro0310/devin-search/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-search"><img src="https://img.shields.io/github/stars/Icaro0310/devin-search" alt="GitHub stars"/></a>
|
|
26
|
+
<a href="https://github.com/Icaro0310/devin-search/commits/main"><img src="https://img.shields.io/github/last-commit/Icaro0310/devin-search" 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-search/issues"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"/></a>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
# devin-search
|
|
32
|
+
|
|
33
|
+
> **Unofficial community project.** Not affiliated with, endorsed by, or
|
|
34
|
+
> sponsored by Cognition AI. "Devin" is a trademark of Cognition AI.
|
|
35
|
+
|
|
36
|
+
**[Linux](README.linux.md)** · **[Personal Windows](README.windows.md)** · **[Corporate Windows](README.corporate-windows.md)**
|
|
37
|
+
|
|
38
|
+
Part of the [awesome-devin](https://github.com/Icaro0310/awesome-devin) ecosystem: the curated hub for the devin-* tools.
|
|
39
|
+
|
|
40
|
+
Full-text search across all your Devin sessions — find that command, that
|
|
41
|
+
error message, that file path or that decision from months ago in under a
|
|
42
|
+
second.
|
|
43
|
+
|
|
44
|
+
## The problem
|
|
45
|
+
|
|
46
|
+
Devin keeps your entire session history in local SQLite stores
|
|
47
|
+
(`sessions.db`, `User/acp-messages/*.db`) — but offers no way to search
|
|
48
|
+
across them. You remember Devin fixed a flaky test or ran a specific
|
|
49
|
+
`kubectl` command three weeks ago, and the only way back is scrolling
|
|
50
|
+
through sessions one by one. Generic `grep` over the raw databases mostly
|
|
51
|
+
hits JSON noise and knows nothing about who said what.
|
|
52
|
+
|
|
53
|
+
## Prior art
|
|
54
|
+
|
|
55
|
+
- Full-text search over chat/agent history is well-established:
|
|
56
|
+
everything here leans on SQLite's built-in **FTS5** engine with
|
|
57
|
+
**BM25** ranking — the same approach used by ripgrep-style tools,
|
|
58
|
+
mail clients and `sqlite-utils`.
|
|
59
|
+
- **tokmesh** and **UniSessions** document/parse the CLI `sessions.db`;
|
|
60
|
+
the schema itself is tracked by
|
|
61
|
+
[`devin-internals-spec`](https://github.com/Icaro0310/devin-internals-spec),
|
|
62
|
+
which this project uses for versioned, read-only access.
|
|
63
|
+
- **devin-history** (sibling repo) exports sessions to Markdown/JSON;
|
|
64
|
+
devin-search complements it with instant ranked lookup instead of a
|
|
65
|
+
static dump.
|
|
66
|
+
|
|
67
|
+
## What makes it Devin-native
|
|
68
|
+
|
|
69
|
+
Results are **role-tagged and session-linked**, not raw grep hits. The
|
|
70
|
+
indexer understands Devin's real message structure through
|
|
71
|
+
`devin-internals-spec`'s typed parsers: user prompts vs assistant replies
|
|
72
|
+
vs tool calls (including `prompt_history` shell commands and GUI
|
|
73
|
+
`acp-messages` sessions), each stamped with its working directory and a
|
|
74
|
+
`ref` back to the exact source row. And because the store schema has had
|
|
75
|
+
17 migrations already, indexing **fails loudly** on an unknown schema
|
|
76
|
+
version instead of silently misreading it.
|
|
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-search.git
|
|
88
|
+
> # or
|
|
89
|
+
> uv tool install git+https://github.com/Icaro0310/devin-search.git
|
|
90
|
+
> ```
|
|
91
|
+
<!-- DIST-STATUS:END -->
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# build/update the index (auto-detects Devin's stores; safe to re-run —
|
|
97
|
+
# only new rows are indexed each time)
|
|
98
|
+
devin-search index
|
|
99
|
+
|
|
100
|
+
# search everything
|
|
101
|
+
devin-search query "kubectl delete pod"
|
|
102
|
+
|
|
103
|
+
# filters: role, project, date, limit — --json on every command
|
|
104
|
+
devin-search query "TypeError" --role assistant --project myrepo
|
|
105
|
+
devin-search query "migration" --since 2026-09-01 --limit 5 --json
|
|
106
|
+
|
|
107
|
+
# link hits to devin-history export notes
|
|
108
|
+
devin-search query "kubectl" --history-dir ~/notes/devin-history
|
|
109
|
+
|
|
110
|
+
# deterministic index: sessions.db only, never the auto-detected acp dir
|
|
111
|
+
devin-search index --no-acp
|
|
112
|
+
|
|
113
|
+
# zero-hit stats from the local query log (evidence for/against semantic
|
|
114
|
+
# search — SE-1's trigger; log is opt-out via query --no-log)
|
|
115
|
+
devin-search misses
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Hits print as `WHEN · ROLE · PROJECT · SESSION · SNIPPET` with the match
|
|
119
|
+
wrapped in `«»`; each hit carries a `ref` (e.g. `node:1234`,
|
|
120
|
+
`acp:file.db:7`) pointing back to the exact source row.
|
|
121
|
+
|
|
122
|
+
With `--history-dir <dir>` pointing at a
|
|
123
|
+
[`devin-history`](https://github.com/Icaro0310/devin-history) export
|
|
124
|
+
directory, each hit whose session has an exported note gets a `note: <path>`
|
|
125
|
+
line under its row (and a `history_note` field in `--json`). Notes are
|
|
126
|
+
matched by the `<YYYY-MM-DD>_<session-id>.md` filename devin-history writes
|
|
127
|
+
(`.json` exports work as a fallback). A missing note produces no link and
|
|
128
|
+
no error — the flag is purely additive.
|
|
129
|
+
|
|
130
|
+
## Works with Devin alone (Devin-only mode)
|
|
131
|
+
|
|
132
|
+
devin-search builds and queries a fully local index over Devin's session
|
|
133
|
+
stores. Nothing is sent anywhere; the index lives on your disk next to the
|
|
134
|
+
data it covers.
|
|
135
|
+
|
|
136
|
+
## Platform support
|
|
137
|
+
|
|
138
|
+
Tested on **Windows and Linux** (`windows-latest` + `ubuntu-latest` in CI).
|
|
139
|
+
The CLI session DB is auto-detected from `%APPDATA%/devin/cli/sessions.db`
|
|
140
|
+
on Windows and `$XDG_DATA_HOME/devin/cli/sessions.db` on Linux (default
|
|
141
|
+
`~/.local/share/devin/cli/sessions.db`). ACP logs are searched under
|
|
142
|
+
`$XDG_CONFIG_HOME/Devin/User/acp-messages` (default
|
|
143
|
+
`~/.config/Devin/User/acp-messages`). A legacy `~/.config/devin` layout is
|
|
144
|
+
also checked. Use `--sessions-db` or `--acp-dir` to override.
|
|
145
|
+
|
|
146
|
+
## Limitations
|
|
147
|
+
|
|
148
|
+
- **Schema-gated.** Only `sessions.db` schema v15–v17 is accepted; newer
|
|
149
|
+
versions fail loudly (update `devin-internals-spec` first).
|
|
150
|
+
- **Opaque payloads.** `chat_message`, `tool_call_*_json` and acp
|
|
151
|
+
`payload` formats are undocumented/unstable — text extraction is
|
|
152
|
+
best-effort and tolerant, not contractual.
|
|
153
|
+
- **Keyword search only (M1).** BM25 over tokens — no synonyms or
|
|
154
|
+
embeddings; semantic search is an opt-in M2 candidate.
|
|
155
|
+
- **Deletion lag.** New rows are picked up incrementally, but rows
|
|
156
|
+
deleted mid-table upstream can stay in the index until `--rebuild`
|
|
157
|
+
(tail-pruned sources are detected and re-indexed automatically).
|
|
158
|
+
- **Read-only by design** — the tool never writes to Devin's stores; the
|
|
159
|
+
only file it creates is `search.db`.
|
|
160
|
+
|
|
161
|
+
## Development
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pip install -e ".[dev]"
|
|
165
|
+
pytest
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Fixtures are generated at test time by `devin_internals.fixtures` (real
|
|
169
|
+
v17 DDL, synthetic rows) — no binary fixtures are committed.
|
|
170
|
+
|
|
171
|
+
## When to use this
|
|
172
|
+
|
|
173
|
+
- You remember Devin ran a command, hit an error, touched a file, or made a
|
|
174
|
+
decision, and scrolling sessions one by one is too slow.
|
|
175
|
+
- You want ranked results tagged by role (user / assistant / tool call) with
|
|
176
|
+
a `ref` back to the exact source row.
|
|
177
|
+
- Your session history must stay on disk — the index is fully local, no
|
|
178
|
+
telemetry, no network calls.
|
|
179
|
+
- You want incremental indexing: re-running `devin-search index` only picks
|
|
180
|
+
up new rows.
|
|
181
|
+
|
|
182
|
+
## When NOT to use this
|
|
183
|
+
|
|
184
|
+
- You need semantic or synonym-aware search — M1 is keyword BM25 only;
|
|
185
|
+
embeddings are an opt-in M2 candidate.
|
|
186
|
+
- You need session *observability* (activity, context size, token peaks) — use `devin-metrics`;
|
|
187
|
+
or relationship queries — use `devin-graph`.
|
|
188
|
+
- Your `sessions.db` schema is outside v15–v17 — indexing refuses loudly
|
|
189
|
+
rather than misreading it.
|
|
190
|
+
|
|
191
|
+
## FAQ
|
|
192
|
+
|
|
193
|
+
**What is devin-search?** A local full-text search engine over your Devin
|
|
194
|
+
session history. It indexes Devin's SQLite stores with FTS5/BM25 and answers
|
|
195
|
+
queries like `devin-search query "kubectl delete pod"` in under a second,
|
|
196
|
+
with results tagged by role and linked back to the source row.
|
|
197
|
+
|
|
198
|
+
**Does devin-search send my session data anywhere?** No. Everything runs
|
|
199
|
+
locally: it reads Devin's stores read-only and writes a single `search.db`
|
|
200
|
+
index next to your data. There are no network calls and no telemetry.
|
|
201
|
+
|
|
202
|
+
**Does it write to or modify Devin's databases?** No. Devin's stores are
|
|
203
|
+
opened read-only by design; the only file devin-search creates is its own
|
|
204
|
+
`search.db` index.
|
|
205
|
+
|
|
206
|
+
**How is this different from `devin-history`?** devin-history exports
|
|
207
|
+
sessions to static Markdown/JSON files. devin-search complements it with
|
|
208
|
+
instant ranked lookup across all sessions, without exporting anything.
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/banner.svg" alt="devin-search" width="100%"/>
|
|
4
|
+
|
|
5
|
+
<a href="https://github.com/Icaro0310/devin-search/actions/workflows/ci.yml"><img src="https://github.com/Icaro0310/devin-search/actions/workflows/ci.yml/badge.svg" alt="ci"/></a>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/Icaro0310/devin-search"><img src="https://api.scorecard.dev/projects/github.com/Icaro0310/devin-search/badge" alt="OpenSSF Scorecard"/></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License: MIT"/></a>
|
|
10
|
+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+"/></a>
|
|
11
|
+
<a href="https://github.com/Icaro0310/devin-search"><img src="https://img.shields.io/github/stars/Icaro0310/devin-search" alt="GitHub stars"/></a>
|
|
12
|
+
<a href="https://github.com/Icaro0310/devin-search/commits/main"><img src="https://img.shields.io/github/last-commit/Icaro0310/devin-search" alt="Last commit"/></a>
|
|
13
|
+
<a href="https://github.com/Icaro0310/awesome-devin"><img src="https://img.shields.io/badge/part%20of-devin--*-ecosystem-7c3aed" alt="devin-* ecosystem"/></a>
|
|
14
|
+
<a href="https://github.com/Icaro0310/devin-search/issues"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"/></a>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
# devin-search
|
|
18
|
+
|
|
19
|
+
> **Unofficial community project.** Not affiliated with, endorsed by, or
|
|
20
|
+
> sponsored by Cognition AI. "Devin" is a trademark of Cognition AI.
|
|
21
|
+
|
|
22
|
+
**[Linux](README.linux.md)** · **[Personal Windows](README.windows.md)** · **[Corporate Windows](README.corporate-windows.md)**
|
|
23
|
+
|
|
24
|
+
Part of the [awesome-devin](https://github.com/Icaro0310/awesome-devin) ecosystem: the curated hub for the devin-* tools.
|
|
25
|
+
|
|
26
|
+
Full-text search across all your Devin sessions — find that command, that
|
|
27
|
+
error message, that file path or that decision from months ago in under a
|
|
28
|
+
second.
|
|
29
|
+
|
|
30
|
+
## The problem
|
|
31
|
+
|
|
32
|
+
Devin keeps your entire session history in local SQLite stores
|
|
33
|
+
(`sessions.db`, `User/acp-messages/*.db`) — but offers no way to search
|
|
34
|
+
across them. You remember Devin fixed a flaky test or ran a specific
|
|
35
|
+
`kubectl` command three weeks ago, and the only way back is scrolling
|
|
36
|
+
through sessions one by one. Generic `grep` over the raw databases mostly
|
|
37
|
+
hits JSON noise and knows nothing about who said what.
|
|
38
|
+
|
|
39
|
+
## Prior art
|
|
40
|
+
|
|
41
|
+
- Full-text search over chat/agent history is well-established:
|
|
42
|
+
everything here leans on SQLite's built-in **FTS5** engine with
|
|
43
|
+
**BM25** ranking — the same approach used by ripgrep-style tools,
|
|
44
|
+
mail clients and `sqlite-utils`.
|
|
45
|
+
- **tokmesh** and **UniSessions** document/parse the CLI `sessions.db`;
|
|
46
|
+
the schema itself is tracked by
|
|
47
|
+
[`devin-internals-spec`](https://github.com/Icaro0310/devin-internals-spec),
|
|
48
|
+
which this project uses for versioned, read-only access.
|
|
49
|
+
- **devin-history** (sibling repo) exports sessions to Markdown/JSON;
|
|
50
|
+
devin-search complements it with instant ranked lookup instead of a
|
|
51
|
+
static dump.
|
|
52
|
+
|
|
53
|
+
## What makes it Devin-native
|
|
54
|
+
|
|
55
|
+
Results are **role-tagged and session-linked**, not raw grep hits. The
|
|
56
|
+
indexer understands Devin's real message structure through
|
|
57
|
+
`devin-internals-spec`'s typed parsers: user prompts vs assistant replies
|
|
58
|
+
vs tool calls (including `prompt_history` shell commands and GUI
|
|
59
|
+
`acp-messages` sessions), each stamped with its working directory and a
|
|
60
|
+
`ref` back to the exact source row. And because the store schema has had
|
|
61
|
+
17 migrations already, indexing **fails loudly** on an unknown schema
|
|
62
|
+
version instead of silently misreading it.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
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).
|
|
67
|
+
|
|
68
|
+
<!-- DIST-STATUS:BEGIN — generated from devin-powerups/registry.json -->
|
|
69
|
+
> **Source-only distribution.** This tool is not yet published to PyPI.
|
|
70
|
+
> Install from source:
|
|
71
|
+
>
|
|
72
|
+
> ```bash
|
|
73
|
+
> pipx install git+https://github.com/Icaro0310/devin-search.git
|
|
74
|
+
> # or
|
|
75
|
+
> uv tool install git+https://github.com/Icaro0310/devin-search.git
|
|
76
|
+
> ```
|
|
77
|
+
<!-- DIST-STATUS:END -->
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# build/update the index (auto-detects Devin's stores; safe to re-run —
|
|
83
|
+
# only new rows are indexed each time)
|
|
84
|
+
devin-search index
|
|
85
|
+
|
|
86
|
+
# search everything
|
|
87
|
+
devin-search query "kubectl delete pod"
|
|
88
|
+
|
|
89
|
+
# filters: role, project, date, limit — --json on every command
|
|
90
|
+
devin-search query "TypeError" --role assistant --project myrepo
|
|
91
|
+
devin-search query "migration" --since 2026-09-01 --limit 5 --json
|
|
92
|
+
|
|
93
|
+
# link hits to devin-history export notes
|
|
94
|
+
devin-search query "kubectl" --history-dir ~/notes/devin-history
|
|
95
|
+
|
|
96
|
+
# deterministic index: sessions.db only, never the auto-detected acp dir
|
|
97
|
+
devin-search index --no-acp
|
|
98
|
+
|
|
99
|
+
# zero-hit stats from the local query log (evidence for/against semantic
|
|
100
|
+
# search — SE-1's trigger; log is opt-out via query --no-log)
|
|
101
|
+
devin-search misses
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Hits print as `WHEN · ROLE · PROJECT · SESSION · SNIPPET` with the match
|
|
105
|
+
wrapped in `«»`; each hit carries a `ref` (e.g. `node:1234`,
|
|
106
|
+
`acp:file.db:7`) pointing back to the exact source row.
|
|
107
|
+
|
|
108
|
+
With `--history-dir <dir>` pointing at a
|
|
109
|
+
[`devin-history`](https://github.com/Icaro0310/devin-history) export
|
|
110
|
+
directory, each hit whose session has an exported note gets a `note: <path>`
|
|
111
|
+
line under its row (and a `history_note` field in `--json`). Notes are
|
|
112
|
+
matched by the `<YYYY-MM-DD>_<session-id>.md` filename devin-history writes
|
|
113
|
+
(`.json` exports work as a fallback). A missing note produces no link and
|
|
114
|
+
no error — the flag is purely additive.
|
|
115
|
+
|
|
116
|
+
## Works with Devin alone (Devin-only mode)
|
|
117
|
+
|
|
118
|
+
devin-search builds and queries a fully local index over Devin's session
|
|
119
|
+
stores. Nothing is sent anywhere; the index lives on your disk next to the
|
|
120
|
+
data it covers.
|
|
121
|
+
|
|
122
|
+
## Platform support
|
|
123
|
+
|
|
124
|
+
Tested on **Windows and Linux** (`windows-latest` + `ubuntu-latest` in CI).
|
|
125
|
+
The CLI session DB is auto-detected from `%APPDATA%/devin/cli/sessions.db`
|
|
126
|
+
on Windows and `$XDG_DATA_HOME/devin/cli/sessions.db` on Linux (default
|
|
127
|
+
`~/.local/share/devin/cli/sessions.db`). ACP logs are searched under
|
|
128
|
+
`$XDG_CONFIG_HOME/Devin/User/acp-messages` (default
|
|
129
|
+
`~/.config/Devin/User/acp-messages`). A legacy `~/.config/devin` layout is
|
|
130
|
+
also checked. Use `--sessions-db` or `--acp-dir` to override.
|
|
131
|
+
|
|
132
|
+
## Limitations
|
|
133
|
+
|
|
134
|
+
- **Schema-gated.** Only `sessions.db` schema v15–v17 is accepted; newer
|
|
135
|
+
versions fail loudly (update `devin-internals-spec` first).
|
|
136
|
+
- **Opaque payloads.** `chat_message`, `tool_call_*_json` and acp
|
|
137
|
+
`payload` formats are undocumented/unstable — text extraction is
|
|
138
|
+
best-effort and tolerant, not contractual.
|
|
139
|
+
- **Keyword search only (M1).** BM25 over tokens — no synonyms or
|
|
140
|
+
embeddings; semantic search is an opt-in M2 candidate.
|
|
141
|
+
- **Deletion lag.** New rows are picked up incrementally, but rows
|
|
142
|
+
deleted mid-table upstream can stay in the index until `--rebuild`
|
|
143
|
+
(tail-pruned sources are detected and re-indexed automatically).
|
|
144
|
+
- **Read-only by design** — the tool never writes to Devin's stores; the
|
|
145
|
+
only file it creates is `search.db`.
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pip install -e ".[dev]"
|
|
151
|
+
pytest
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Fixtures are generated at test time by `devin_internals.fixtures` (real
|
|
155
|
+
v17 DDL, synthetic rows) — no binary fixtures are committed.
|
|
156
|
+
|
|
157
|
+
## When to use this
|
|
158
|
+
|
|
159
|
+
- You remember Devin ran a command, hit an error, touched a file, or made a
|
|
160
|
+
decision, and scrolling sessions one by one is too slow.
|
|
161
|
+
- You want ranked results tagged by role (user / assistant / tool call) with
|
|
162
|
+
a `ref` back to the exact source row.
|
|
163
|
+
- Your session history must stay on disk — the index is fully local, no
|
|
164
|
+
telemetry, no network calls.
|
|
165
|
+
- You want incremental indexing: re-running `devin-search index` only picks
|
|
166
|
+
up new rows.
|
|
167
|
+
|
|
168
|
+
## When NOT to use this
|
|
169
|
+
|
|
170
|
+
- You need semantic or synonym-aware search — M1 is keyword BM25 only;
|
|
171
|
+
embeddings are an opt-in M2 candidate.
|
|
172
|
+
- You need session *observability* (activity, context size, token peaks) — use `devin-metrics`;
|
|
173
|
+
or relationship queries — use `devin-graph`.
|
|
174
|
+
- Your `sessions.db` schema is outside v15–v17 — indexing refuses loudly
|
|
175
|
+
rather than misreading it.
|
|
176
|
+
|
|
177
|
+
## FAQ
|
|
178
|
+
|
|
179
|
+
**What is devin-search?** A local full-text search engine over your Devin
|
|
180
|
+
session history. It indexes Devin's SQLite stores with FTS5/BM25 and answers
|
|
181
|
+
queries like `devin-search query "kubectl delete pod"` in under a second,
|
|
182
|
+
with results tagged by role and linked back to the source row.
|
|
183
|
+
|
|
184
|
+
**Does devin-search send my session data anywhere?** No. Everything runs
|
|
185
|
+
locally: it reads Devin's stores read-only and writes a single `search.db`
|
|
186
|
+
index next to your data. There are no network calls and no telemetry.
|
|
187
|
+
|
|
188
|
+
**Does it write to or modify Devin's databases?** No. Devin's stores are
|
|
189
|
+
opened read-only by design; the only file devin-search creates is its own
|
|
190
|
+
`search.db` index.
|
|
191
|
+
|
|
192
|
+
**How is this different from `devin-history`?** devin-history exports
|
|
193
|
+
sessions to static Markdown/JSON files. devin-search complements it with
|
|
194
|
+
instant ranked lookup across all sessions, without exporting anything.
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "devin-search"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Full-text search across all Devin sessions — find that command, that error, that decision."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{ name = "Icaro0310" }]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"devin-internals-spec>=0.3.0,<0.4.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.optional-dependencies]
|
|
18
|
+
dev = ["pytest>=8"]
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
devin-search = "devin_search.cli:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
|
25
|
+
|
|
26
|
+
[tool.pytest.ini_options]
|
|
27
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|