Lifecycle-managed memory for AI agents

Memory that evolves with your AI agents.

Structured memory that evolves, adapts, and stays useful across conversations.

npm install memo-grafter
  • TypeScript-first
  • Lifecycle-managed memory
  • Studio included
Animated graph showing a conversation becoming structured memory, an older budget being superseded, and relevant memories entering agent context.
Memory lifecycleSession 04
New message

“Actually, my budget is now ₹2 lakh.”

AGENT CONTEXT

Prefers quiet areas

Interested in Kyoto

Budget: ₹2 lakh

Prompt “Plan a calm 7-day Japan trip.”

How it works

From conversation to useful context

A focused pipeline turns raw dialogue into structured memory that can evolve without losing its history.

01

Conversation

I prefer quiet areas in Kyoto.

My budget is ₹1.5 lakh.

Actually, my budget is now ₹2 lakh.

02

Extract

Destination
Kyoto
Preference
Quiet areas
Budget
₹1.5 lakh

Processing updated budget…

03

Evolve

Incoming update

Actually, my budget is now ₹2 lakh.

Matches existing budget fact

Budget: ₹1.5 lakh

v1 · Superseded
+

Budget: ₹2 lakh

v2 · Active

The new message updates the existing budget memory while preserving the previous version.

04

Recall

Plan a quiet Kyoto trip within my current budget.

Selected agent context

Destination: Kyoto

Preference: Quiet areas

Budget: ₹2 lakh

Favourite language: TypeScript Excluded

The difference

Memory is not just stored. It changes.

Two updates enter the system. Only one approach knows which fact the agent should trust.

Conversation inputMy budget is ₹1.5 lakh.My budget is now ₹2 lakh.

Traditional memory

Chunk 01Budget ₹1.5 lakh
Chunk 02Budget ₹2 lakh
Two competing factsNo active version

MemoGrafter

v1 · SupersededBudget ₹1.5 lakh
v2 · ActiveBudget ₹2 lakh
Recall returns ₹2 lakhHistory remains inspectable

TypeScript first

Build memory into your agent in a few lines.

agent.ts
import { MemoGrafterAgent, OpenAIEmbedAdapter, OpenAILLMAdapter } from "memo-grafter";
// Set DATABASE_URL and OPENAI_API_KEY in your environment
const agent = new MemoGrafterAgent({
  db: { connectionString: process.env.DATABASE_URL! },
  llm: new OpenAILLMAdapter("gpt-4o"),
  embedder: new OpenAIEmbedAdapter("text-embedding-3-small"),
});
// Initialize the agent and its memory store
await agent.initialize();
// Add memory from a conversation
await agent.invoke("I prefer quiet areas in Kyoto. My budget is ₹2 lakh.");
// Search for relevant memories
const memory = await agent.recall("Japan travel preferences");
console.log(memory.facts);
  • TypeScript-first
  • OpenAI, Anthropic & Gemini
  • Graph-native memory
  • MemoGrafter Studio
View full example in the docs

MemoGrafter Studio

Inspect and operate on memory

Search topics, review facts, inspect lifecycle history, resolve conflicts, and preview exactly what reaches the model.

Trace each memory to its topic and source
Active recall stays clean while older versions remain available for review
Preview the exact token-budgeted context
StudioSession / japan-planning
Japan trip
Active

Memory detail

Budget increased to ₹2 lakh

Topic
Japan trip planning
Version
v2 · Updated
Prompt preview

User prefers quiet areas, is interested in Kyoto, and has a ₹2 lakh budget.

Start building

Give your agents memory they can trust.

Start with TypeScript, keep every update inspectable, and recall only the context your agent needs.

npm install memo-grafter