Skip to content

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.
  1. Normalising task
  2. Searching local cache
  3. Searching personal namespace
  4. Searching enterprise network
  5. Checking external policy
  6. Searching public GitHub
  7. Expanding repository neighbourhood
  8. Searching public PatchMesh
  9. Comparing & ranking
  10. 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.

anatomy of a capsulecontent-addressed · signed provenance · trust-rated

Identity

  • Canonical task
    The normalised problem the capsule solves.
  • Language & runtime
    Where it applies — versions and ecosystem.
  • Dependencies
    What it needs to compile and run.

Code

  • Reusable artifacts
    The implementation, ready to adapt.
  • Tests
    Executable proof of behaviour.
  • Content hashes
    Content-addressed so reuse is verifiable.

Evidence

  • Validation results
    Did the tests actually pass?
  • Security scan
    Known-issue check before reuse.
  • Reuse outcomes
    How it performed for others — ranking signal.

Trust

  • Licence (SPDX)
    Clear, preserved licensing.
  • Provenance
    Where it came from, pinned to a commit.
  • Trust level
    Verified, 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.

Real match, zero shared words

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.

  1. 1A coding agent receives a task.
  2. 2PatchMesh creates a canonical task description.
  3. 3The local agent fingerprints the permitted environment.
  4. 4Secrets and ignored files remain excluded.
  5. 5Local and personal caches are searched.
  6. 6The enterprise private network is searched.
  7. 7Organisation policy decides whether external search is allowed.
  8. 8GitHub Code Search finds seed implementations.
  9. 9Repository-neighbourhood discovery expands related projects.
  10. 10PatchMesh retrieves only relevant, bounded files (commit-pinned).
  11. 11GitHub results become unverified candidate capsules.
  12. 12The public PatchMesh network is searched.
  13. 13Results are compared and ranked with source + trust badges.
  14. 14The agent adapts the selected implementation.
  15. 15Tests run locally or via an approved enterprise validator.
  16. 16The outcome improves future ranking.
  17. 17Publication remains opt-in and policy controlled.
  1. AI coding agent
    MCP / CLI / REST
  2. Local agent
    Scan · fingerprint · redact · local cache
  3. PatchMesh index
    Semantic + lexical + structural search
  4. Artifact registry
    Content-addressed S3 (future P2P)
Search proceeds local → private → organisation → public. Only selected artifacts are retrieved; full repositories are never uploaded.