How PatchMesh works
A local-first retrieval loop that keeps private code private while letting agents reuse verified solutions and discover external implementations under policy.
Try it — personal by default, enterprise modes on demand
Interactive demo
Example data — no live GitHub call is made.- Normalising task
- Searching local cache
- Searching personal namespace
- Searching enterprise network
- Checking external policy
- Searching public GitHub
- Expanding repository neighbourhood
- Searching public PatchMesh
- Comparing & ranking
- Estimating savings
Run the search to see ranked results.
The unit of reuse: a capsule
Everything the loop retrieves and ranks is a capsule. It is what makes reuse a decision rather than a gamble.
Identity
- Canonical taskThe normalised problem the capsule solves.
- Language & runtimeWhere it applies — versions and ecosystem.
- DependenciesWhat it needs to compile and run.
Code
- Reusable artifactsThe implementation, ready to adapt.
- TestsExecutable proof of behaviour.
- Content hashesContent-addressed so reuse is verifiable.
Evidence
- Validation resultsDid the tests actually pass?
- Security scanKnown-issue check before reuse.
- Reuse outcomesHow it performed for others — ranking signal.
Trust
- Licence (SPDX)Clear, preserved licensing.
- ProvenanceWhere it came from, pinned to a commit.
- Trust levelVerified, approved, or unverified candidate.
A snippet search returns text. A capsule returns a decision: reuse this, adapt that, or generate because nothing here fits.
Found by what it does — not what it's named
Keyword search only finds a capsule if you already know what it's called. PatchMesh indexes each capsule by its behaviour — the actual code, plus a plain-English summary of what it does and the questions it answers — so an agent finds the right solution from a description of the problem.
Query: “allocate a fixed number of seats to parties in proportion to their votes”→apportion_seatsverified
Not one word in common with the function's name — matched on meaning, ranked top, and marked verified because its tests were run and passed.
- 1A coding agent receives a task.
- 2PatchMesh creates a canonical task description.
- 3The local agent fingerprints the permitted environment.
- 4Secrets and ignored files remain excluded.
- 5Local and personal caches are searched.
- 6The enterprise private network is searched.
- 7Organisation policy decides whether external search is allowed.
- 8GitHub Code Search finds seed implementations.
- 9Repository-neighbourhood discovery expands related projects.
- 10PatchMesh retrieves only relevant, bounded files (commit-pinned).
- 11GitHub results become unverified candidate capsules.
- 12The public PatchMesh network is searched.
- 13Results are compared and ranked with source + trust badges.
- 14The agent adapts the selected implementation.
- 15Tests run locally or via an approved enterprise validator.
- 16The outcome improves future ranking.
- 17Publication remains opt-in and policy controlled.
- AI coding agentMCP / CLI / REST
- Local agentScan · fingerprint · redact · local cache
- PatchMesh indexSemantic + lexical + structural search
- Artifact registryContent-addressed S3 (future P2P)