Linea Docs

Memory System

Persistent fact storage that gives your AI agents memory across workflow runs.

Memory System

Linea's memory system gives your AI agents persistent, structured memory across workflow runs. Agents can remember facts, user preferences, and past events — and retrieve them later with natural-language search.

How it works

When you send text to the memory ingest endpoint, Linea:

  1. Breaks the text into the smallest self-contained facts
  2. Checks whether any of those facts conflict with existing memories
  3. If a new fact supersedes an old one, the old memory is automatically retired
  4. Stores the remaining facts and makes them searchable

This means your agent's memory stays accurate over time — stale facts are replaced, not duplicated.

Memory scopes

ScopeWhat it covers
threadA single agent conversation
workflowAll runs of a specific workflow
userPersistent facts about a user across all workflows

Fact types

Memories can be categorized for easier retrieval:

TypeExamples
factGeneral information
preference"User prefers dark mode"
event"Deployed to production on 2024-03-15"
profile"User's name is Alex"
systemInternal agent notes

API Endpoints

MethodPathDescription
POST/workspaces/:wId/memories/ingestIngest text and extract facts
POST/workspaces/:wId/memories/searchSearch memories by natural language query
GET/workspaces/:wId/memoriesList memories
DELETE/workspaces/:wId/memories/:idDelete a memory
GET/workspaces/:wId/memories/profileGet user profile grouped by fact type

Ingesting memories

POST /workspaces/:wId/memories/ingest
 
{
  "content": "Alex prefers concise responses and is based in London.",
  "scope": "user",
  "userId": "user_abc"
}

Response:

{
  "memoriesCreated": 2,
  "memoriesUpdated": 0,
  "sessionId": "uuid"
}

Searching memories

POST /workspaces/:wId/memories/search
 
{
  "query": "what does the user prefer?",
  "scope": "user",
  "limit": 10
}

Search uses a combination of semantic similarity and keyword matching to find the most relevant memories.

User profile

Get all memories about a user, grouped by fact type:

GET /workspaces/:wId/memories/profile?userId=user_abc
{
  "facts": [...],
  "preferences": [...],
  "events": [...],
  "profile": [...]
}

Using memory in workflows

The Memory node inside a workflow can read from or write to memory directly — no API calls needed. Facts stored during one run are available in all future runs.

Memory search is powered by semantic embeddings. Queries like "what city is the user in?" will match memories like "Alex is based in London" even without exact keyword overlap.

On this page