What Sourcegraph Cody brings to the enterprise
Sourcegraph Cody is the codebase-aware AI assistant from Sourcegraph. Its core value is grounded retrieval — using the Sourcegraph code graph to fetch the actual relevant code, definitions, references, and prior implementations across very large repos. For enterprises with millions of lines and many services, Cody’s context quality is a different category from generic RAG.
The enterprise positioning is real. Cody operates against the existing Sourcegraph platform (code graph, code search, code intelligence) and integrates with enterprise SSO, access controls, and audit trails for retrieval. For teams that already use Sourcegraph, Cody is the natural AI extension.
- Codebase-aware retrieval via the Sourcegraph code graph
- Cross-repo and cross-service context at enterprise scale
- Integration with Sourcegraph code intelligence and code search
- Enterprise SSO, access controls, and audit for retrieval
- Multiple model backends through the Cody Gateway
Mneme HQ does not retrieve context. It is the typed-decision enforcement layer that runs at the Edit/Write boundary on whatever any coding agent — Cody included — proposes. The two solve different problems and compose well as separate layers in the enterprise AI coding stack.
Retrieves grounded context for the model: relevant code, definitions, references, prior implementations. Best for “what does this code do?” questions. Retrieval-shaped: surfaces information, does not enforce policy.
Evaluates architectural decisions against each proposed edit. Best for “is this edit allowed?” questions. Blocking-shaped: violations are stopped before they land, with the specific decision recorded per event.
The framing: Cody answers what the code is. Mneme answers what the edit is allowed to do. Enterprise AI coding governance needs both, at different layers.
Where they differ as layers in the stack
| Dimension | Sourcegraph Cody | Mneme HQ |
|---|---|---|
| Layer | Context retrieval for the agent | Enforcement at the Edit/Write boundary |
| Mechanism | Code graph plus RAG over the corpus | Typed decision corpus with scope matching |
| What it answers | What does the code do? | Is this edit allowed by the decisions made? |
| Enterprise integration | Sourcegraph platform native | Self-hosted hook into agents, IDEs, and CI |
| Compliance posture | Context to the model | Blocking enforcement on violations |
| Multi-agent reach | Cody clients | Any agent, any editor, any pre-commit hook |
| Audit | Which chunks were retrieved | Which decisions fired on which edits |
Three failure modes where retrieval is not enough
Cody’s retrieval is high quality. These failure modes are not Cody bugs — they are the structural limits of using retrieval as a stand-in for typed enforcement. Each is the reason enterprise stacks layer a governance step on top of retrieval.
1. Right context, wrong edit
Cody surfaces the relevant definitions, neighbors, and prior implementations. The model has everything it needs to write the right code. It still proposes an edit that violates an architectural decision the team has made — perhaps because the decision is about layering, not about the code shape, and isn’t inferable from retrieved chunks. Mneme matches the proposed edit against scoped decisions; the architectural boundary is enforced independent of how good the retrieval was.
2. Retrieval ranks the wrong precedent
A repo has both deprecated and current implementations of a pattern. Cody’s retrieval ranks the older, more numerous deprecated examples higher because they appear more often. The model takes a cue from them. The architectural decision (use the new pattern, supersedes the old) lives in an ADR that wasn’t top of the retrieval. Mneme’s supersession-aware precedence engine fires the current decision regardless of which precedent the retrieval surfaced.
3. Cross-service decisions are invisible to in-repo retrieval
An architectural decision applies across multiple services in different repos. Cody’s code graph is excellent at within-repo retrieval and good at cross-repo, but the “decision” itself may live in a governance document or an ADR collection, not in a code file. The decision is invisible to the retrieval pass. Mneme’s typed corpus is the authoritative decision store and is consulted on every relevant edit.
Why retrieval and governance are different primitives
Retrieval is about what the code is. It improves the inputs to generation. Governance is about what the edit is allowed to do. It constrains the outputs of generation. Both are essential to enterprise AI coding, and they cannot be collapsed into each other without losing one of the two guarantees.
An enterprise stack that uses Cody for retrieval and Mneme for enforcement gets both: the agent generates with grounded context, and every edit it emits is evaluated against typed architectural decisions before it lands. The result is a higher-quality first-draft from the agent and a deterministic boundary around what makes it into the codebase.
This is not a replacement story for Cody. It is a layering story: Cody is the right tool for retrieval; Mneme is the right tool for enforcement; the two together deliver what enterprise AI coding governance actually requires.
Using Cody and Mneme together
The enterprise pattern is straightforward. Cody handles retrieval; Mneme handles enforcement; the coding agent of the team’s choice does the generation.
- Keep Cody for grounded retrieval. Code graph, cross-repo context, enterprise SSO and access controls. Cody is the right tool for retrieval at scale.
- Encode architectural decisions in Mneme. Layering rules, dependency policies, scope-bound conventions, supersession history. The decisions that must hold regardless of what retrieval surfaced.
- Use Cody to make generation better. Better context produces better first-drafts. Lower review load, fewer trivial mistakes.
- Use Mneme to make enforcement deterministic. When an edit is proposed, Mneme matches the scope, evaluates relevant decisions, and either lets the edit through or blocks with the specific decision that fired.
- Audit both layers. Cody’s retrieval log shows what context was provided; Mneme’s enforcement log shows which decisions fired on which edits. Two independent audit trails covering the two halves of the problem.
In this architecture, Cody is the memory of what the code is. Mneme is the memory of what has been decided. Enterprise AI coding governance requires both, at different layers, with independent audit. The dual-stack pattern is not a fallback — it is the right shape of the enterprise solution.