kiro-session-index
Locate, outline, index and search Kiro agent session logs. Standard library only, no network access, sessions are opened read-only.
Supports both on-disk formats under ~/.kiro/sessions/:
- directory format (Kiro IDE / Kiro CLI
--agent-engine=v3):session.json+messages.jsonl+sub-executions/ - three-file format (Kiro CLI default engine):
cli/<id>.json+<id>.jsonl+<id>.lock
Usage
uvx kiro-session-index locate <session-id> [--children]
uvx kiro-session-index outline <session-id> [--json]
uvx kiro-session-index list [--workspace <path>] [--since-days N]
uvx kiro-session-index build --session <session-id> [--include-sub]
uvx kiro-session-index build --workspace <path> [--since-days N] # all sessions of a workspace
uvx kiro-session-index build <files-or-dirs...> # index a codebase
uvx kiro-session-index search "query" --index <dir> [--top N]
uvx kiro-session-index clean --index <dir> # always clean up
locateresolves an id (with or withoutsess_prefix, prefix match allowed) or a path, detects the format, and prints metadata, lock liveness, and derived sessions.outlinesegments a transcript into turns with start/end line numbers, per-turn tool usage, credits, sub-agent dispatches, and compaction/tombstone markers.listshows storage areas, or every session of a workspace (dir-formatworkspacePathsplus cli-formatcwd) with sizes and titles.buildcreates a disposable index as SQLite under.tmp/session-index/<name>/in the current directory: a TF-IDF inverted index (ASCII words + CJK bigrams), plus dense multilingual embeddings with--semantic.--workspaceindexes every session of a workspace incrementally: per-session shards skip unchanged sessions, duplicate copies across buckets are deduplicated (newest wins), and a fully fresh index returns in about a second. Measured worst case: 914 sessions / 640 MB → 72 s cold, ~0.2 s per query.searchranks chunks and every hit carriesfile:lineStart-lineEndso the caller can read exactly the lines it needs.--mode autouses hybrid ranking (reciprocal rank fusion of lexical + semantic) when the index has embeddings, else lexical.cleanremoves an index directory, refusing to delete anything it did not create.
Semantic search (optional extra)
uvx --from 'kiro-session-index[semantic]' kiro-session-index build --session <id> --semantic
uvx --from 'kiro-session-index[semantic]' kiro-session-index search "查询内容" --index <dir>
Embeddings come from minishlab/potion-multilingual-128M — a local open-source static embedding model (101 languages, 256 dims), run on CPU via model2vec + numpy; no torch, no cloud embedding API. The model downloads once (~230 MB) from Hugging Face into the local cache and is fully offline afterwards. Static embeddings make indexing fast enough for whole workspaces (thousands of chunks per second). Vectors are stored per content hash (float16 blobs in the same SQLite file), so incremental rebuilds only embed new text; scoring is exact brute-force cosine via one matrix product — no ANN needed at this scale. Cross-language recall works: a Chinese query like "硬件安全模块保管密钥" ranks English/mixed CloudHSM key-custody content at the top. Without the extra installed, the same index still serves lexical searches.
Indexes are temporary artifacts. Delete them with clean when the task is done.
Part of kiro-steering-agents; built to back a session-loader sub agent that reads big sessions in an isolated context.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kiro_session_index-0.3.0.tar.gz.
File metadata
- Download URL: kiro_session_index-0.3.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21864573aedaf3ddcdfde235890dbbbeb9eecb6ac500c015d66655bf5e8fd2af
|
|
| MD5 |
9e0f6edda1155b4076392264dc998d65
|
|
| BLAKE2b-256 |
b8bc2d4b90cdfcaf54615ad5187d32f863d30bccd21866d5f671aaabbb9c2c84
|
File details
Details for the file kiro_session_index-0.3.0-py3-none-any.whl.
File metadata
- Download URL: kiro_session_index-0.3.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c80bcdd9724f11d6962d714cf3397b4eeb268b86d7ac501f7ffc94c2c10485
|
|
| MD5 |
8c5dcd089a89ad370b809d077f468faf
|
|
| BLAKE2b-256 |
d9802f237c7c9d73eb765eb12d1b1a31dc4f61fcafda7fe02330b0fbc524f9ef
|