Mantic.sh  by marcoaapfortes

Structural code search engine for AI agents

Created 1 week ago

New!

409 stars

Top 71.3% on SourcePulse

GitHubView on GitHub
Project Summary

Mantic.sh is a structural code search engine designed to drastically reduce context retrieval overhead for AI agents. It addresses the challenge of efficiently searching massive codebases by providing sub-500ms file ranking without relying on embeddings, vector databases, or external dependencies. This makes it ideal for AI agents, developers using AI coding assistants, and teams working with large code repositories, offering significant speed improvements, reduced token usage, and enhanced privacy through local execution.

How It Works

Mantic.sh employs a unique approach by inferring user intent from file structure and metadata rather than performing brute-force content analysis. Its architecture includes an "Intent Analyzer" to categorize search queries, a "Brain Scorer" that ranks files based on path relevance, filename matching, and business logic awareness, and a "File Classifier" to filter by file type. This method enables retrieval speeds consistently under 500ms, even for codebases with hundreds of thousands of files, and reduces token consumption by up to 63% by pre-filtering irrelevant files.

Quick Start & Requirements

For immediate use, run the CLI directly with npx mantic.sh@latest "your search query". Installation from source involves cloning the repository, running npm install, npm run build, and npm link. Mantic.sh also functions as an MCP (Model Context Protocol) server for tools like Claude Desktop and Cursor, installable via IDE extensions or manual configuration. No external dependencies like API keys or databases are required, though Node.js is implicitly needed.

Highlighted Details

  • Achieves sub-500ms retrieval on large monorepos, demonstrated with Chromium (480k files) at 0.40s.
  • Operates with zero external dependencies, ensuring local execution and privacy.
  • Utilizes Git-native file scanning, prioritizing tracked files for speed.
  • Provides deterministic scoring for consistent and predictable search results.
  • Offers native MCP support for seamless integration with AI coding assistants.
  • Includes an impact analysis feature to identify the potential blast radius of code changes.

Maintenance & Community

The project includes a CHANGELOG detailing release notes and requires contributors to sign a Contributor License Agreement (CLA), indicating structured development and a commitment to its licensing model. Specific community channels like Discord or Slack are not detailed in the provided README.

Licensing & Compatibility

Mantic.sh is dual-licensed:

  1. AGPL-3.0: For open-source projects and internal business use. Requires any distributed derivative works to also be open-sourced under AGPL-3.0.
  2. Commercial License: Available for embedding Mantic.sh within proprietary software (e.g., commercial IDEs, SaaS platforms), with pricing starting at $500/year. This license avoids the AGPL-3.0's copyleft requirements.

Limitations & Caveats

The AGPL-3.0 license imposes significant copyleft obligations on distributed applications, which may necessitate a commercial license for proprietary integrations. While designed for speed, performance on extremely large or complex codebases may still warrant testing. Agent Rules for automatic Mantic usage are specified for IDEs only.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
8
Star History
413 stars in the last 7 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.4%
17k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 2 days ago
Feedback? Help us improve.