Agentic Pattern Libraryby Vikas Goyal
← All patterns
58

Shared Knowledge Layer

Also known as: engineering knowledge base for agents, org memory, decision registry

An organization-wide store of decisions, conventions and lessons that every coding agent and engineer reads, with sources, ownership and access rules.

TrackAI-native software delivery FamilyKnowledge layer Maturity Emerging ChangesContext
01

Problem

A project memory file works for one repository, but most engineering knowledge spans many: architecture decisions, security rules, API conventions, lessons from incidents. Copied into each repo, it drifts out of date. Left in wikis and chat threads, agents never see it. Agents then re-make decisions the organization already settled, or treat an old opinion as current policy.

  • Knowledge spans many repositories and teams.
  • Agents need it in context, but only the relevant part.
  • Stale or unsourced knowledge is worse than none.
  • Some knowledge is restricted to certain teams.
02

Solution

Keep a shared, versioned knowledge layer that agents can query, separate from any single repository. Each entry has an owner, a source (the decision record, incident review or PR it came from), a date, and a label saying whether it is a fact (“service X owns refunds”) or an interpretation (“we prefer events over polling”). Access is scoped, so agents only see what their team may see. Agents retrieve only the entries relevant to the current task, and each repo’s project memory file links to the layer instead of copying it. Entries past their review date are flagged, and contradictions go to the owner to resolve.

03

Diagram

decision records incident reviews PRs · conventions Knowledge layer owner · source · date fact | interpretation access scope review date Retrievetask + scope Repo A agent+ CLAUDE.md Repo B agent+ CLAUDE.md Engineerssame source Ownersresolve · retire stale?

Each repo keeps a short memory file and draws the rest from one shared, sourced layer, filtered by task and by access.

04

When to use

Use it when

  • Many repositories share conventions and decisions
  • Agents keep re-deciding settled questions
  • Incident lessons need to reach every team
  • Some knowledge must stay within certain teams

Avoid it when

  • A single repository, where a project memory file is enough
  • No one is willing to own and review entries
  • Knowledge that changes daily; it belongs in live systems, not a store
05

Trade-offs

Latency A retrieval step before agent work
Cost Storage, retrieval and ownership time
Complexity Provenance, access scopes, review dates
Reliability Agents follow current, sourced decisions

Gains

  • One source of truth across repositories
  • Agents see why a rule exists, not just the rule
  • Incident lessons reach every team

Costs

  • Needs owners and a review cycle
  • Access rules add setup work
  • Poor retrieval floods context with irrelevant entries
06

Worked example

Scenario
An engineering group of 40 repositories where agents kept proposing direct database reads across service boundaries, against a decision made a year earlier.
  1. SeedArchitects add 60 entries from existing decision records, each with owner, source link, date and fact or interpretation label.
  2. LinkEach repo’s CLAUDE.md drops its copied rules and adds a pointer to the layer, plus repo-specific notes.
  3. AgentAsked to add a refund report, the agent retrieves 4 relevant entries, including the fact “Billing owns invoice data; read it through the Billing API” with its source decision.
  4. IncidentA production feedback loop adds a new entry on exchange rate handling; within a day, agents in three other repos follow it.
  5. ReviewA quarterly check flags 7 entries past their review date. Owners retire 2 and update 5.
07

Failure modes

FailureSymptomMitigation
Stale entriesAgents follow a rule the org abandonedReview dates; flag and expire unreviewed entries
Opinion as factOne engineer's preference becomes policyLabel fact versus interpretation; show the source
Context floodDozens of entries loaded for a small changeRetrieve by task and repo; cap the entries per task
Leaking restricted knowledgeAgents see entries outside their team's scopeEnforce access scopes at retrieval, not in the prompt