Memory bootstrap

Turn conversation history into structured memory.

Most teams adopting memory infrastructure already have months of conversation data. A post-session extraction hook — or a batch pipeline over historical logs — gives every user a bootstrapped memory profile from day one, without replaying every message through a live agent.

The problem

Memory infrastructure has a cold-start problem.

The agent-write path is the right long-term solution — the agent learns as it works, writes what it discovers, and builds a richer profile over time. But it only captures the future. A new deployment starts with empty memory, and every user gets the same blank-slate experience regardless of how long they've been a customer.

For a coaching app, that means the AI asks about goals the user already explained months ago. For a support agent, it re-establishes context that was resolved in a prior ticket. For a sales assistant, it misses deal history that exists in session logs but nowhere else.

The obvious fix — replaying historical conversations through a live agent — is slow, expensive, and fragile. Every historical session runs at full inference cost. Tool calls fire against live systems. Failures mid-replay leave memory in a partial state with no easy way to resume.

Storing raw conversation logs in a vector index gives you retrieval but not memory. The agent can search past transcripts but can't distinguish a one-time request from a durable preference, and can't update a belief when the user's situation changes.

How MemexAI fits

Extract once. Inherit everywhere.

A lightweight extraction pass reads a conversation transcript, identifies what's worth remembering, and writes it as a structured memory file. Future sessions inherit the extracted context via the prompt block — the same path as live-written memory.

Post-session hook or batch pipeline

Run extraction as a post-session hook after each conversation closes, or as a one-time batch job over historical logs. The extraction LLM filters out ephemeral content and writes only durable facts — the signal, not the noise. The reason field tags every write as 'conversation-extraction' so you can distinguish bootstrapped memory from live-written memory in the access log.

import { createMemex } from '@memexai/core'
import { generateText } from 'ai'

const memex = createMemex(DATABASE_URL)

type Message = { role: 'user' | 'assistant'; content: string }

async function extractMemory(
  userId: string,
  transcript: Message[],
) {
  const { text: facts } = await generateText({
    model,
    system: `Extract durable facts worth remembering.
Focus on: preferences, decisions, recurring context.
Ignore: one-time requests, pleasantries, ephemeral state.
Return concise Markdown bullet points.`,
    prompt: transcript
      .map(m => `${m.role}: ${m.content}`)
      .join('\n'),
  })

  if (!facts.trim()) return

  const user = memex.forUser({
    userId,
    actor: 'extraction-pipeline',
  })
  await user.write(
    'user/extracted.md',
    facts,
    'conversation-extraction',
  )
}

// Run after each session closes
await extractMemory(userId, session.messages)

What the agent inherits

Extracted memory files appear in the prompt block alongside live-written memory. The agent gets full context from the first session — no cold start, no re-establishing what the user already told a previous version of the system.

Revision history shows when each extracted fact was written, by which pipeline run, and from which source. If an extracted belief turns out to be wrong, your team can correct it directly in the admin console — same correction surface as any other memory file.

The extraction prompt can live in shared/ memory — a shared file that defines what counts as worth remembering for your product. Update the extraction policy without redeploying the pipeline.

What you actually get

Zero cold start on day one.

Bootstrapped memory from existing logs — users get personalized responses from the first session.
Extraction writes are tagged separately in access logs — you always know what came from extraction vs. live sessions.
Extracted facts are correctable — open any file in the admin console and fix wrong beliefs before they reach users.
Extraction prompt lives in shared memory — tune what gets remembered without redeploying.
Docs

Go deeper.