How to Build Agent Memory for Collaborative Teams
Everyone building agent memory treats it as an algorithm problem. Teams spend months tuning vector rankings, knowledge graphs, and background summarizers to guess what a model ought to remember on the next turn.
They have it backwards. Modern agents are already smart. Hand a good model the right record and it knows what to do with it. What breaks in practice is storage and lifecycle: deciding which traces are worth keeping, separating records that decay at different speeds, and running a periodic cleanup pass so memory stays lean over months of daily work.
Most setups dull a good model in one of two ways. Some keep a single 200k-token session open for days so the agent "never forgets." By the second afternoon, 140,000 tokens of old stack traces and settled debates sit above the current diff, and the model starts missing bugs it would catch in a fresh chat. Others bolt on an automatic retrieval pipeline that pushes guessed snippets into every prompt. Whenever those guesses are slightly off, the agent wastes turns chasing problems from last week.
A smart agent stays sharp when it wakes up with a clean window, runs regular cleanup passes like human sleep, and can trace any question back to the original record on its own.

Why solo memory breaks when teammates share agents
When one developer works with a single coding agent, memory feels easy. You only need tomorrow's session to pick up where today left off.
Even inside a single bot's workspace, cramming everything into one MEMORY.md breaks once a project runs for more than a week. Long-term rules, hourly task status, raw daily logs, and step-by-step procedures all age at completely different speeds. Put them in one file and task status goes stale before lunch, old notes bloat the startup prompt until the model ignores your real rules, and nobody dares delete a line because it might be the only copy of a past decision.
Add a teammate and two more bots to the same repo, and solo habits fall apart completely. Your teammate's bot can't read the notes sitting on your laptop. Dumping every scratchpad into group chat buries real decisions under noise. And if you spin up a separate team wiki, nobody updates it once a week gets busy.
Even ordinary chat breaks down with bots unless you handle one concurrency problem. Suppose you change direction in a channel while a bot is mid-run on the old plan. If the bot posts its reply without checking for new messages first, it drops stale work straight on top of your new decision.
We run our own bots inside Alook every day, so we've lived through every one of those failures firsthand. What holds up over months of team work is splitting storage by decay rate and visibility into five narrow layers, then pairing them with one periodic reset pass.
Five storage layers and one reset pass
Each piece in Alook exists because collapsing it into another layer breaks something concrete.
Channel and thread history is the shared ground truth. Decisions, approvals, corrections, and handoffs stay in the topic channels and threads where humans and bots already work, leaving one timestamped thread per topic. Before any bot posts, Alook runs an optimistic read-waterline check on sequence numbers for that specific channel or thread and blocks the reply until the bot reads new messages. Scoping that check to each thread keeps active work isolated from unrelated chatter while stopping a mid-run agent from answering yesterday's plan.
Shared task marks hold live work state. Hourly status like "who is fixing bug #412," current blockers, and the next step changes too fast for long-term notes, yet gets buried ten screens up in chat scrollback. In Alook, a bot pins a status mark and short note onto the message that kicked off the task, updating it as work moves and clearing it when done. Marks are visible coordination pointers rather than hard file locks: any bot with access to that channel can pull the list of open marks directly without scrolling back, so your teammate's bot checks what's already claimed before starting duplicate work.
Context timeline (.context_timeline/YYYY-MM-DD.jsonl) is each bot's private daily footprint on disk. The local connector records it automatically as JSONL files that are read-only to the agent: which messages the bot actually saw, its recent replies, session boundaries, and reset markers. It never gets stuffed into the startup prompt. While channel history holds everything across the whole workspace, the timeline records this bot's lived trail across channels and DMs so it can trace back where it was on any given day.
memory.md and experiences/ are the bot's distilled local memory on its owner's computer. memory.md is a tiny startup index, usually twenty or thirty lines: repo paths, ownership, deploy rules, links back to the threads where decisions happened, and pointers into experiences/. Longer step-by-step playbooks and edge cases live in experiences/ and open only when a matching task comes up. Keeping both as plain Markdown files on disk means teammates' bots can collaborate in the same channels without ever getting access to your local notes or files.
Commit log (.commits.jsonl) is the changelog of the bot's memory reviews, written through alook commit. Each entry reads like a short, first-person Git commit message: what window of work the bot just reviewed, what core rules changed in memory.md or experiences/ and why, and any review checkpoint left open. The file caps its size automatically by rolling off the oldest entries. Running commit records the review entry and triggers a clean session reset in one step.
Auto-reset is the periodic consolidation pass that ties those five layers together. During idle stretches, or when you ask at a clean stopping point, the connector triggers a quiet maintenance pass before clearing the window.
How the pieces lock together
On paper, five storage layers and a reset pass can sound like extra moving parts. Once you live inside a bot's workflow for a few weeks, you see why removing any single piece breaks the loop. Look at what happens across three everyday moments: periodic cleanup, waking up fresh, and finding an unindexed past decision.
1. Auto-reset works like sleep and dreaming
Most agent memory files grow into unreadable junk drawers for one simple reason: agents only ever append to them. Every correction adds another line, nobody deletes stale rules, and after three hundred corrections the model starts drowning in its own notes.
Alook's periodic auto-reset solves that by forcing scheduled subtraction, much like how human sleep consolidates daytime experience. And it cannot just trust what is still sitting in the bot's live context window: long-running sessions get auto-compacted by Claude Code or Codex, interrupted by daemon restarts, or stretched across days of idle time. So the maintenance pass anchors itself on disk and in channel history instead of lossy session RAM.
It starts by reading the latest entry in .commits.jsonl as its review cursor, so it doesn't waste tokens re-auditing last month's work. From that point forward, it scans .context_timeline/ to find which channels and threads the bot actually participated in since the last review. Rather than trusting those compact footprints on their own, it pulls the full channel and thread history for each recent discussion, reading from the initial ask through every user correction to the final decision. That lets the bot verify facts against the latest outcome, understand why a human changed direction, and catch rules in memory.md that were wrong from the start or drifted over time.
With ground truth in hand, the bot cleans up memory.md and experiences/: merging repeated lessons, deleting superseded or wrong lines, stripping out any temporary task status that crept in, and pushing multi-step procedures down into experiences/. It can cut hard without fear only because channel history holds the untouched source of truth and memory.md stores short pointers back to those threads, so deleting an outdated line never destroys the underlying decision. Before finishing, the bot checks its open shared task marks to see what work is still pending and whether any blocked item needs a brief follow-up, then runs alook commit to record what changed in .commits.jsonl and reset the session window.
This works nothing like a background summarizer. A background summarizer tries to compress messy raw transcripts into permanent memory, so every compression error quietly corrupts truth. Here, .commits.jsonl is just a changelog and cursor for the next pass, memory.md stays compact enough for the owner to scan and fix in ten seconds, and the real record remains untouched in channel threads and open marks. And if a coding mistake keeps repeating even after you note it in memory.md, prose notes are the wrong storage layer altogether: move that rule into repository lint checks or automated review, like our Architect review workflow and Vibe Coding technical debt loop, so the bot doesn't have to rely on memory at all.
2. Waking up clean without losing the thread
You don't reread six months of Slack before morning standup. You show up with a clear head, a shortlist of open work, and the ability to open an old thread the second a question touches it.
When a new message wakes a freshly reset bot, it follows that exact rhythm. Its clean context window loads only four small inputs: the latest entries in .commits.jsonl, memory.md, unread inbox messages, and open marks if tasks are pending. Loading the last few commit entries alongside memory.md isn't redundant: memory.md gives the current snapshot, while .commits.jsonl works like running git log -n 3 next to an index, giving immediate continuity on what just changed, why it changed, and whether any review checkpoint is still open.
There are no 140,000-token leftovers from yesterday's failing test runs, and no vector retriever guessing which paragraph to inject. Even when a task spans three days across two resets and a laptop reboot, the bot wakes up knowing its open PR, its current blocker, and the rules that changed yesterday, while reasoning with the full sharpness of a fresh session.
3. Finding something that was never indexed
Every storage system hits the same real-world test: what happens when someone asks about a detail that nobody ever wrote into memory.md?
Take a real moment from our own workspace. Someone asks a bot in a DM: "Find that Anthropic memory article I sent you a few weeks ago." A one-off link from three weeks back does not belong in a short startup index, and the bot's session has reset a dozen times since then. Loading thousands of messages from DM history would wreck its clean window.
Because the connector kept .context_timeline/ on disk, the bot doesn't guess or scroll blindly. It greps its local daily timeline files for the keyword, lands on the exact date and message sequence in under a second, and pulls the surrounding channel history to recover the full context.
And what if the decision happened four months ago in a channel this bot never participated in at all? Then no local timeline has it, so a teammate drops the link to that thread, the same way you'd point a coworker to an old discussion. If it will matter again, the bot adds one pointer line to memory.md so nobody hunts for it twice.
There is a real limit here: .context_timeline/ is a bounded local footprint, not a lossless archive. The connector compacts a day's file once it grows large, rolling off the oldest rows while keeping newer entries and reset markers, and it does not record full tool calls. Whenever exact wording or final approval matters, the channel thread and repository artifacts remain the authoritative record.
Separate team memory from fast-churning coding tools
Chat workspaces change once a decade. Coding models and agent tools churn every few months.
When your team's notes and decisions sit inside one coding tool's private session history, moving from Claude Code to Codex, or switching to a stronger model next quarter, forces you to rebuild your setup from scratch.
Keeping shared truth in channels, live work in marks, and each bot's trail, commit log, memory.md, and experiences/ in plain files on disk decouples team memory from whichever coding agent runs behind the bot. You're still picking a chat workspace, like Slack or Discord, which is a decade-scale choice. Swap the agent behind a bot from Claude Code to Codex, and it wakes up in the same channels with the same open marks and local files, with no database migration and no re-explaining how your team works.
Further reading: If you're solving a single-tool memory problem first, see Share a Claude Code Session With a Teammate, How to Keep Context Across Multiple Coding Agent Sessions, Multi-Agent Memory: How to Share Context Between Agents, Claude Code Memory, or Codex Memory After Compaction. To run your team's agents in shared channels with local workspaces, download Alook.