zeph-index
AST-based code indexing, semantic retrieval, and repo map generation for Zeph.
Overview
Implements the Code RAG pipeline that grounds the agent in a local codebase. Source files are parsed with tree-sitter into AST-level chunks (functions, structs, impl blocks) rather than fixed-size windows, embedded via the configured LLM provider, and written to a dual store: Qdrant for vector similarity and SQLite for exact hash deduplication. Retrieval classifies each query as semantic, grep, or hybrid, searches Qdrant, applies a score threshold, and packs results within a token budget. Concise repo maps are injected into the agent context unconditionally across all LLM providers, even when Qdrant is unavailable.
Key Modules
- chunker — tree-sitter AST-level chunking of source files
- indexer — orchestrates file discovery, parsing, and the embedding pipeline
- retriever — semantic / grep / hybrid search over indexed chunks with token budgeting
- store — Qdrant + SQLite dual-write store (
CodeStore) - repo_map — tree-style repository summaries (file paths + symbol signatures) injected into all LLM providers
- mcp_server — in-process MCP server (
IndexMcpServer) exposingsymbol_definition,find_text_references,call_graph, andmodule_summarytools - languages — language detection and tree-sitter grammar registry (
Lang) - context — retrieval-context assembly helpers
- watcher — filesystem watcher for incremental re-indexing
- error —
IndexErrorerror type
Supported languages
Full symbol extraction (functions, types, impls) drives repo map and MCP tools; the remaining grammars are used for AST-level chunking only.
| Language | Symbol extraction | Chunking |
|---|---|---|
| Rust | functions, structs, enums, traits, impls | yes |
| Python | functions, classes, methods | yes |
| JavaScript | functions, classes, arrow functions | yes |
| TypeScript | functions, classes, interfaces, types | yes |
| Go | functions, structs, interfaces | yes |
| Bash, TOML, JSON, Markdown | — | yes |
Usage
use Arc;
use ;
use ;
use CodeStore;
# async
Installation
Feature flags
| Feature | Default | Description |
|---|---|---|
sqlite |
yes | SQLite backend for the dedup store (via zeph-db, zeph-memory, zeph-tools) |
postgres |
no | PostgreSQL backend |
test-utils |
no | Test utilities and testcontainers for PostgreSQL integration tests |
[!NOTE]
zeph-indexdoes not depend onqdrant-clientdirectly. Vector storage is delegated tozeph-memory, which owns the Qdrant client lifecycle. Repo map generation works without Qdrant — it is injected into the agent context for all LLM providers unconditionally.
Documentation
Full documentation: https://bug-ops.github.io/zeph/
License
Licensed under either of MIT or Apache License, Version 2.0 at your option.