marcoaapfortes/Mantic.sh
A structural code search engine for Al agents.
What it solves
Mantic is a context-aware code search engine designed to reduce the overhead of context retrieval for AI agents and developers. It solves the problem of "noisy" search results common in tools like grep or ripgrep by prioritizing relevance and intent over raw speed, ensuring that AI agents receive only the most pertinent files, which reduces token usage and improves accuracy.
How it works
Mantic uses an infrastructure layer that infers intent from file structures and metadata rather than brute-force reading every file. Its process includes:
- Intent Analysis: Categorizes queries (e.g., UI, backend, auth) and uses CamelCase detection and path sequence matching to find relevant files.
- Structural Scoring: Ranks files based on exact filename matches, path relevance, and business logic awareness (e.g., boosting
.service.tsover.test.ts). - Hybrid Intelligence: Combines heuristic scoring with semantic reranking using local embeddings via
transformers.jsfor conceptual searches. - Code Intelligence: Utilizes Tree-sitter for "Go to Definition" and "Find References" capabilities across monorepos.
- Learning: Saves successful search patterns locally to share knowledge across teams.
Who it’s for
- AI Agents: To provide high-quality, filtered context for coding tasks.
- Developers: Who need to find files by intent (e.g., "Where is the payment code?") or perform impact analysis to see the "blast radius" of a change.
- Teams: Who want a local-first, privacy-preserving search tool that can be committed to git.
Highlights
- MCP Server Support: Integrates directly with Claude Desktop, Cursor, and VS Code via the Model Context Protocol.
- Semantic Search: Supports neural reranking to find conceptually relevant code without exact keyword matches.
- Zero-Query Mode: Proactively provides context by showing modified files and related dependencies.
- Local-First: Runs entirely locally with zero data egress, ensuring privacy and zero cost.
- Cross-Repo Intelligence: Provides "Go to Definition" and "Find References" across entire monorepos.