Moresq Corpus

AI coding context loss

Your coding agent should not rediscover the same project every morning

Context loss is not only a model problem. It is a memory design problem: the agent can read today's files, but it does not automatically retain why the team chose them, what failed last week or which implementation already passed review.

Implementation knowledge preserved in a governed archive outside a temporary coding-agent session.
Durable memory keeps reviewed implementation knowledge available without forcing the whole history into every prompt. Open image.

The expensive loop behind “please remember this”

Every new session begins with a familiar cycle: the agent scans the repository, asks for conventions, reconstructs architecture and proposes a pattern the team may already have rejected. The output can look competent while quietly reintroducing an old decision or bug.

The cost is not only tokens. It is review time, inconsistent code, repeated explanations and the loss of confidence that makes developers add more and more instructions to a file the agent cannot reliably prioritize.

A better loop: retrieve before you generate

  1. Search for the implementation problem, not only the filename.
  2. Preview compact matches with source, review state and constraints.
  3. Retrieve the full card only when the match is relevant.
  4. Adapt names, paths and interfaces to the current repository.
  5. Record the apply, correction or miss so the next search improves.

Project memory

Architecture, boundaries, conventions and stable decisions.

Decision memory

Why a library, schema or pattern was accepted or rejected.

Implementation memory

Reviewed auth, API, webhook, persistence and deployment patterns.

Proof memory

Source, license, quality, revocation and application history.

Why a larger instruction file is not the answer

Rules files are useful for a small set of always-on constraints. They are a poor place to store every snippet, failed experiment, incident and historical decision. That information should remain available without consuming the agent's entire context window on every task.

Moresq Corpus makes that distinction explicit: stable rules stay close to the repository, while detailed implementation cards are searched when the task needs them. Retrieval is therefore part of the workflow, not a document dump attached to every prompt.

Make memory useful

Search the pattern before asking the agent to invent it

Start with repo memory, verified snippets and proof receipts. Generate only the adaptation that is genuinely new.

Explore agent repo memory

FAQ

Why does my AI coding assistant forget context?

A coding assistant usually sees a limited working context, not a durable record of the repository decisions, failed approaches and reviewed patterns that shaped the project.

Is AGENTS.md enough to solve context loss?

It helps with stable rules, but a single instruction file is not a complete memory system. Decisions, snippets, session outcomes and source evidence need to be searchable on demand.

What should an AI coding agent remember?

It should remember architecture constraints, approved patterns, rejected approaches, important incidents, source provenance and the conditions under which a snippet can be reused.

How does Moresq Corpus help?

Moresq Corpus lets agents search compact implementation cards before generating, retrieve the relevant proof and apply only the project-specific adaptation.