[HN Gopher] Show HN: Mantic.sh - A structural code search engine...
       ___________________________________________________________________
        
       Show HN: Mantic.sh - A structural code search engine for AI agents
        
       Author here! Some context: I published this 48 hours ago and it was
       auto-listed on MCPMarket (the MCP tools directory). Got 700+
       organic downloads with zero marketing--developers were actively
       searching for exactly this solution.  The "Git Accelerator"
       optimization story:  Initially used a file walker that took 6.6s on
       Chromium. Profiling showed 90% was filesystem I/O. The fix: git ls-
       files returns 480k paths in ~200ms. Added smart heuristics for
       untracked files (only scan dirs <50k files), bringing total to
       0.46s.  Why this matters: Agents can't wait 10 seconds for search.
       Sub-500ms makes it feel instant, changing how they explore
       codebases.  Installation:                 Cursor: npx
       mantic.sh@latest       VS Code: npx mantic.sh@latest       CLI: npm
       i -g mantic.sh       Limitations: Mantic is optimized for precise
       queries ("find stripe webhook") where structure matters. For fuzzy
       exploratory search, traditional embeddings may still be better.
       Curious if HN has ideas for hybrid approaches.  Happy to answer
       questions!
        
       Author : marcoaapfortes
       Score  : 37 points
       Date   : 2026-01-06 13:48 UTC (9 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | oooyay wrote:
       | Hello! Cool tool, I'm going to give it a try on my personal
       | assistant. The vector DB prices look a bit cynical to me, even
       | incredible. Do you think you could break down how you arrived at
       | the cost estimation both for competing vector DBs and Mantic? For
       | example, I use Weaviate at the moment and I don't come close to
       | this cost even at a years perspective with a generous amount of
       | usage from multiple users (~60)
        
         | marcoaapfortes wrote:
         | Thanks for the kind words and for giving Mantic.sh a spin,
         | excited to hear how it works for your personal assistant!
         | 
         | The cost estimates were rough illustrations for high-usage
         | cloud setups (100 devs x 100 searches/day = ~3.65M
         | queries/year):
         | 
         | Vector embeddings: ~$0.003/query (OpenAI embeddings + managed
         | DB like Pinecone) - $10,950/yr Sourcegraph: Older Enterprise
         | rate (~$91/user/mo) - $109k/yr Mantic: $0 (local, no APIs/DBs)
         | 
         | You're spot on--these are high-end, Weaviate (esp. self-
         | hosted/compressed) can be way cheaper for moderate use like
         | your ~60 users.
         | 
         | I leaned toward worst-case managed pricing to highlight the "no
         | ongoing cost" upside.
         | 
         | Let me know how the trial feels!
        
       | raylad wrote:
       | MANTIC_IGNORE_PATTERNS seems not to be implemented, or am I
       | missing something?
        
         | marcoaapfortes wrote:
         | You're absolutely right, it wasn't implemented, just
         | documented. Thanks for catching that!
         | 
         | I just shipped v1.0.13 (literally 5 minutes ago) that
         | implements all three environment variables:
         | 
         | * MANTIC_IGNORE_PATTERNS - Custom glob patterns to exclude
         | files * MANTIC_MAX_FILES - Limit number of files returned *
         | MANTIC_TIMEOUT - Search timeout in milliseconds
         | 
         | Also fixed the regex bug that was breaking glob pattern
         | matching.
         | 
         | Appreciate you pointing it out, having users actually test the
         | features is way more valuable than my own QA.
        
       | esafak wrote:
       | What is "cognitive code search" "without embeddings"? Do you mean
       | you accept natural language queries and create embeddings on-the-
       | fly?
       | 
       | edit: That's structural or syntax-aware search.
        
         | marcoaapfortes wrote:
         | No embeddings at all, neither stored nor on-the-fly.
         | 
         | Instead of converting queries to vectors, Mantic.sh uses
         | structural inference, it ranks files based on path components,
         | folder depth, naming patterns, and git metadata.
         | 
         | So "stripe webhook" matches /services/stripe/webhook.handler.ts
         | highly because the path literally contains both terms in
         | logical positions, not because their embeddings are close in
         | vector space.
         | 
         | "Cognitive" just means it mirrors how developers already think
         | about code organization, it encodes intent into paths, so
         | searching paths directly often beats semantic similarity.
        
           | ta988 wrote:
           | so pretty close to how jetbrains ranks files in their search?
        
             | marcoaapfortes wrote:
             | Actually, I haven't used JetBrains, didn't know they did
             | something similar until now!
             | 
             | This came from a different angle I read about how the human
             | brain operates on ~20 watts yet processes information
             | incredibly efficiently. That got me thinking about how
             | developers naturally encode semantics into folder
             | structures without realizing it.
             | 
             | The "cognitive" framing is because we're already doing the
             | work of organizing code meaningfully Mantic.sh just
             | searches that existing structure instead of recreating it
             | as embeddings. Turns out path-based search is just
             | efficient pattern matching, which explains why it's so
             | fast.
             | 
             | Interesting to hear JetBrains converged on a similar
             | approach from the IDE side though!
        
       | warthog wrote:
       | Can you explain how you achieve this in more detail? Did not see
       | any in-detail explanation in the readme in repo
        
         | marcoaapfortes wrote:
         | Fair point the README focuses more on benchmarks than
         | implementation here's the short version:
         | 
         | 1. Use `git ls-files` instead of walking the filesystem (huge
         | speed win - dropped Chromium 59GB scan from 6.6s to 0.46s) 2.
         | Parse each file path into components (folders, filename,
         | extension) 3. Score each file based on how query terms match
         | path components, weighted by position and depth 4. Return top N
         | matches sorted by score
         | 
         | The core insight: /services/stripe/webhook.handler.ts already
         | encodes the semantic relationship between "stripe" and
         | "webhook" through its structure. No need to read file contents
         | or generate embeddings.
         | 
         | I should add an architecture doc to the repo, thanks for the
         | nudge.
        
       | vault wrote:
       | Is it possible that you are advertising mantic as an MCP tool
       | without it actually being one? Or at least please document how to
       | use it as such.
        
         | marcoaapfortes wrote:
         | Mantic is absolutely an MCP server! The installation is
         | documented right at the top of the README with one-click
         | install buttons:
         | 
         | For Cursor:
         | 
         | Click the "Install in Cursor" badge at the top of the README,
         | or Use this deep link: https://cursor.com/en-US/install-
         | mcp?name=mantic&config=eyJ0...
         | 
         | For VS Code:
         | 
         | Click the "Install in VS Code" badge, or Use this deep link:
         | https://vscode.dev/redirect/mcp/install?name=mantic&config=%...
         | 
         | Manual Installation: Add this to your MCP settings (e.g.,
         | ~/Library/Application
         | Support/Claude/claude_desktop_config.json):
         | 
         | json { "mcpServers": { "mantic": { "type": "stdio", "command":
         | "npx", "args": ["-y", "mantic.sh@latest", "server"] } } }
         | 
         | Once installed, Claude Desktop (or any MCP client) can call the
         | search_codebase tool to find relevant files before making code
         | changes.
         | 
         | The MCP server implementation is in src/mcp-server.ts
         | 
         | if you want to see the code.
        
       ___________________________________________________________________
       (page generated 2026-01-06 23:04 UTC)