SuperAPIAI Directory

ken

github.com · AI agents

Hybrid code-search engine for agents, combining symbolic and embedding-based retrieval in a Go project that is described as MCP-compatible with semble.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

Purpose: ken provides codebase retrieval capabilities for AI agents, with the goal of "finding code snippets that can answer questions" rather than replacing grep for exhaustive enumeration.

Main capabilities: Hybrid retrieval using BM25 lexical retrieval + Model2Vec semantic embeddings + RRF fusion + code-aware reranking, with the algorithm ported line by line from semble's search.py and ranking/*.py. Officially stated to achieve about 97% recall@10 on semble's benchmark of 1,251 queries in default hybrid mode (NL 0.967 / symbol 0.995), and compared with grep + Read, median token consumption is about 46 times lower. Pure Go, no cgo, cross-compilable to Linux/macOS/Windows (amd64/arm64). Local CPU inference, no API keys, no GPU, no vector database, suitable for isolated environments.

Usage: Run ken-mcp as an MCP server, providing two core tools, search and find_related, over stdio. The parameter structure and output markdown format are consistent with semble, and the command path can be replaced to directly integrate into existing agents. On first run it automatically pulls an approximately 60 MB model (KEN_MCP_AUTO_FETCH=0 can disable this); when the model is not installed, it falls back to BM25 mode; the CLI can execute ken download-model. Starting from v0.3, ken index <path> enters watch mode by default, and --no-watch restores a one-time build. Supports Streamable HTTP remote transport (KEN_MCP_TRANSPORT=http), but a bearer token must be configured, and HTTP mode rejects KEN_DB_SAMPLE_ROWS>0; TLS must be terminated by a reverse proxy.

Applicable scenarios: Retrieval over mixed corpora of source code and documentation, with language-aware chunking for Python/Go/TypeScript/Java/Rust, and markdown chunked by headings; it can also index static .sql files and live schemas of Postgres/SQLite/MySQL/MariaDB. Supports .kenignore for excluding files and is compatible with .sembleignore.

Limitations: The semantic model for pure prose or literary text has not been validated; it is recommended to use --mode=bm25; exhaustive tasks such as refactoring or auditing before renaming should still use grep. The treesitter chunker is optional, and the overall NDCG change is within the noise range.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools