Every AI memory knows where it came from.
Lineleaf is the lineage and invalidation layer for AI memory. Trace what every memory, summary, embedding, and cached answer came from—then safely update or delete every derived copy.
For teams building agents, assistants, and AI products with persistent memory.
Select any artifact, then trace its origin or preview a change to the source.
- extract
- embed
- cache
- summarize
- retrieve
- generate
Text description of this graph
- “I live in Vancouver.” (turn_331) → extract → Location = Vancouver (mem_7f2a)
- Location = Vancouver (mem_7f2a) → embed → Vector embedding (emb_3310)
- Location = Vancouver (mem_7f2a) → summarize → Profile summary (sum_0912)
- Diet = vegetarian (mem_51d0) → summarize → Profile summary (sum_0912)
- Vector embedding (emb_3310) → cache → Cached store pick: Kitsilano (ans_88)
- Profile summary (sum_0912) → retrieve → Travel plan: depart YVR (plan_17)
- Travel plan: depart YVR (plan_17) → generate → Hotel search near Vancouver (out_204)
One fact becomes many copies.
An AI app turns a single message into a memory, a profile fact, a summary, an embedding, a cached answer, and an agent’s next plan. Delete the message and the copies stay behind — still retrievable, still shaping answers.
chat:turn_331
“I live in Vancouver.”
Long-term memory
memory store
Profile fact
user profile
Summary
summary table
Vector embedding
vector database
Cached answer
cache
Search entry
search index
Agent plan
agent state
Another agent’s output
downstream agent
Without Lineleaf
- Original source removed
- Derived copies remain
- Old fact continues appearing
- No proof of cleanup
With Lineleaf
- Source event recorded
- Descendants discovered
- Cleanup previewed
- Every adapter updated
- Receipt returned
See the blast radius before you touch anything.
Pick a source and run a dry run. Lineleaf walks every descendant across every store, proposes an action for each, and executes nothing until you say so.
Exploring downstream lineage of gmail:msg_8812. Choose a source and run a dry run to see its blast radius.
One lineage graph. Three critical jobs.
reason="user_erasure"
Erase completely
Find every derived copy of a user’s data and coordinate deletion across memory stores, vector databases, caches, and agents.
reason="source_changed"
Keep facts current
When a source changes, mark downstream artifacts as stale and rebuild only what is affected.
reason="poisoned"
Roll back bad information
See how poisoned or incorrect information spread, then invalidate its descendants without deleting unrelated knowledge.
Ask why the AI believes it.
Lineleaf turns “Why did the agent say that?” into a traceable path instead of a debugging investigation.
Every step back to the source shows the operation, model, time, attribution, and current freshness — plus who else depends on it.
ll.why("redis", "ans_88")
freshness HealthyAll parents current. Last verified 2026-03-02 08:12 UTC.
Cache · redis:ans_88
Answer: flight leaves 09:40
2026-03-02 08:12 UTC · sha256:05ab…d3
- retrieve · retriever · top-k 8 · attribution 0.91 · 2026-03-02 08:12
Embedding · pgvector:emb_5521
Embedding of mem_19c4
2026-03-01 18:04 UTC · sha256:8e44…10
- embed · embedder-small · attribution 1.00 · 2026-03-01 18:04
Memory · mem0:mem_19c4
Trip to Lisbon, 14–21 March
2026-03-01 18:04 UTC · sha256:5b7d…22
- extract · extractor-v3 · attribution 0.94 · 2026-03-01 18:04origin
Source · gmail:msg_8812
Booking confirmation · YVR → LIS
2026-03-01 18:02 UTC · sha256:3d0e…9a
Downstream consumers · 2
langgraph:plan_17 · calendar-agent:out_204
A small layer beside your AI stack.
Your application keeps its stores, models, and frameworks. Lineleaf records how artifacts relate and coordinates what happens when a source changes.
The app keeps writing to its own stores. The SDK or middleware reports each derivation to Lineleaf as it happens.
01
Sources
- Chats
- Emails
- Files
- Databases
- Tool output
02
AI application
- Agent
- Memory extraction
- Summarization
- Retrieval
- Caching
03
Lineleaf
- SDK
- Middleware
- Lineage API
- Invalidation planner
- Adapter coordinator
- Receipt generator
04
Stores
- Memory store
- Vector database
- Cache
- Search index
- Agent state
Lineleaf tracks relationships, IDs, and fingerprints—not another copy of the underlying content.
Three operations at the center.
Record lineage as you write. Ask what a change would touch. Ask why something is believed. Everything else builds on these.
- ll.derive()
- Record that an artifact was produced from one or more parents.
- ll.invalidate()
- Find everything downstream of a changed, deleted, stale, or poisoned source — as a plan first.
- ll.why()
- Trace an artifact back through its parents to explain why the AI believes it.
lineage.py
from lineleaf import Lineleaf ll = Lineleaf(api_key=KEY) ll.derive( output=("mem0", mem_id), inputs=[ ("gmail", "msg_8812"), ("chat", "turn_331"), ], op="extract", ttl="180d",) plan = ll.invalidate( ("gmail", "msg_8812"), reason="user_erasure",) plan.affectedplan.execute() ll.why(("mem0", mem_id))lineage.ts
import { Lineleaf } from "lineleaf"; const ll = new Lineleaf({ apiKey: process.env.LINELEAF_KEY }); await ll.derive({ output: { store: "mem0", id: memId }, inputs: [ { store: "gmail", id: "msg_8812" }, { store: "chat", id: "turn_331" }, ], op: "extract", ttl: "180d",}); const plan = await ll.invalidate( { store: "gmail", id: "msg_8812" }, { reason: "user_erasure" },); plan.affected; // Artifact[] — nothing is touched yetawait plan.execute(); await ll.why({ store: "mem0", id: memId });› plan.affected8 artifacts · 7 stores · nothing executed
- mem0:mem_19c4delete
- pgvector:emb_5521delete
- search:idx_ab12manual_review
- postgres:usr_42rebuild
- postgres:sum_0912rebuild
- redis:ans_88delete
- langgraph:plan_17mark_stale
- calendar-agent:out_204mark_stale
Illustrative output from the demo graph above.
Designed not to become another copy of your data.
A lineage system that hoarded content would make the problem worse. These are design commitments for the first release, not certifications.
IDs and fingerprints instead of content
Lineleaf stores where an artifact lives and a hash of it — not the memory, message, or embedding.
Dry run before delete
Every invalidation is a plan first. You see each artifact and action before anything changes.
Explicit adapter actions
Each store gets a named action — delete, rebuild, mark stale — with a result per artifact.
Signed cleanup receipts
A hash-linked record of what was found, what was done, and what still needs review.
Traceable events
Every erase, update, stale, or poison event is recorded with its cause and scope.
Least-privilege integrations
Adapters ask only for the permissions their actions require, store by store.
No silent expansion of cleanup scope
If a plan grows beyond what was approved, execution stops and asks again.
Built to work across the memory stack.
Adapters are where lineage meets real stores. These are the first we intend to build; none are available yet.
- Mem0memory store adapterPlanned
- pgvectorvector adapterPlanned
- Rediscache adapterPlanned
- LangGraph Storeagent state adapterPlanned
- Custom adaptersfour verbs, any storeAdapter interface
Product names are trademarks of their owners. Listing them does not imply a partnership or endorsement.
An open foundation for trustworthy AI memory.
The initial SDK and lineage layer are planned as an Apache-2.0 open-source project. A managed cloud product can later add hosted graphs, audit exports, team access, and signed organizational receipts.
github.com/lineleaf-ai
- Python SDKplanned
- TypeScript SDKplanned
- Postgres lineage graphin development
- Adapters: Mem0, pgvector, Redis, LangGraphplanned
- Blast-radius viewerplanned
- LicenseApache-2.0 (planned)
Building AI memory? Help shape what comes next.
Lineleaf is looking for teams that operate assistants, agents, or AI applications with persistent memory. Design partners will help define the first adapters, invalidation workflows, and audit experience.
What we’d ask
- A conversation about your memory stack
- Honest feedback on the proposed API
- Optionally, a test environment to pilot against
What you’d get
- Direct input on adapters and workflows
- Early access as pieces become usable
- A map of where your derived copies live