Skip to main content
Go to documentation:
⌘U
Weaviate Database

Develop AI applications using Weaviate's APIs and tools

Deploy

Deploy, configure, and maintain Weaviate Database

Query Agent

Run agentic search over your Weaviate Cloud collections

Weaviate Cloud

Manage and scale Weaviate in the cloud

Engram

Persistent memory for LLM agents and applications

Additional resources

Integrations
Contributor guide
Events & Workshops
Weaviate Academy

Need help?

Weaviate LogoAsk AI Assistant⌘K
Community Forum

Input data types

Engram accepts three types of input content when storing memories:

TypeDescriptionUse case
stringRaw text (one or more strings)Free-form notes, agent observations
conversationMulti-turn messages with rolesChat transcripts, agent conversations
pre_extractedAlready-structured items, each with a target topicWhen you've done your own extraction

You pass one of these three shapes as the first argument to client.memories.add(). Exactly one content type is used per call.

String

Send raw text and let Engram's pipeline extract structured memories from it. content is an array, so you can send multiple unrelated strings in one call — each becomes its own pipeline input.

client.memories.add("The user prefers dark mode and uses VS Code.", user_id=test_user_id)

Conversation

Send multi-turn messages with roles for chat transcripts and agent conversations. The pipeline uses conversation-aware extraction to pull memories from the dialogue.

Messages follow the OpenAI Chat Completions format: role is one of user, assistant, system, tool, or developer. Tool calls (tool_calls, tool_call_id, name) are supported. The server normalizes tooluser and developersystem internally.

client.memories.add(
[
{"role": "user", "content": "I just moved to Berlin."},
{"role": "assistant", "content": "Welcome to Berlin!"},
{"role": "user", "content": "I prefer specialty coffee."},
],
user_id=test_user_id,
)

Pre-extracted

Send already-structured items when you've done your own extraction. Each item carries its target topic and bypasses the LLM extraction step — it still flows through the transform and commit stages.

from engram import PreExtractedInput, PreExtractedItem

client.memories.add(
PreExtractedInput(items=[
PreExtractedItem(content="User prefers dark mode", topic="UserKnowledge"),
PreExtractedItem(content="User works in Python", topic="UserKnowledge"),
]),
user_id=test_user_id,
)

Questions and feedback

If you have any questions or feedback, let us know in the user forum.