conversation-memory
Skill0 starsChanged 6 months agoMITView on GitHub
Adds persistent multi-turn conversation history to agents using InMemoryConversationStore and ShortTermMemory sliding window. Use when an agent must remember prior turns within or across sessions, implementing sliding-window trimming to fit token budgets, or storing conversation history keyed by session/user ID.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- Fandry96/k3-agentic-skillstheir own version, first seen May 12, 2026
- ai4brands-design/claude-skillstheir own version, first seen Mar 22, 2026
- ofershap/conversation-memorytheir own version, first seen Feb 21, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- Fandry96/k3-agentic-skills★ 27same name
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- ofershap/conversation-memory★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/building-agents/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- adding-guardrailsSkill
- agent-health-timeoutSkill
- agent-permission-scopingSkill
- agent-session-isolationSkill
- agent-step-loggingSkill
- agent-supervisor-routerSkill
- agent-telemetrySkill
- async-agent-backgroundSkill
- building-agentsSkill
- building-teamsSkill
- building-toolsSkill
- calendar-scheduling-toolSkill
- callback-tracing-handlerSkill
- chain-of-thought-promptingSkill
- chat-model-configurationSkill
- code-execution-sandboxSkill
- common-agent-patternsSkill
- context-window-managementSkill
- conversation-state-dbSkill
- database-query-toolSkill
- document-loadersSkill
- document-rerankingSkill
- email-notification-toolSkill
- embedding-model-ingestionSkill
- fallback-model-chainSkill
- few-shot-injectionSkill
- filesystem-toolSkill
- human-in-the-loopSkill
- hybrid-searchSkill
- inspecting-streamsSkill
- integrating-with-laurenSkill
- json-schema-enforcementSkill
- llm-provider-connectionSkill
- llm-rate-limitingSkill
- long-term-vector-memorySkill
- managing-memorySkill
- migrating-to-lauren-aiSkill
- multi-agent-delegationSkill
- multi-tool-orchestrationSkill
- multi-turn-tool-stateSkill
- output-guardrailsSkill
- plan-and-execute-agentSkill
- prompt-injection-defenseSkill
- prompt-versioningSkill
- rag-pipelineSkill
- react-agent-loopSkill
- response-validation-retrySkill
- rest-api-toolSkill
- securing-agentsSkill
- semantic-cacheSkill
- streaming-response-handlerSkill
- structured-output-parsingSkill
- sub-agent-spawningSkill
- system-prompt-templatingSkill
- testing-agentsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 111
Use AgentTestClient for integration testing.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use
codemap find "SymbolName"to locate any symbol before reading — it gives exact file + line range and is faster than grep across the whole repo.
Conversation Memory
Memory tiers at a glance
| Tier | Class | Scope | Notes |
| In-run buffer | ShortTermMemory | Single runner.run() call | Automatic, no config needed |
| Cross-run history | InMemoryConversationStore | Session (conversation_id) | Persists across calls |
Short-term memory (sliding window)
Pass memory=ShortTermMemory(max_tokens=N) to @agent() to share a buffer
across runs or shrink the rolling window. Without this, each run() starts
fresh.
from lauren_ai import agent
from lauren_ai._memory import ShortTermMemory
shared_mem = ShortTermMemory(max_tokens=8_000)
@agent(model="claude-opus-4-6", system="You are a helpful assistant.", memory=shared_mem)
class MemAgent: ...The runner trims the oldest non-system messages automatically when
token_estimate exceeds max_tokens.
Conversation store (cross-session history)
InMemoryConversationStore persists the full message exchange keyed by a
conversation_id string. Pass it to @agent(conversation_store=...) and
supply conversation_id on each runner.run() call.
from lauren_ai import agent
from lauren_ai._memory._stores import InMemoryConversationStore
STORE = InMemoryConversationStore()
@agent(
model="claude-opus-4-6",
system="You are a helpful assistant with memory of past turns.",
conversation_store=STORE,
)
class MemoryAgent: ...Running with a conversation ID
# Turn 1 — agent learns the user's name
resp1 = await runner.run(MemoryAgent(), "My name is Alice.", conversation_id="sess-1")
# Turn 2 — agent recalls the name from stored history
resp2 = await runner.run(MemoryAgent(), "What is my name?", conversation_id="sess-1")
# resp2.content → "Your name is Alice."Without conversation_id, the store is not consulted and history is not saved.
Per-request overrides
Pass memory= or conversation_store= directly to runner.run() to override
the agent-level configuration for a single run:
override_store = InMemoryConversationStore()
await runner.run(MemoryAgent(), "hi", conversation_id="s", conversation_store=override_store)Implementing a custom persistent store
Implement the ConversationStore protocol (two async methods):
from lauren_ai._memory import ConversationStore
class RedisConversationStore:
async def load(self, conversation_id: str) -> list:
raw = await redis.get(f"conv:{conversation_id}")
return json.loads(raw) if raw else []
async def save(self, conversation_id: str, messages: list) -> None:
await redis.set(f"conv:{conversation_id}", json.dumps(messages))
async def delete(self, conversation_id: str) -> None:
await redis.delete(f"conv:{conversation_id}")Testing
Use AgentTestClient for integration testing. Queue two responses and verify
the second call's messages include prior turns.
from lauren_ai.testing import AgentTestClient
from lauren_ai._transport._mock import MockTransport
mock = MockTransport()
mock.queue_response(completion("I'll remember that!"))
mock.queue_response(completion("Your name is Alice."))
store = InMemoryConversationStore()
@agent(model=None, conversation_store=store)
class MemAgent: ...
client = AgentTestClient(MemAgent(), mock)
await client.run_async("My name is Alice.", conversation_id="s")
await client.run_async("What is my name?", conversation_id="s")
history = await store.load("s")
assert len(history) == 4 # 2 user + 2 assistantReference
lauren_ai._memory:ShortTermMemory,ConversationStore,InMemoryConversationStorelauren_ai._memory._stores:InMemoryConversationStore- Skills:
managing-memory,long-term-vector-memory,conversation-state-db
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

