Repo-local codebase oracle for AI coding agents. Exact symbol search, semantic search, routes, and call graphs across 16 languages, from Python and Go to Dart and Swift.
npx skills add https://github.com/husnainpk/symdex --skill symdex-code-searchCLI를 사용하여 이 스킬을 설치하고 작업 공간에서 SKILL.md 워크플로 사용을 시작하세요.
Symbolic indexing for agentic AI systems.
SymDex turns a checked-out repository into a local symbolic index of code structure, routes, relations, docs, tests, and context so AI coding agents can reason, retrieve, and act without reading whole files first.
Exact symbols, routes, callers, callees, file outlines, semantic matches, and token-budgeted context packs for coding agents.
# Install the lean core
pip install symdex
# Add local semantic search when you want the sentence-transformers backend
pip install "symdex[local]"
# Or install the local semantic backend as an isolated CLI tool
uv tool install "symdex[local]"
# Or run without installing
uvx symdex --help
# Upgrade an existing install
py -m pip install -U symdex
uv tool upgrade symdex
uvx symdex@latest --help
# Install the SymDex agent skill globally for supported agents
npx skills add https://github.com/husnainpk/SymDex --skill symdex-code-search --yes --global
SymDex is a repo-local symbolic indexing engine for AI coding agents. It maps a project into exact symbols, files, routes, relations, docs, tests, and retrieval context, then exposes that map through CLI commands and MCP tools.
AI coding agents are useful until they have to rediscover your repo from scratch. They open whole files, grep broad patterns, miss the route handler, read the same utility twice, and spend thousands of tokens just getting oriented.
SymDex gives agents a repo-local retrieval layer before they start reading code. You keep the index on your machine, choose the embedding backend only when semantic search is useful, and expose the same project map through both CLI commands and MCP tools.
It indexes your project into a small local SQLite knowledge base with:
Then agents can ask for the narrow slice they need: the function, route, caller chain, file outline, intent match, or a token-budgeted context pack for a broader feature question. That means less blind browsing, less context waste, and responses that can explain how much token budget SymDex saved.
SymDex is local-first. Base symdex keeps symbol, text, route, graph, and MCP features lean. Install symdex[local] only when you want local semantic embeddings, or point the hosted backend at Voyage, OpenAI-compatible services, Gemini, or a compatible proxy when you want remote embeddings.
Current product capabilities in this checkout:
0.1.26; latest public tag v0.1.26roi, roi_summary, and roi_agent_hint fields so agents can mention savings in their final responsequality fields so agents can judge confidence, index freshness, parser mode, generated paths, and embedding availability before reasoning from a resultsymdex pack and MCP build_context_pack for query-shaped, token-budgeted evidence bundlessentence-transformers, Voyage, OpenAI-compatible /embeddings, and Gemini EmbeddingSYMDEX_EMBED_RPM request pacing for hosted embedding providerssymdex index --lazy for fast foreground structural indexing while embeddings build in a background watchersymdex watch by default: structural refresh without loading embedding models unless --embed is passed./.symdex state for Docker, portable workspaces, and teams that do not want indexes hidden in home directoriespip, uv tool, and uvx commands when a newer release existsInstall the SymDex code-search skill when you want supported agents to use SymDex before broad file browsing:
npx skills add https://github.com/husnainpk/SymDex --skill symdex-code-search --yes --global
If you want the interactive installer instead, omit --yes --global.
The skill tells agents to:
The skill lives in this repo at skills/symdex-code-search/SKILL.md and follows the standard skills/<name>/SKILL.md layout.
Installing through the skills CLI uses the same public path that skills.sh indexes.
# Install the lean core
pip install symdex
# or
uv tool install symdex
# Index a project
symdex index ./myproject --repo myproject
# Search by symbol name
symdex search "validate_email" --repo myproject
# Search by literal text
symdex text "JWT" --repo myproject
# Add local semantic search only when you want embeddings
pip install "symdex[local]"
# Search by intent
symdex semantic "check email format" --repo myproject
# Build a token-budgeted context pack for an agent
symdex pack "how checkout auth works" --repo myproject --budget 6000
# Show HTTP routes
symdex routes myproject -m POST
# Start the MCP server
symdex serve
Notes:
--repo on symdex index or symdex watch, SymDex auto-generates a stable repo id from the current git branch and worktree path hash.roi_agent_hint, so agents can fold the savings into their user-facing response instead of burying it in logs.pip, uv tool, and uvx.SYMDEX_STATE_DIR=.symdex on first index to keep repo databases, registry.db, and registry.json inside the current workspace. After that, commands run from the workspace auto-discover the local state.--state-dir can be passed either globally or after the subcommand, for example symdex --state-dir .symdex repos or symdex repos --state-dir .symdex.index and repos. Shell compatibility aliases also accept MCP-shaped names like index-folder, index-repo, and list-repos.symdex index, symdex index --lazy, or symdex watch --embed.Add to your agent config:
{
"mcpServers": {
"symdex": {
"command": "uvx",
"args": ["symdex", "serve"]
}
}
}
HTTP mode:
{
"mcpServers": {
"symdex": {
"url": "http://localhost:8080/mcp"
}
}
}
SymDex defaults to ~/.symdex and also supports a workspace-local state directory for portable and containerized workflows.
Use it like this on first setup:
SYMDEX_STATE_DIR=.symdex symdex index ./myproject --repo myproject
That creates:
./.symdex/<repo>.db./.symdex/registry.db./.symdex/registry.jsonregistry.json is the human-readable manifest. In workspace-local mode it stores relative root_path and db_path values, so you can inspect what is indexed without opening SQLite.
After the local state exists, SymDex auto-discovers it from the current workspace or any nested subdirectory.
| Feature | Details |
|---|---|
| Symbol search | Find functions, classes, and methods with exact byte offsets |
| Semantic search | Find code by intent instead of exact name |
| Text search | Search indexed files by literal text across the repo |
| Byte-precise retrieval | Read only the symbol span you need |
| File outline | List symbols in a file without transferring the whole file |
| Repo outline | Get a directory tree plus repo summary through MCP |
| Call graph | Trace callers, callees, and circular dependencies |
| HTTP routes | Extract Flask, FastAPI, Django, Express, Spring/Kotlin, Laravel, Gin-style Go, ASP.NET, Rails/Sinatra, Phoenix, and Actix routes |
| Context packs | Build token-budgeted evidence bundles from symbols, routes, text, docs, tests, graph neighbors, and optional semantic matches |
| Markdown-aware docs | Index Markdown headings and supported fenced code blocks for SDK docs, specs, repo docs, and design notes |
| Auto-watch | Re-index on change, avoid duplicate watchers, stay low-memory by default, and auto-exit after idle time |
| Cross-repo registry | Manage multiple indexed repos from one local registry |
| Workspace-local state | Keep repo databases, registry.json, and watcher metadata inside ./.symdex for Docker and portable workspaces |
| Search ROI footer | One-line approximate token savings after successful search commands |
| Agent ROI hint | MCP tools return roi_agent_hint so agents can mention savings naturally in their replies |
| Retrieval quality metadata | MCP and CLI JSON outputs expose confidence, freshness, parser mode, language surface, generated-file hints, and embedding availability |
| Code summary | Files, Lines of Code, symbols, routes, skipped files, and languages after indexing |
| Optional embedding backends | Use local embeddings, Voyage, OpenAI-compatible /embeddings, Gemini, or a compatible proxy only when needed |
AI codebase tools now split into a few strong categories: enterprise code search, IDE-native assistants, LSP-backed agent toolkits, repo-map systems, and whole-repo prompt packers. SymDex sits in a narrower but useful slot: a local-first retrieval layer that combines exact symbols, text search, optional semantic search, query-driven context packs, HTTP routes, callers, callees, file outlines, repo outlines, Markdown/fenced-code indexing, repo stats, token-savings hints, retrieval quality metadata, CLI access, and MCP access without requiring an editor session or hosted index.
That makes SymDex strongest when an agent needs a portable codebase map it can query before reading files.
| Need | Common fit | Where SymDex fits |
|---|---|---|
| Enterprise code search across many hosted repos | Sourcegraph-style code search | SymDex is smaller and local-first; it focuses on agent retrieval from checked-out worktrees rather than enterprise code search operations |
| IDE-native codebase chat and autocomplete | Cursor, Continue, Cody, and similar editor assistants | SymDex is editor-agnostic; agents can use the same repo index from a terminal, stdio MCP, or HTTP MCP client |
| IDE-grade semantic retrieval and refactoring | LSP-backed tools and Serena-style agent toolkits | SymDex does not try to be a refactoring engine; it focuses on retrieval primitives agents need before deciding what to edit |
| Whole-repo context packaging | Repomix and other prompt-packing tools | SymDex builds query-driven context packs from indexed evidence instead of packing the whole repository into one prompt artifact |
| Agent repo maps for coding sessions | Aider-style repository maps | SymDex exposes queryable indexes, token-budgeted context packs, routes, call graphs, Markdown headings, semantic search, ROI hints, and retrieval quality metadata rather than only a condensed map |
| Lightweight local retrieval across code and docs | SymDex | SymDex's edge is the combined surface: CLI + MCP, SQLite indexes, 21 language surfaces, context packs, route extraction, call graphs, Markdown/MDX support, retrieval quality signals, optional embeddings, low-memory watch, and workspace-local state |
Use a language server when you need deep type-system reasoning or editor-native refactors. Use an enterprise code search platform when you need organization-wide search, permissions, and code monitoring. Use a prompt packer when you want to hand an entire repo snapshot to a model. Use SymDex when you want an AI coding agent to ask precise repo-local questions before it spends tokens reading files.
# Indexing and maintenance
symdex index ./myproject --repo myproject # Index with an explicit repo id
symdex index ./myproject # Auto-name from git branch + path hash
symdex index ./myproject --repo myproject --no-embed # Skip semantic embedding work
symdex index ./myproject --repo myproject --lazy # Index code now, embed in a background watcher
symdex watch ./myproject --repo myproject # Keep an index fresh without loading embedding models
symdex watch ./myproject --repo myproject --embed # Also refresh semantic embeddings on change
symdex invalidate --repo myproject # Force re-index of a repo
symdex invalidate --repo myproject --file app.py
symdex gc # Remove stale index databases
symdex repos # List indexed repos
# Search
symdex search "validate_email" --repo myproject
symdex search "validate_email" # Search across all indexed repos
symdex find validate_email --repo myproject # Exact lookup
symdex text "JWT" --repo myproject
symdex semantic "check auth token" --repo myproject
symdex pack "how auth token refresh works" --repo myproject --budget 6000
symdex pack "document checkout API" --repo myproject --include routes,docs,tests --format json
# Navigation
symdex outline auth/utils.py --repo myproject
symdex callers validate_email --repo myproject
symdex callees validate_email --repo myproject
symdex routes myproject
symdex routes myproject --method POST
symdex routes myproject --path /api
# Server
symdex serve
symdex serve --port 8080
MCP currently exposes additional repo-tree and repo-stats views that are not surfaced as dedicated CLI commands: get_file_tree, get_repo_outline, get_index_status, and get_repo_stats.
SymDex currently exposes 21 MCP tools:
| Tool | Purpose |
|---|---|
index_folder |
Index a local folder and return indexing statistics |
index_repo |
Index a repo and register it in the central registry |
search_symbols |
Find functions, classes, and methods by name |
semantic_search |
Find symbols by meaning using embedding similarity |
search_text |
Search indexed files by text and return matching lines |
build_context_pack |
Build a token-budgeted evidence bundle for an agent query |
get_symbol |
Read one symbol by byte offsets |
get_symbols |
Bulk exact-name symbol lookup |
get_file_outline |
List symbols in a single file |
get_file_tree |
Return a directory tree without file contents |
get_repo_outline |
Return a repo tree plus summary stats |
get_callers |
Return symbols that call a named function |
get_callees |
Return symbols called by a named function |
search_routes |
Query extracted HTTP routes |
get_index_status |
Return symbol count, file count, Lines of Code, staleness, and watcher state |
get_repo_stats |
Return repo metrics such as language mix, fan-in, fan-out, and circular dependency count |
get_graph_diagram |
Generate a Mermaid call graph |
find_circular_deps |
Detect circular dependencies |
list_repos |
List all indexed repos |
invalidate_cache |
Force re-index on next use |
gc_stale_indexes |
Remove index databases for repos that no longer exist on disk |
| Language | Extensions |
|---|---|
| Python | .py |
| JavaScript | .js, .jsx, .mjs, .cjs, .cjsx, .mjsx |
| TypeScript | .ts, .tsx, .mts, .cts, .mtsx, .ctsx |
| Go | .go |
| Rust | .rs |
| Java | .java |
| Kotlin | .kt, .kts |
| Dart | .dart |
| Swift | .swift |
| PHP | .php |
| C# | .cs |
| C | .c |
| C++ | .h, .hh, .hpp, .hxx, .cpp, .cc, .cxx |
| HTML | .html, .htm |
| CSS | .css, .scss, .sass, .less, .stylus, .styl |
| Shell | .sh, .bash, .zsh |
| Elixir | .ex, .exs |
| Ruby | .rb |
| Vue | .vue script blocks parsed as JavaScript or TypeScript |
| Svelte | .svelte script blocks parsed as JavaScript or TypeScript |
| Markdown | .md, .markdown, .mdx headings plus supported fenced code blocks |
Powered by tree-sitter for code, language-pack grammar fallbacks, and a native Markdown scanner for headings and fenced code examples.
SymDex works with any MCP client that supports stdio or streamable HTTP.
| Platform | Typical setup |
|---|---|
| Codex CLI | Add to MCP settings |
| Gemini CLI | Add to MCP settings |
| Cursor | .cursor/mcp.json |
| Windsurf | Add to MCP settings |
| GitHub Copilot | .vscode/mcp.json |
| Roo | Add to MCP settings |
| Continue.dev | config.json |
| Cline | Add to MCP settings |
| Kilo Code | VS Code MCP settings |
| Zed | Add to MCP settings |
| OpenCode | opencode.json |
| Any MCP client | uvx symdex serve or symdex serve --port 8080 |
Base symdex installs the lean core only. Choose the embedding extra that matches how you want semantic search to work:
symdex[local] for local sentence-transformerssymdex[voyage] for Voyage text embeddingssymdex[voyage-multimodal] for Voyage text plus images and PDFsRemote OpenAI-compatible and Gemini backends use the Python standard library HTTP client, so they do not add a required dependency.
pip install "symdex[local]"
SYMDEX_EMBED_BACKEND=local \
SYMDEX_EMBED_MODEL=all-MiniLM-L6-v2 \
symdex index . --repo myrepo
pip install "symdex[voyage]"
SYMDEX_EMBED_BACKEND=voyage \
VOYAGE_API_KEY=... \
SYMDEX_VOYAGE_MODEL=voyage-code-3 \
symdex index . --repo myrepo
SYMDEX_EMBED_BACKEND=voyage \
VOYAGE_API_KEY=... \
symdex semantic "parse source code" --repo myrepo
Use this for OpenAI, local OpenAI-compatible servers, and proxy services that expose POST /embeddings.
SYMDEX_EMBED_BACKEND=openai \
SYMDEX_EMBED_BASE_URL=https://api.openai.com/v1 \
SYMDEX_EMBED_MODEL=text-embedding-3-small \
SYMDEX_EMBED_API_KEY=... \
SYMDEX_EMBED_RPM=60 \
symdex index . --repo myrepo --lazy
For a local or proxy provider, set SYMDEX_EMBED_BACKEND=custom, point SYMDEX_EMBED_BASE_URL at its /v1 base URL, and set the model name it expects. If the provider does not need an API key, omit SYMDEX_EMBED_API_KEY.
Gemini uses RETRIEVAL_DOCUMENT when indexing and RETRIEVAL_QUERY when searching.
SYMDEX_EMBED_BACKEND=gemini \
GEMINI_API_KEY=... \
SYMDEX_EMBED_MODEL=text-embedding-004 \
SYMDEX_EMBED_RPM=60 \
symdex index . --repo myrepo --lazy
pip install "symdex[voyage-multimodal]"
SYMDEX_EMBED_BACKEND=voyage
SYMDEX_VOYAGE_MULTIMODAL=1
VOYAGE_API_KEY=...
SYMDEX_VOYAGE_MULTIMODAL_MODEL=voyage-multimodal-3.5
symdex index . --repo myrepo
Multimodal mode lets SymDex index supported images, screenshots, and PDFs as searchable asset entries.
Notes:
symdex keeps symbol, text, route, and call-graph features without pulling in the local embedding stack.SYMDEX_EMBED_BACKEND is unset, SymDex uses the local backend when symdex[local] is installed.symdex[local] and downloads the model on first use.symdex[voyage].symdex[voyage-multimodal].SYMDEX_EMBED_BASE_URL, SYMDEX_EMBED_MODEL, and optional SYMDEX_EMBED_API_KEY or OPENAI_API_KEY.SYMDEX_EMBED_MODEL, SYMDEX_EMBED_BASE_URL, and SYMDEX_EMBED_API_KEY, GEMINI_API_KEY, or GOOGLE_API_KEY.SYMDEX_EMBED_RPM applies request pacing to remote backends. Use it when free tiers or proxies enforce requests-per-minute limits.symdex index --lazy performs the fast structural index first, then starts a background symdex watch --embed process so embeddings can fill in without blocking the foreground command.symdex index --no-embed skips semantic embedding work entirely.SYMDEX_VOYAGE_MULTIMODAL=1.SymDex is a repo-local symbolic indexing engine for AI coding agents. It indexes a project into a local SQLite knowledge base so agents can retrieve exact symbols, file outlines, HTTP routes, callers, callees, text matches, semantic matches, token-budgeted context packs, and repo summaries without reading whole files first.
SymDex reduces blind repo browsing. Instead of opening broad files and spending thousands of tokens on orientation, an agent can ask SymDex for the specific function, route handler, call graph edge, Markdown heading, or file outline needed for the current task.
Yes, as a code-comprehension and evidence layer. SymDex does not prove bugs by itself and is not a full static analyzer. It helps an agent investigate logic by retrieving exact definitions, callers, callees, routes, file outlines, text matches, semantic matches, documentation anchors, and query-driven context packs, then attaching quality metadata so the agent can see whether the evidence is fresh, parser-backed, generated, or missing embeddings before making a claim.
Yes. SymDex includes an MCP server with 21 tools for indexing, symbol search, semantic search, text search, context packs, file outlines, repo outlines, route search, call graph traversal, repo stats, cache invalidation, and stale-index cleanup. It also provides CLI commands for the same repo-local retrieval workflow.
Any MCP client that supports stdio or streamable HTTP can use SymDex. Typical setups include Codex CLI, Gemini CLI, Cursor, Windsurf, GitHub Copilot, Roo, Continue.dev, Cline, Kilo Code, Zed, OpenCode, and other MCP-compatible clients.
SymDex combines exact structural search with optional semantic search and token-budgeted context packs. Grep and ripgrep find text; language servers provide editor-native type navigation; embedding-only systems find approximate meaning; whole-repo packers produce large prompt artifacts. SymDex gives agents a pre-indexed local map with symbols, byte offsets, routes, call graphs, text search, semantic search, quality metadata, context packs, and MCP tools in one workflow.
No. SymDex is not a full type checker or automated refactoring engine. Use a language server when editor-native type reasoning or refactors matter. Use SymDex when an agent needs fast repo-local retrieval, route discovery, code outlines, semantic search, context packs, and lower-token navigation across one or more repos.
SymDex currently covers 21 language surfaces: Python, JavaScript, TypeScript, Go, Rust, Java, Kotlin, Dart, Swift, PHP, C#, C, C++, HTML, CSS-family stylesheets, Shell, Elixir, Ruby, Vue script blocks, Svelte script blocks, and Markdown. Markdown support includes .md, .markdown, and .mdx headings plus supported fenced code blocks.
Yes. SymDex extracts HTTP routes across Python, JavaScript/TypeScript, Spring/Kotlin, Laravel, Gin-style Go, ASP.NET, Rails/Sinatra, Phoenix, and Actix. Agents can query routes directly instead of manually scanning routers, decorators, controllers, or framework entry points.
Yes, when technical content depends on a codebase. Documentation, SEO, and Generative Engine Optimization (GEO) teams can use SymDex-powered agents to build source-backed context packs, find SDK examples, API routes, Markdown headings, feature implementations, and source-backed answers before updating developer docs, changelogs, comparison pages, or AI-search-friendly technical content. SymDex is a code retrieval layer, not a keyword research or rank tracking tool.
No, not by default. Install symdex[local] for local sentence-transformers semantic search; the model downloads once and then runs offline. Voyage, OpenAI-compatible, and Gemini embedding modes require network access unless the configured base URL points at a local server or private proxy.
Yes. pip install symdex keeps the core symbol, text, route, file outline, repo outline, call graph, and MCP features lean. Use symdex index --no-embed to skip embedding work entirely, or add embeddings later with symdex[local], Voyage, OpenAI-compatible, Gemini, symdex index --lazy, or symdex watch --embed.
symdex semantic say a repo has no semantic embeddings?That repo was indexed without an embedding backend, indexed with --no-embed, or kept fresh by the default low-memory watch mode. Enable the backend you want, then run symdex index, symdex index --lazy, or symdex watch --embed so semantic vectors are written into the index.
symdex watch keep a large embedding model in memory?No, not by default. symdex watch refreshes structural indexes without loading local embedding models unless --embed is passed. Watch mode also refuses duplicate watchers for the same repo/root, can auto-exit after idle time, and stores watcher metadata in the active state directory.
By default, each repo gets its own SQLite database under ~/.symdex, plus a central registry database. Set SYMDEX_STATE_DIR=.symdex or use symdex --state-dir .symdex ... to keep repo databases, registry.db, registry.json, and watcher metadata inside the current workspace.
Yes. SymDex maintains a registry of indexed repos, supports explicit --repo names, and can auto-generate stable repo ids from the current branch and worktree path when --repo is omitted. Use symdex repos to list indexes and symdex gc to clean stale entries after deleting worktrees.
Successful CLI search commands print a one-line ROI footer with approximate token savings. MCP search tools return structured roi, roi_summary, and roi_agent_hint fields so agents can mention retrieval savings in user-facing responses.
MCP results and CLI JSON outputs include a quality object with fields such as confidence, confidence_reason, index_fresh, last_indexed, parser_mode, language_surface, is_generated, has_embeddings, and route_confidence. Agents can use those fields to avoid over-trusting stale indexes, fallback text matches, generated files, or semantic searches from repos without embeddings.
After indexing, SymDex prints a code summary with file count, Lines of Code, symbol counts, route counts, skipped files, errors, and language breakdown. This helps teams confirm what was indexed before relying on search results.
Yes. Add a .symdexignore file at the repo root with gitignore-style patterns. SymDex also skips common generated, dependency, and build paths by default.
index_folder or list_repos while CLI docs say index and repos?index_folder and list_repos are MCP tool names. The canonical shell commands are symdex index and symdex repos, and compatibility aliases such as symdex index-folder and symdex list-repos are also accepted.
Yes. Interactive CLI commands can print a brief upgrade notice with exact commands for pip, uv tool, and uvx. JSON output stays quiet so structured consumers are not broken.
Yes. All core search and navigation features are available through the CLI, including symbol search, exact lookup, text search, semantic search, context packs, route search, callers, callees, outlines, repo listing, and stale-index cleanup.
Issues and PRs are welcome at github.com/husnainpk/SymDex.
If SymDex saves you tokens, a star helps other people find it.