fsq-codebase
Enables fast semantic code search using FSQ embeddings, with zero-config indexing and support for multiple programming languages via the Model Context Protocol.
README
fsq-codebase
Zero-config codebase indexer with FSQ embeddings for fast semantic code search. Why Finite Scalar Quantization to compress? Because nobody has tried it before, that's why. Also FSQ still loosely maintains the shape of the vector and does not need a codebook, in case I ever wanted to round trip the embeddings back to code (for example for previewing purposes, like a jpg thumbnail).
Features
- Fast semantic search: 10x compression with int8 embeddings, 2.7x faster search
- Multi-language: Python, JavaScript, TypeScript, Go, Rust, Java, and more
- Zero-config: Just point at a directory and search
- MCP server: Claude Code integration via Model Context Protocol
Installation
Work in progress. For now you would need to build the model yourself. ANd
Quick Start
Python API
from fsq_codebase import CodebaseIndex, FSQEmbedder
# Index a codebase
index = CodebaseIndex.create("./my-project")
results = index.query("add rate limiting", top_k=10)
print(results.tree())
# Or use the embedder directly
embedder = FSQEmbedder.from_bundled("codet5plus-96d")
embeddings = embedder.encode(["def hello(): pass", "function greet() {}"])
MCP Server (Claude Code)
# Start the MCP server
fsq-codebase --index ./codebase.index
Configure in Claude Code's .mcp.json:
{
"mcpServers": {
"fsq-codebase": {
"command": "fsq-codebase",
"args": ["--index", "./codebase.index", "--verbose"]
}
}
}
Bundled Models
| Model | Encoder | FSQ Dim | Size |
|---|---|---|---|
codet5plus-96d |
CodeT5+ 110M | 96 | 268 KB |
unixcoder-96d |
UniXcoder | 96 | 652 KB |
The encoder (CodeT5+ or UniXcoder) downloads automatically from HuggingFace on first use (~440MB).
Performance
Compared to CodeT5+ baseline on CoIR benchmark:
| Model | MRR | Storage | Search Speed |
|---|---|---|---|
| CodeT5+ baseline | 0.9699 | 1024B | 0.39ms |
| fsq-codebase | 0.9706 | 96B | 0.14ms |
10.7x compression with 2.7x faster search while maintaining accuracy.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.