Memory

Data Model

Database schema and field definitions

The engine uses PostgreSQL (via Prisma) to store memory metadata and Qdrant for vector embeddings. The primary data entity is Memory.

Schema (Memory)

FieldTypeDescription
idIntUnique primary key (autoincrement).
userIdIntID of the user who owns the memory.
agentIdString?Optional ID of the agent that created the memory.
runIdString?Optional ID for grouping memories by execution run.
roleString?Role of the message creator (e.g., "user", "assistant").
sourceStringSource of the memory (e.g., "chat", "codebase", "manual").
sourceIdStringExternal ID references the source (e.g., message ID).
timestampDateTimeLogical timestamp of the memory.
contentStored in QdrantThe actual text content is primarily managed via embeddings/payloads, though raw text can be retrieved.
contentUrlStringURL or path to the original content.
titleStringTitle or brief description.
originStringOrigin system or component.
tagsString[]Array of tags for categorization.
categoryString[]Array of categories.
attributeJsonFlexible JSON field for extra metadata (e.g., key/value pairs).
summaryStringShort summary of the memory.
typeStringType of memory (e.g., "text", "procedural").
importanceFloatImportance score (0-1).
confidenceFloatConfidence score (0-1).
embeddingRefIntReference ID potentially linking to vector store status.
contentHashStringUnique hash of the content for deduplication.
createdAtDateTimeCreation timestamp.
updatedAtDateTimeLast update timestamp.

Indices

To ensure performance, the following indices are maintained:

  • [contentHash] - For fast deduplication checks.
  • [userId, contentHash] - For user-scoped deduplication.
  • [userId, agentId, runId] - For fast retrieval of execution history.

On this page