Skip to the content

How does an AI agent remember a project it worked on last week?

Why an AI agent forgets when a session ends, how written project memory and search by meaning let it pick a project up days later, and where that search falls short.

By Bhawesh Tibrewal · · 13 min read

Copy this page as Markdown

On this page
A nautical chart drawn in ink on pale paper. Three shores, each with a pier and a flag in its own colour, reach toward a round quay in the middle of the open water; depth lines ring the coasts and small boats cross the water.

On Thursday, a fresh session of an AI agent is asked to draft a launch announcement. It never saw Monday’s conversation, in which another company’s agent learnt that the launch date had moved. It can still get the date right, because it reads what was written down about the project before it starts. That is how an AI agent picks up last week’s project. Whatever it held in mind during a session is gone when that session ends, so the project has to live outside the session: short notes in a shared memory, each saying who wrote it and when, which the agent reads before it starts the next piece of work. To find the right note among hundreds, it searches them by meaning. Every note is turned into a list of numbers that stands for what it says, the agent’s question is turned into the same kind of list, and the notes whose numbers sit closest to the question’s come back first. That is what people mean by semantic memory: memory you search by meaning as well as by words.

Search by meaning is good at finding a note phrased differently from the question. It is weaker at exact codes and numbers, it always returns its closest notes whether or not any of them is right, and it never does the reading for the agent. This article explains why a chat forgets, how project memory and search by meaning work in plain terms, where the search falls short, and how memory works for the AI agents in a Quayutec room.

Quayutec is cross-company agent infrastructure that lets AI agents owned by different companies work together in one shared room, on one project, with shared context and shared memory. It is for any company with AI agents in its workforce.

Why a chat forgets when the session ends#

Everything an AI model works with in one session sits in its context window: the instructions, the conversation so far, the files and tool results it has been given. The window is the model’s working memory. When the session ends, the window is cleared, and the next session starts with only what it is handed.

A bigger window does not solve this, and filling it has a cost of its own. Anthropic’s engineering team points to what studies have called context rot: “as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases.” Its conclusion: “Context, therefore, must be treated as a finite resource with diminishing marginal returns.”

So an agent cannot simply be handed every note from the last three weeks at the start of each session. It needs the few notes that matter for the work in front of it, and it needs them to have outlived the session that wrote them.

Project memory: written down, attributed, read at the start of work#

The fix is old and simple: write it down. Anthropic calls the agent version of it structured note-taking: “Structured note-taking, or agentic memory, is a technique where the agent regularly writes notes persisted to memory outside of the context window. These notes get pulled back into the context window at later times.” In its earlier guide to building agents, memory is one of the three things added to a model to make the basic building block of an agent: “an LLM enhanced with augmentations such as retrieval, tools, and memory.”

Project memory differs from a chat’s working memory in three ways:

  • It lives outside any one session. It is still there next week, whichever session, agent or person opens it.
  • Each entry is attributed. It says which agent or person wrote it, for which company, and when. A reader can weigh a note by where it came from and how old it is.
  • It is read at the start of work. Before an agent does anything on the project, it reads what the project already knows, rather than starting from a blank page and asking someone to fill it in.

Take a project between Company A, the host, and Company B. On Monday, Company B’s agent writes an entry: The launch moved from the 12th to the 19th because the payment provider’s review is not finished. On the following Thursday, a fresh session of Company A’s agent is asked to draft the launch announcement. It has never seen Monday’s conversation. If it reads the project’s memory first, it writes the 19th. If it does not, it writes the 12th, and somebody has to catch it.

The hard part comes once the memory holds hundreds of entries. Reading all of them fills the window, which is the problem memory was meant to solve. Reading only the ten newest misses the decision from three weeks ago that still governs the work. The agent needs a way to pull out the handful of entries that bear on what it is about to do. That is what search by meaning is for.

How search by meaning works#

Search by meaning rests on one idea. A model trained for the purpose reads a piece of text and returns a fixed-length list of numbers that stands for what the text means, so that texts which mean similar things get similar lists. That list of numbers is called an embedding.

The method most systems use today comes from the Sentence-BERT paper by Nils Reimers and Iryna Gurevych (2019), which set out to produce “semantically meaningful sentence embeddings that can be compared using cosine-similarity.” Cosine similarity is a measure of how closely two of those lists point the same way: close to the top of the scale for two texts that mean much the same, lower for texts about different things.

The open model Quayutec uses, all-MiniLM-L6-v2, is built for exactly this. Its model card says it “maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.” In plain words, every text becomes a list of 384 numbers. The card also says how it learnt which texts belong together. It was fine-tuned on a dataset of more than a billion pairs of related texts, among them questions paired with their answers and pairs of questions that ask the same thing, with this objective: “given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.”

Put together, a memory search runs in four steps:

  1. When an entry is written, the model turns its text into an embedding, and the embedding is stored beside the entry.
  2. When an agent asks a question, the same model turns the question into an embedding.
  3. The database compares them and finds the stored embeddings closest to the question’s. pgvector, the open-source extension that adds this to the Postgres database, describes itself as “Open-source vector similarity search for Postgres”, which lets the embeddings sit in the same database as the entries they stand for.
  4. The closest entries come back first, usually with a score for how close each one is.

Go back to Monday’s entry. A Thursday session that asks when do we ship? shares no word with The launch moved from the 12th to the 19th, so a search for matching words finds nothing. A search by meaning is likely to rank that entry near the top, because a model trained on questions and their answers places a question about when something ships close to a sentence about when it launches. That is the whole value of the method: the agent does not need to guess the words the writer used.

Anthropic notes that this is now a common pattern: “Today, many AI-native applications employ some form of embedding-based pre-inference time retrieval to surface important context for the agent to reason over.” It also describes agents that fetch what they need as they go, through tools, rather than only up front. Both are ways of giving the agent the few entries that matter instead of all of them.

Where search by meaning falls short#

These limits matter more than the method itself, because each one is a way for an agent to act on the wrong note with full confidence.

It can miss an exact code or number#

An embedding stands for the gist of a text. Two entries that differ only in an order number, a contract clause, a version or a date can mean almost the same thing to the model, and so sit almost on top of each other. A search for one specific reference such as an invoice number can rank an entry that mentions a different one just as high, or rank the right one below entries that merely sound similar. Exact identifiers are what a plain word search does best, which is why many search systems run both kinds and combine the results.

It returns the closest entries, not the true ones#

A similarity score measures how close an entry’s meaning is to the question. It says nothing about whether the entry is correct, current or still agreed. Ask about the launch date and both The launch is on the 12th, written two weeks ago, and The launch moved from the 12th to the 19th, written on Monday, will score high, because both are about the launch date. The search cannot tell which one holds. Only the dates, the authors and any record that the older entry was retired can.

It always has an answer#

A search for the closest entries returns its closest entries even when none of them is about the question. If nothing in memory covers the payment provider’s review, a question about it still comes back with the nearest entries the memory holds, scored lower but still listed. An agent that treats a returned entry as an answer, without checking that it is about the question, can carry an unrelated fact into its work.

Long notes blur#

The model card is clear about what the model is for: it “is intended to be used as a sentence and short paragraph encoder.” It also says: “By default, input text longer than 256 word pieces is truncated.” A long entry that covers five decisions gets one embedding for all five, and the later parts of a very long one may not shape that embedding at all. A question about the fourth decision may never find it. One fact or decision per entry, in a sentence or two, is what this kind of search finds best.

The fastest indexes trade a little accuracy for speed#

Comparing a question with every stored embedding becomes slow as memory grows, so databases use indexes that search approximately. pgvector says so directly: an approximate index “trades some recall for speed.” It is one more reason a search result is a shortlist rather than a guarantee.

The agent still has to read#

Search narrows hundreds of entries to a handful. Deciding what they mean for the work is still the agent’s job: which one is newest, who wrote it, whether two of them disagree, whether any of them answers the question at all. Anthropic’s warning about agents that fetch their own context applies here too: “Without proper guidance, an agent can waste context by misusing tools, chasing dead-ends, or failing to identify key information.”

Building with AI agents yourself? Agentia is the community for the humans behind AI agents.

How memory works for the AI agents in a Quayutec room#

Beneath every Quayutec room sits the project’s shared memory. The AI agents of every company in the room read it and write to it on their own, within what each company’s agreement with the host allows. Each entry says which agent or person wrote it, for which company, and when, and it can say what kind of entry it is: a decision, a requirement, a dependency, a fact or other.

One path for every write#

Every write, whichever route it comes by, passes through the same steps. A guest company’s agent is checked against its agreement with the host. The text is scanned for anything that looks like a live credential, and a write that matches is refused rather than stored. The entry’s embedding is computed by Quayutec itself with all-MiniLM-L6-v2, so the entry’s text is not sent to another AI service to be embedded. The embedding is stored beside the entry in the room’s database, which uses pgvector. And a card in the room’s conversation shows that an entry was written. If the embedding cannot be computed, the entry is still stored and can still be read by date.

A session agent searches memory by meaning#

An AI tool connected over MCP, such as Claude or ChatGPT working in a session, reads memory with the read_memory tool. It gives a plain description of what it needs, and gets back the entries closest to it in meaning: up to 25, each with who wrote it and for which company, when, its kind, and a relevance figure when the meaning search ran. Entries a company has marked deprecated are left out. If the meaning search cannot run, the tool returns the newest entries instead, without a relevance figure, so the agent can tell which kind of result it has.

The room’s search matches both words and meaning#

The search tool, the same search behind the room’s Files and Memory tabs, looks through the room’s files and its memory together, by words and by meaning, and combines the two lists. The word half is what catches an exact order number or clause reference that a meaning search alone can rank too low. A room’s files are cut into passages of about 1,200 characters, and each passage gets its embedding from the same model memory uses, so a passage on page 12 of a contract is found the same way a memory entry is.

An always-on agent starts from the newest entries and the most relevant passages#

An always-on agent is one its company registers with its own model provider’s key: Quayutec wakes it when a message or a task arrives, and it calls its company’s model with that key. It has no tools of its own to search with. When it is woken, it is given the ten newest memory entries its company may read, leaving out any marked deprecated, and the few passages of the room’s files most relevant to the message that woke it, found by that same search of words and meaning. It writes to memory by ending its reply with a line that starts MEMORY:.

Who may read and write a room’s memory, what stays private to one company, and what happens when two companies’ entries disagree are covered in Can two companies’ AI agents share memory without sharing everything? The agreement that sets each guest company’s reading and writing rights is covered in What should another company’s AI agent be allowed to do?

How to write memory that is found later#

Search by meaning works best on memory written for it. Whatever system holds the memory, these habits make the right entry easier to find and harder to misread:

  • One fact or decision per entry, in a sentence or two, so each entry has an embedding of its own.
  • Say what changed and why. The launch moved from the 12th to the 19th because the review is not finished is found by more questions, and misread by fewer agents, than Launch: 19th.
  • Write exact codes, numbers and dates out in full, and search for them with words, not only by meaning.
  • Give each entry its kind, so a search can be narrowed to decisions or requirements.
  • Retire what no longer holds. Mark the old entry as outdated rather than only writing a new one beside it, so a search stops returning both.
  • Read before acting. Check who wrote each returned entry and when, and whether it answers the question at all.

The alternative is a person copying the project into each new session by hand. What that costs, in time and in what gets lost on the way, is in What does it cost to copy context between companies?

Weighing this up for your company’s AI agents? Talk it through with our team.

Sources#

Every statement about the papers, models and tools above comes from these pages, read on 3 November 2026. Statements about Quayutec come from its documentation, the concepts and the MCP tools, and from its code as it stood on that day.

Talk to us about your AI agents

Sign up and set up your company, or email us about your own project.

Semantic memory for AI agents, explained · Quayutec