Engineering Corpus v0.1, research agents that cite their sources
Research agents can study how serious open-source projects solved the same problem before you design something. They run inside the coding agent you already use, and they read a library of the public repos you choose. Each finding comes back as owner/repo@sha path:line: the exact lines at a pinned commit, the license of the file, and a receipt that says whether you took the idea or copied the lines with their notice.
v0.1 is the first public version. The engine is MIT and runs on your machine.
One brief, as it came back
Section titled “One brief, as it came back”A developer asks:
my Python agent calls an LLM API and sometimes gets rate limits and timeouts. How do serious projects retry a failed LLM or HTTP request with exponential backoff, and which approach fits an app that runs as one process? I want no new services, and I can only copy code under permissive licenses.
A model can answer that question from memory. Memory holds the general advice. What each project chose is in its code, and the projects differ. One detail of this question shows it: how long to wait when a server sends a Retry-After header.
- deer-flow accepts a delay of up to 24 hours and falls back to its own backoff above that (
retry_after.py:7-16). - tradingagents caps it at 60 seconds (
reddit.py:151-165).
Claude Code ran the prior-art-researcher agent on it on 2026-11-13, against an index of 14 public repos, a different set from the repos of the benchmark. The agent made 52 calls to the corpus tools in 862 seconds, on Claude Opus 5.5: 99,224 output tokens and 1,802,609 input tokens, 1,539,847 of them cached context read again on later steps. The run cost $3.68 at list prices.
In a pilot on 2026-11-13 on Claude Sonnet 5.5, the agents’ runs with the pack cited 178 sources as owner/repo@sha path:line, and 174 of them resolved to a real commit, file and lines in the pinned clone. Each verified source cost $0.08 at list prices, counting the whole run. The pilot has the full table and says what it does not show.
The page it returned, unedited, is on the example brief page. Its pick, in its words:
Pick: B, your own loop, with the SDK’s
max_retries=0whenever an SDK sits underneath. The deciding constraint is that your client is unknown and the general case is any failed HTTP request. A only exists where an SDK offers the setting. B covers SDK calls and raw httpx/requests/urllib calls with one policy, and adds no dependency or service. Its state stays local, which is all one process needs (inference).
Every source on the page gets a receipt, for example:
To get one for your own question, ask your agent to run the prior-art-researcher agent on it. If an agent gets a question wrong, tell us with the failed-question form: the question, the agent, its receipt block and what was wrong.
What it does
Section titled “What it does”- The
prior-art-researcheragent runs the whole job as one subagent: it compares how real projects approach your problem, picks the approach that fits your constraints, finds real call sites of it, and writes one page with the approaches, the pick, the call sites and the license of every source. When a project keeps decision records (ADRs, RFCs and design notes), it reports why the maintainers chose their approach. In Claude Code it runs as a subagent, so only the page comes back to your conversation. - Each agent ends its report with a receipt, one line per source: the repo, the commit, the
lines, the license class, and either
pattern onlyorcopied with notice. A source under a restricted or unknown license is alwayspattern only. - Six more agents each do one part of the method.
corpus-minerfinds prior art for a feature,design-explorerlays out three to five different approaches,usage-findershows how real projects call a library or API,provenance-guardtraces a pasted snippet to its source and the notice it needs,precedent-reviewercompares your diff with how the corpus handles the same thing, andtest-scoutshows how real projects test the same behavior. - Under the agents sits a search engine. One search fuses a dense list and a keyword list, so it finds code by meaning and by name,
and each hit says why it matched. When the best match is weak for your index, the result says
no_strong_match, so your agent knows to doubt it. Every hit has a permalink pinned to the indexed commit, and lockfiles supply dependency facts, so your agent can ask which of your repos use a package, and how they call it. - Each file gets a license class. Code text comes back for permissive and copyleft files, and the other files return their location and license.
- Text from strangers stays data. Secrets are masked before anything is embedded, hidden characters show as markers, and you choose how files written to steer agents are served.
The agents reach the corpus through twelve read-only tools over MCP, on stdio or Streamable HTTP, and any MCP client can
call them directly. A pair named search and fetch serves ChatGPT.
The license rule
Section titled “The license rule”Code can be public on GitHub and still be closed to reuse. A repo can carry source-available terms that forbid paid use, and a repo with no license grants no permission at all. Engineering Corpus still indexes these repos, so your agent can find them, and it serves them by location.
| Class | Meaning | You get |
|---|---|---|
| P, B, W, C | Permissive, permissive with branding terms, weak copyleft, copyleft | the lines |
| R | Restricted: source-available or non-commercial terms | the location |
| U | Unknown or missing | the location |
The engine decides per file, from its own SPDX tag, the nearest license file, the license the repo declares, or a reviewed override you write. It reads SPDX expressions, and it counts a permissive license with restricting words added, such as Commons Clause, as restricted. A result explains each class among its hits in one sentence.
Every verdict is automated and is not legal advice. The license policy explains each class and what a verdict cannot tell you.
Text from strangers
Section titled “Text from strangers”The repos you index hold text written by strangers, and some of it is aimed at agents. The engine does four things about that:
- Betterleaks scans every repo before anything is embedded, and each secret becomes a
‹secret masked: <rule>›marker.corpus_readandcorpus_grepserve only the text that scan saw. - Hidden and bidirectional characters show as visible
<U+XXXX>markers, so a line reads the same to you and to the model. - Files written to steer AI agents, such as
AGENTS.md, are served, served with a warning or hidden, as you choose with--agent-files. - The local HTTP server listens on
127.0.0.1and refuses a foreignHostorOrigin. It has no authentication, so it refuses any other address unless you pass--allow-remote-bind, which belongs behind a proxy with authentication.
The security model has the details of each measure.
How well it finds things
Section titled “How well it finds things”A benchmark sends the same queries to Engineering Corpus and to public code search tools, and scores them on the same judgments. Read the held-out result first. On 58 held-out queries whose answers were recorded before any change made from them (a set since spent for tuning), the first 20 results hold 0.893 of the relevant files (Recall@20). Asked in keyword form, GitHub code search holds 0.402 and searchcode 0.369. On the 124 queries that some of our settings were tuned on, Engineering Corpus holds 0.953 and the three public tools, in keyword form, hold 0.433 to 0.446. Ours is lower on the held-out set. The answers to those 58 queries were recorded on 2026-11-12 and graded on 2026-11-13, before any change made from them. Their misses have fed ranking work since, so this set is spent for tuning, and a later set is the check on that work. The two sets hold different queries over different repositories, so we do not read the gap as the cost of tuning.
What can favour us: Engineering Corpus is one of the tools measured, and the project that makes it chose the repositories and the queries. The held-out queries are phrased from public issues, documentation indexes and file layouts of repositories outside the 12 the ranking settings were chosen on. Their answers were recorded before any change made from them, and none comes from the engine’s list of misses. The labels are the hand-written proofs plus one model grade per file: Claude Sonnet alone on the held-out set, Claude Sonnet and Claude Haiku on the tuned set, and no Opus round. Haiku and Sonnet agree at a weighted kappa of 0.838 on the 1,349 earlier pairs both graded, not on the held-out set, and agreement with a person was not measured. A file GitHub code search or searchcode returned that did not exist at our pinned commit counts as not relevant (if every such file counted as relevant, the better of them would reach 0.487, and ours stays ahead). Files no judge graded count as not relevant too, and grading them could move any tool’s score either way. The judges graded only the first ten files of each answer, so ranks 11 to 20, which Recall@20 reads, are ungraded for every tool: in the first ten results 11.7% of GitHub code search’s, 8.9% of searchcode’s and none of ours were never graded; in the first twenty, 36.4%, 33.1% and 43.3%. If every ungraded file in a tool’s top 20 counted as relevant instead (all of one tool’s files or none, eight combinations), Recall@20 would run from 0.631 to 0.963 for ours, 0.175 to 0.561 for GitHub code search and 0.153 to 0.535 for searchcode, and ours is first in all eight.
How the benchmark works gives the queries, the judging and the commands, so you can run it and check us. The results list every reason we know of that the numbers could favour us, with the date of each run, and the comparison sets the four tools side by side, with what each one’s own documentation says. We measured retrieval, one call at a time. A direct call returns each hit with its license class and an automated license verdict, and costs 1,806 tokens per relevant hit, against 941 for GitHub code search and 1,351 for searchcode, whose answers carry neither (o200k_base tokens). How much the agents improve a coding agent’s finished work is not measured. The one agent-level measurement is a small pilot of what the pack changes in the report an agent writes: 17 of 21 checks passed with the pack and 2 of 21 without, over seven cases with one run each way, and the checks ask for the form the pack teaches.
Limits and removal
Section titled “Limits and removal”Limits of v0.1 lists each limit with where it comes from in the code and what you can do about it.
Anyone can ask for a repo to be left out, with no proof of ownership, through the removal form on the site or at hello@engineeringcorpus.com. A removed repo comes back only if its owner agrees.
Why I built it
Section titled “Why I built it”I hand my agent a GitHub link and tell it to take inspiration from it. Two days later it has forgotten the link.
I star repos on GitHub all the time, and I have starred more than 900. They are good examples I picked myself, my library for learning from other people, and I could no longer keep track of what was in it.
Clones took a lot of room on my disk and went out of date. My agents could not search by meaning, so we spent a lot of tokens, and they made up sources. I tried GitHub code search, Sourcegraph, cloning with grep and the agent’s own knowledge. I still needed this tool.
I need it most when I design a feature or look for ideas: what did other people think, and how did they turn the thought into working code? It widens my horizon. No single moment started this; it happened slowly.
I have been afraid of licenses for as long as I can remember. Nothing specific has ever happened to me, and I have always hoped it never will. A dispute over a license is not something I could take on. I want to learn from other people’s code on the terms their licenses set, so every result carries a license verdict, automated and not legal advice.
Seven agents do the studying. The designer agent compares designs and takes ideas; each of the others takes something else. The heavy evidence stays with the subagent, so my main context stays clean. Every report ends with a receipt for each source: the repository, the commit, the lines and the license class. I wanted every claim to be checkable. The tools work alone too, but agents get the most from them.
Try it and add your own stars. Report errors and send criticism; contribute if you want to. If you insist on paying me, a hosted version is planned. It does not exist yet.
Run it
Section titled “Run it”uvx engineering-corpus demouvx engineering-corpus stars YOUR_LOGIN --exclude-owner YOUR_EMPLOYERuvx engineering-corpus index stars.tomlclaude mcp add engineering-corpus -- uvx engineering-corpus servestars writes your public stars to stars.toml. Trim it before you index, because each repo is cloned and embedded.
Name the organizations you work for with --exclude-owner: the engine never indexes a private repo, and it calls no
organization API. Indexing needs git and Betterleaks 1.x on your PATH (on macOS, brew install betterleaks); the demo needs git but not Betterleaks.
Getting started walks through the first run. The code is in the GitHub repo, and the hosted service has a waitlist.