AI code search over a whole business system

A UK procurement business with a .NET API, a WordPress site and a customised Zoho CRM

A search engine that gives an AI coding assistant cited answers about a business's code, CRM rules and three years of history, in about three seconds.

The problem

The business runs on a .NET Web API, a WordPress site, Zoho CRM code and automation, and three years of changes. An AI developer working on it spent a lot of time guessing search terms and reading file after file.

I built a retrieval engine over all of it and plugged it into Claude Code through an MCP server, so a question returns the most relevant passages with their exact file and line.

82%
of answers in the top 8, against 45% for keyword search
11,000+
searchable chunks from 2,000+ files
$0.56
total cloud spend; the rest runs on a local GPU

What I built

  • Indexing for seven kinds of source: documentation, C#, WordPress PHP, Deluge functions, CRM workflows, the CRM schema and git history
  • Chunking by meaning: one C# method, one PHP hook or one CRM rule per chunk, with CRM settings rewritten as plain sentences
  • Keyword and vector search run together, merged, then re-ranked by an AI model that reads each candidate against the question
  • A benchmark of 136 real developer questions with known answers, used to test every change
  • Re-indexing in seconds on every commit, with only git-tracked files indexed and every file scanned for secrets first

13,000 lines of C# and 271 automated tests, delivered in under two weeks.

Tools: C#, .NET 8, Roslyn, PostgreSQL, pgvector, Ollama, Qwen3 embedding and re-ranking models, Voyage AI, MCP, Claude Code

Diagrams and screenshots

Architecture diagram: seven knowledge sources feed a .NET indexer, which stores chunks in PostgreSQL with pgvector, served to Claude Code through an MCP server
Seven sources, one index, connected to the AI developer through MCP
Search pipeline diagram: keyword search and two vector searches run in parallel, are merged by rank fusion, then re-ranked by an AI model
How a search works: three searches, merged, then re-ranked
Bar charts of benchmark results: keyword search finds 45% of answers in the top 8, the full pipeline 82%
Benchmark results from 136 real developer questions

Need something similar?

Send a few lines about the problem. I'll reply with questions or a rough plan.

Email me about a project