Skip to main content
Weaviate Docs (migrated from docs.weaviate.io) Docs

Search documentation

Type to search this documentation.

On this pageOverview

Quickstart

Engram is a memory server for LLM agents and applications. It automatically extracts, transforms, and stores memories using vector embeddings and LLM-powered processing.

This guide walks you through the core Engram workflow: create a project, get an API key, store a memory, and search for it.

pip
pip install weaviate-engram
uv
uv add weaviate-engram

Every memory in Engram belongs to a project. Create one in the Weaviate Cloud console.

Follow this interactive walkthrough to create a project with the Personalization template, set up its group and the UserKnowledge topic, and generate an API key to connect to it:

You can select a predefined template when creating a project. For this tutorial, use the Personalization template.

The template sets up the project's default group with default topics, such as UserKnowledge for general information about the user. This is enough to get started.

The template also lets you optionally add a ConversationSummary topic, which maintains a single summary per conversation. Enabling this option makes a conversation_id property required when adding memories that target it, which is why it's disabled by default.

Concepts to learn

Here are the key concepts:

  • Topics — Named categories that control what kinds of information Engram extracts. The topic's description guides the LLM during extraction.
  • Groups — Containers of topics. Each group maps to a use case (e.g. personalization, continual learning).
  • Scopes — Control who memories belong to. The default topic UserKnowledge is user-scoped, meaning you must provide a user_id so each user's memories stay separate.

Visit the concepts section to learn more about how these work together.

Generate an API key for your project in the Weaviate Cloud console. The full key is only shown once — save it securely.

Set it as an environment variable for the examples below:

Bash
export ENGRAM_API_KEY="eng_abcdef123456..."

Initialize the client with your API key.

Python
client = EngramClient(
    api_key=os.environ["ENGRAM_API_KEY"]
)

All curl commands authenticate via the Authorization header with a Bearer token:

Bash
-H "Authorization: Bearer $ENGRAM_API_KEY"

Send content to Engram using the memory API. This example sends a plain text string.

Python
run = client.memories.add(
    "The user prefers dark mode and uses VS Code as their primary editor.",
    user_id="alice",  # any unique string per user (e.g. a username)
)

print(run.run_id)
print(run.status)
cURL
curl -X POST https://api.engram.weaviate.io/v1/memories \
  -H "Authorization: Bearer $ENGRAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "string": {
        "content": [
          "The user prefers dark mode and uses VS Code as their primary editor."
        ]
      }
    },
    "user_id": "user-uuid"
  }'

Engram processes memories asynchronously and immediately returns a run_id. In most cases you don't need to wait, since memories become available for search once the pipeline finishes. If you want to confirm when a run completes, see Check run status.

Example response
JSON
{
  "run_id": "run-uuid",
  "status": "running"
}

Search for relevant memories using a natural language query.

Python
results = client.memories.search(
    query="What editor does the user prefer?",
    user_id="alice",
)

for memory in results:
    print(memory.content)
cURL
curl -X POST https://api.engram.weaviate.io/v1/memories/search \
  -H "Authorization: Bearer $ENGRAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What editor does the user prefer?",
    "user_id": "user-uuid",
    "retrieval_config": {
      "retrieval_type": "hybrid",
      "limit": 5
    }
  }'
Example response
JSON
{
  "memories": [
    {
      "id": "memory-uuid",
      "project_id": "project-uuid",
      "user_id": "user-uuid",
      "content": "The user prefers dark mode.",
      "topic": "UserKnowledge",
      "group": "default",
      "created_at": "2025-01-01T00:00:01Z",
      "updated_at": "2025-01-01T00:00:01Z",
      "score": 1
    },
    {
      "id": "memory-uuid-2",
      "project_id": "project-uuid",
      "user_id": "user-uuid",
      "content": "The user uses VS Code as their primary editor.",
      "topic": "UserKnowledge",
      "group": "default",
      "created_at": "2025-01-01T00:00:01Z",
      "updated_at": "2025-01-01T00:00:01Z",
      "score": 1
    }
  ],
  "total": 2
}
  • Learn about core concepts like topics, groups, and pipelines.
  • Explore different ways to store memories, including conversations and pre-extracted data.
  • See all search options including vector, BM25, and hybrid retrieval.

Have a question or feedback? Here's how to reach us.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu