Skip to content

Lineleaf developer spec / 0.1

Interface preview · not publicly installable

Three operations. A small data model. Nothing hidden.

How Lineleaf captures lineage, plans and executes invalidations, and what adapters, receipts and webhooks look like. Published early so design partners can shape it.

Version
0.1 · draft
Status
Specified, not released
Install
Not available yet
Feedback
Design partners

§ 01

Architecture

Lineleaf runs beside your application. Writes go to your stores unchanged; Lineleaf receives lineage records and coordinates invalidation through adapters.
  1. L1

    Application

    your product

  2. L2

    Agent runtime

    LangGraph · MCP · custom loops

  3. L3

    Stores

    Memory · Vector · Cache · Graph · writes unchanged

  4. Beside the path

    LINELEAF

    It keeps ids, edges and sha256 fingerprints, never the content.

    derive()
    the runtime reports each edge
    why()
    the application asks for any record's lineage
    invalidate()
    Lineleaf acts on the stores, through adapters

§ 02

SDK

Wrap your runtime for zero-code capture, or call the three operations yourself. Both SDKs share names and semantics.
  1. derive(output, inputs, op, ttl?)

    What it does
    Records an edge from each input to the output. Middleware calls it for you.
    Side effects
    Writes lineage only
  2. invalidate(source, reason)

    What it does
    Returns a plan: plan.affected lists every descendant with a proposed action.
    Side effects
    None until plan.execute()
  3. why(artifact)

    What it does
    Returns the path back to the sources, with operations, models, times and attribution.
    Side effects
    None

A · Zero-code capture

Proposed interface · v0.1

agent.py · not publicly installable

from langgraph.store.postgres import PostgresStorefrom lineleaf.integrations.langgraph import instrument store = PostgresStore.from_conn_string(DB_URL)agent = instrument(builder.compile(store=store))   # your graph, unchanged # Every run now records its own lineage:#   tool_output → context → memory_write → pgvector, redis# No derive() calls. Edges carry ids and sha256 fingerprints, never content.agent.invoke({"messages": [message]}, config)

B · The explicit SDK

Proposed interface · v0.1

lineage.py · not publicly installable

from lineleaf import Lineleaf ll = Lineleaf(api_key=KEY) # derive(): record where an artifact came fromll.derive(    output=("mem0", "mem_7f2a"),    inputs=[("gmail", "msg_8812")],    op="extract",    ttl="180d",) # invalidate(): a dry run. Nothing is touched yet.plan = ll.invalidate(("gmail", "msg_8812"), reason="gdpr_erasure")plan.affected        # purge mem0:mem_7f2a, purge pgvector:emb_3310, … receipt = plan.execute()   # adapters act, webhooks firereceipt.verify()           # sha256 chain + ES256 signature # why(): trace any artifact back to its sourcesll.why(("redis", "ans_88"))
  1. aWrites lineage only: ids, operation, model, time. Never the content.
  2. bA dry run. Nothing in any store changes here.
  3. cAdapters act in dependency order; dependent agents get lineage.stale.
  4. dThe path back to the sources, with freshness.

§ 03

Data model

Lineleaf stores identifiers and relationships. The content of a memory, message or embedding never has to leave your stores.

Artifact

A stored object, identified by store and id, with a fingerprint, timestamps and an optional TTL.

store
memory
id
memory_72
fingerprint
sha256:41be…07
created_at
2026-09-02T14:21:09Z
ttl
180d

Edge

A parent to child relationship: the operation, model and time, with optional attribution.

parent
profile:user_117
child
memory:memory_72
op
extract
model
extractor-v3
weight
1.0

Event

An erasure, poisoning or correction trigger, which becomes a plan over the source's descendants.

type
revise
source
profile:user_117
reason
source_changed
actor
svc:profile-updates
scope
planned · 6

Receipt

A signed, hash-linked record of every artifact and adapter action involved in a cleanup.

id
rcpt_4be1c0a7
event
evt_93ac
actions
6 rows
chain
sha256 · prev → hash
signature
ES256

§ 04

Lifecycle

Every artifact moves through the same small state machine. Agents can subscribe to its transitions.

§ 05

Dry-run

Destructive actions are always two steps: plan, then execute. A scope limit stops a plan from quietly growing in between.
Proposed interface · v0.1

dry_run.py · not publicly installable

plan = ll.invalidate(("gmail", "ext_901"), reason="poison_detected", dry_run=True) for step in plan.affected:    print(step.store, step.id, step.action)   # nothing has been touched plan.require_scope(max_artifacts=50)          # refuse silent expansionreceipt = plan.execute()                      # adapters act; receipt returnedreceipt.verify()                              # check signature and hash chain
  1. aReturns a plan. Nothing is touched until execute().
  2. bExecution stops if the plan has grown past this since it was reviewed.
  3. cOne receipt row per action, in the order it ran.

§ 06

Adapters

An adapter declares what its store can guarantee. Stores that cannot confirm a deletion are reported, not hidden.
  1. Mem0

    Covers
    Long-term memories
    Verbs
    purge · mark stale · rebuild
    Status
    Planned
  2. Zep / Graphiti

    Covers
    Temporal knowledge graph
    Verbs
    purge facts · invalidate edges
    Status
    Planned
  3. Letta

    Covers
    Memory blocks, archival memory
    Verbs
    purge · rebuild blocks
    Status
    Planned
  4. LangGraph

    Covers
    Checkpoints, long-term store
    Verbs
    mark stale · halt runs
    Status
    Planned
  5. pgvector

    Covers
    Embeddings in Postgres
    Verbs
    purge · re-embed
    Status
    Planned
  6. Pinecone

    Covers
    Managed vector index
    Verbs
    purge · re-embed
    Status
    Planned
  7. Redis

    Covers
    Caches, cached answers
    Verbs
    evict
    Status
    Planned
  8. Your store

    Covers
    Anything you operate
    Verbs
    implement four verbs
    Status
    Adapter interface
Proposed interface · v0.1

adapter.ts · not publicly installable

// Every store implements four verbs and declares what it can guarantee.export interface LineleafAdapter {  store: string;                          // "pgvector", "redis", …  capabilities: {    delete: "guaranteed" | "best_effort" | "none";    rebuild: boolean;  };  exists(ids: string[]): Promise<Record<string, boolean>>;  delete(ids: string[], ctx: ActionContext): Promise<ActionResult[]>;  markStale(ids: string[], ctx: ActionContext): Promise<ActionResult[]>;  rebuild?(ids: string[], ctx: ActionContext): Promise<ActionResult[]>;}
  1. aA store that can’t guarantee deletion says so, and its rows are recorded as needs_review.
  2. bUsed to confirm a delete actually happened.

Product names are trademarks of their owners. Listing them implies no partnership or endorsement.

§ 07

Receipts

Each row’s sha256 commits to the row before it, and the receipt is signed with ES256, so it cannot be edited without breaking the chain. Partial outcomes are recorded as such.
Six executed actions are written as ledger rows; each row's hash becomes the next row's previous hash, and the receipt ends with a digest, an ES256 signature and “Chain verified. Signature valid.”
Film · receipt · simulation
Proposed format · v0.1
{  "receipt": "rcpt_7c1d09a2",  "type": "erasure receipt",  "event": {    "source": "gmail:msg_8812",    "reason": "gdpr_erasure",    "basis": "GDPR Art. 17",    "issued_at": "2026-03-04T10:00:00Z"  },  "scope": { "planned": 6, "executed": 6, "needs_review": 0 },  "actions": [    { "seq": 1, "artifact": "gmail:msg_8812", "action": "invalidate", "status": "completed",      "prev": "9b0e…41", "hash": "3f2a…c7" },    { "seq": 2, "artifact": "mem0:mem_7f2a", "action": "delete", "status": "completed",      "prev": "3f2a…c7", "hash": "e81d…09" },    { "seq": 3, "artifact": "pgvector:emb_3310", "action": "delete", "status": "completed",      "prev": "e81d…09", "hash": "5c64…b0" },    { "seq": 4, "artifact": "summary:sum_12", "action": "rebuild", "status": "completed",      "prev": "5c64…b0", "hash": "a40c…5e" },    { "seq": 5, "artifact": "redis:ans_88", "action": "delete", "status": "completed",      "prev": "a40c…5e", "hash": "d913…2a" },    { "seq": 6, "artifact": "langgraph:plan_31", "action": "mark_stale", "status": "completed",      "prev": "d913…2a", "hash": "7c1d…f3" }  ],  "webhooks": [    { "type": "lineage.stale", "artifact": "langgraph:plan_31", "directive": "replan" }  ],  "preserved": ["mem0:mem_51d0"],  "chain": { "alg": "sha256", "genesis": "9b0e…41", "digest": "7c1d…f3" },  "signature": { "alg": "ES256", "kid": "org_key_01", "value": "MEUCIQ…" }}
  1. aPartial outcomes stay visible: needs_review is never counted as done.
  2. bRow 1 commits to the genesis hash; every later row to the one before.
  3. cUntouched records are listed, so an auditor sees what stayed.
  4. dAn organization key in production. The browser demo signs with a throwaway key.

§ 08

Webhooks

Live agents shouldn’t keep acting on stale or poisoned context. Lineleaf posts lineage.stale, with a halt or replan directive, whenever something an agent depends on changes.
Proposed interface · v0.1
{  "type": "lineage.stale",  "artifact": "langgraph:plan_404",  "because": ["gmail:ext_901"],  "reason": "poison_detected",  "event": "evt_93ac",  "directive": "halt",  "hint": "stop the run; its context included a quarantined source"}
  1. aThe changed sources this agent's context depended on.
  2. bhalt or replan, chosen per trigger.
source changedlineage.stale → replanstale → replan
Plate 08Stale agent: An agent is running on context that just changed. It is told: lineage.stale, with a directive to halt or re-plan.

§ 09

Status

Where each piece stands. Updated as work lands.
  1. Architecture and v0.1 interfaceDefined · this page
  2. Interactive browser simulationLive on lineleaf.dev
  3. Lineage ledger (Postgres)In development
  4. Python and TypeScript SDKsPlanned
  5. Zero-code middleware: LangGraph, MCP, OpenTelemetryPlanned
  6. Dry-run planner and signed receiptsSpecified · simulated in the browser
  7. First adaptersPlanned, with design partners
  8. Managed cloudLater
Help shape the first release