How to give AI agents persistent memory across tasks

The knowledge layer architecture that stores agent learnings, context, and preferences in a structured database so every agent remembers past interactions and gets smarter with every task.

Every time your agent starts a new session, it forgets everything. Your brand voice. Your customer preferences. The decision you made last Tuesday. You re-explain the same context every single time. The knowledge layer fixes this permanently.

Claude has no memory between sessions. Every conversation starts from zero. Your customer support agent does not remember that Client X prefers formal communication. Your content agent does not remember that you banned certain phrases last week. Your sales agent does not remember the objection handling approach that worked yesterday.

You compensate by pasting context at the start of every session. A system prompt that grows longer every week. A context document you manually update. This approach does not scale past 5 agents because you become the memory manager for your entire AI workforce.

$40/mo

system cost

$4,000/mo

manual cost replaced

99.0%

cost reduction

The stack

The knowledge layer is a structured database that sits between your agents and their tasks, providing persistent context that survives across sessions.

The architecture has 3 tiers. Tier 1 (Global Knowledge): Facts that apply to every agent. Your brand voice guidelines, company policies, customer segments, and product details. Stored once, referenced by all agents.

Tier 2 (Role Knowledge): Facts specific to an agent's function. The content agent stores editorial standards, banned phrases, and content performance data. The sales agent stores objection handling scripts, pricing rules, and deal history. Each agent has its own role-specific knowledge base.

Tier 3 (Session Knowledge): Context from individual interactions that should persist. When a customer says they prefer email over phone, that preference is stored in their profile and injected into every future interaction with any agent. The knowledge layer automatically selects the relevant context for each task and injects it into the agent's prompt before execution.

Supabase
SupabaseThe knowledge store

Houses all three tiers of knowledge in structured tables with vector search for semantic retrieval. Each knowledge entry has metadata: source, confidence level, last verified date, and applicable agents.

Claude
ClaudeThe knowledge consumer

Receives pre-loaded context from the knowledge layer before every task. Also contributes back: when it learns something new during a task (customer preference, edge case, correction), it writes the learning back to the knowledge store.

Ultron
UltronThe knowledge router

Determines which knowledge entries are relevant for each task and injects them into the agent's context window. Manages the knowledge lifecycle: creation, validation, deprecation, and cleanup of outdated entries.

ultron.sh/agents

What it replaces

2 line items, starting with the context preparation time, priced against the tools that now do the work. The last bar is the whole system at $40/mo.

$2,500/mo

Context preparation time, now Automated knowledge injection

$1,500/mo

Training new agents, now Shared knowledge layer

$40/mo

The whole system

Monthly cost of each role the system replaces, against the system itself.

Why it holds

Everyone can buy Supabase. What separates the setups that last from the ones that collapse is one idea.

The knowledge layer creates a compound effect that accelerates over time. On day 1, your agents have minimal context and perform at baseline. By day 30, they have accumulated hundreds of knowledge entries from real interactions. By day 90, they know your business better than a new employee would after 6 months of onboarding. The longer the system runs, the smarter every agent becomes, without any additional training or manual context updates.

What is inside

This is not theory. 3 pieces, ready to run.

In this playbook

2 of 3
3-tier knowledge schema
Knowledge injection pipeline
Seed your global knowledge base
Unlock

How it's built

The file tree, so you know exactly what you would be standing up.

System files
knowledge/
global_store.jsonrole_stores.tssession_store.jsvector_index.ts
lifecycle/
knowledge_writer.jsdeprecation_checker.tsrelevance_scorer.js

One rule to leave with, the one that stops the context preparation time from creeping back into the budget.

Stop re-explaining your business to AI every session. Build a memory layer once and let every agent benefit from every interaction.

The numbers above trace back to the Agent Memory Systems Research, not projections.

Agent Memory Systems Research

You can wire Supabase and the rest of this stack by hand from the playbook above. Or you skip the assembly, because standing up systems like this is exactly what Ultron does.

$4,000

is what this system replaces every month. Ultron runs it for $40/mo.

No card required. Set it up in about ten minutes.

Keep reading