-
Notifications
You must be signed in to change notification settings - Fork 1
features search and context
Active contributors: Bryan
Search and context are the read path agents use most often. Search finds indexed nodes with SQLite FTS, and context turns those hits into a bounded reading list with graph neighbors.
search_nodes() in src/lode/storage.py answers raw search queries. build_context_pack() in src/lode/context.py turns search hits into an agent-ready response with summary, must_read, top_hits, related, confidence, and notes.
src/lode/storage.py # search_nodes, find_symbol, get_neighbors
src/lode/context.py # context pack assembly
src/lode/cli.py # search, symbol, context commands
src/lode/daemon.py # /search and /context endpoints
graph LR
Query --> FTS[node_fts]
FTS --> Hits[search_nodes]
Hits --> Rank[context_rank]
Rank --> MustRead[must_read list]
Hits --> Neighbors[get_neighbors]
MustRead --> Pack[context pack]
Neighbors --> Pack
The context pack favors local code over ExternalSymbol placeholders through context_rank() in src/lode/context.py. It estimates item cost in estimate_item_cost() and avoids duplicate path/line ranges.
| File | Purpose |
|---|---|
src/lode/storage.py |
FTS, symbol, and neighbor queries. |
src/lode/context.py |
Context response assembly. |
src/lode/cli.py |
CLI commands. |
src/lode/daemon.py |
HTTP endpoints. |
tests/test_lode.py |
Search and context tests. |
Tune match quality in search_nodes() in src/lode/storage.py or response packing in src/lode/context.py. Keep output bounded and include path/line citations for agent use.