CLI tool to index and search AI agent sessions across multiple local agents and markdown notes.
Built for developers who run multiple AI coding agents (Hermes, Moltis, Nanobot, etc.) and want to search across all of them in one place.
- BM25 full-text search via tantivy — fast, local, no cloud
- Chunk-level indexing — user/assistant turn pairs, not whole sessions or individual messages
- Incremental indexing — only re-indexes changed sessions (fingerprint tracking in SQLite)
- Multiple source adapters:
- Hermes Agent — reads
~/.hermes/state.db(SQLite) - Moltis/Zeroclaw — reads
~/.moltis/sessions/main.jsonl(grouped byrun_id) - Nanobot — reads
~/.nanobot/workspace/sessions/*.jsonl - Markdown notes — configurable glob patterns for session notes, memory files, etc.
- Hermes Agent — reads
- Highlighted snippets with ANSI colors in terminal
- JSON output for piping to
jq,fzf, or other tools - Source filtering — search within a specific agent
- Tool call indexing — errors, file paths, and command output from tool calls are searchable (truncated to avoid noise)
- Memory file support — indexes
MEMORY.md,USER.md, etc. as searchable documents - Single static binary — zero runtime dependencies
cargo install --path .Requires Rust 1.85+.
# Index all detected sources
agentsearch index
# Search across everything
agentsearch search "compaction hermes"
# Filter by source
agentsearch search "KSeF auth" --source hermes
# Limit results
agentsearch search "error" --limit 5
# JSON output (for jq, fzf, scripts)
agentsearch search "auth" --format json
# Minimal output (one line per hit)
agentsearch search "auth" --format minimal
# Show indexed sources and counts
agentsearch sources
# Health check (exit 0 = healthy, exit 1 = no index)
agentsearch healthOptional config file: ~/.config/agentsearch/config.toml.
[hermes]
enabled = true
path = "~/.hermes/state.db"
[moltis]
enabled = true
path = "~/.moltis/sessions/main.jsonl"
[nanobot]
enabled = true
path = "~/.nanobot/workspace/sessions"
[notes]
enabled = true
globs = [
"~/SESSION-*.md",
"~/INFRA-*.md",
"~/RESEARCH-*.md",
"~/CHANGELOG-*.md",
"~/.hermes/memories/MEMORY.md",
"~/.hermes/memories/USER.md",
"~/.nanobot/workspace/memory/MEMORY.md",
"~/.nanobot/workspace/memory/HISTORY.md",
"~/.moltis/SOUL.md",
]These are the defaults — set enabled = false to disable a source, or override any path/glob values.
Sources are auto-detected based on standard paths:
| Source | Path | Format |
|---|---|---|
| Hermes | ~/.hermes/state.db |
SQLite (sessions + messages tables) |
| Moltis | ~/.moltis/sessions/main.jsonl |
JSONL grouped by run_id |
| Nanobot | ~/.nanobot/workspace/sessions/*.jsonl |
JSONL per session file |
| Notes | ~/SESSION-*.md, ~/INFRA-*.md, ~/RESEARCH-*.md, ~/CHANGELOG-*.md, + memory files |
Markdown files |
- Sources parse agent-specific formats into normalized
ItemChunkstructs - Chunks are user/assistant turn pairs (not individual messages, not whole sessions)
- Tantivy indexes chunks with BM25 for fast full-text search
- SQLite sidecar tracks fingerprints for incremental sync
- Search returns ranked chunks with highlighted snippets, grouped by session
- Index:
~/.local/share/agentsearch/index/ - Sync state:
~/.local/share/agentsearch/state.db
All source data is read-only — agentsearch never modifies your agent files.
src/
├── main.rs # CLI (clap): index, search, sources, health
├── index.rs # Tantivy schema, indexing, incremental sync, search
└── sources/
├── mod.rs # Source trait, ItemChunk, ItemKind
├── hermes.rs # Hermes Agent (SQLite reader)
├── moltis.rs # Moltis/Zeroclaw (cached JSONL parser)
├── nanobot.rs # Nanobot (per-file JSONL)
└── markdown.rs # Markdown notes + memory files
Implement the Source trait:
pub trait Source {
fn name(&self) -> &str;
fn scan(&self) -> Result<Vec<SourceItemMeta>>;
fn load(&self, item_id: &str) -> Result<Vec<ItemChunk>>;
}scan()returns lightweight metadata for incremental syncload()returns chunks for a specific item- Register your source in
build_sources()inmain.rs
MIT