Connect with us

Tech

How to Build AI Agents With Memory Using Weaviate Engram

Published

on

How to Build AI Agents With Memory Using Weaviate Engram

LLMs are stateless. Every API call starts cold. That works for one-shot answers, and fails for agents that must remember preferences, past decisions, and lessons across sessions.

Weaviate Engram is a managed memory service built on Weaviate for exactly that problem. You send raw conversations or events. Engram extracts structured memories, reconciles them with what it already knows, and stores them for semantic search. Your agent stays fast because memory work runs asynchronously, while recall stays precise because retrieval is backed by Weaviate’s vector index.

This guide shows how to wire Engram into a real agent loop.

Why agents need Engram (not just a bigger context window)

Stuffing full chat history into every request looks simple. It does not scale.

  • Long context raises cost and latency on every turn.
  • Models still get lost in the middle.
  • Raw transcripts are noisy, contradictory, and outdated.
  • Multi-agent workflows split one task across multiple windows, so “one transcript” is not enough.

Engram’s model is different: actively maintain memories. Extract facts. Deduplicate. Update when preferences change. Retrieve only what is relevant for the next decision.

What Engram is

Engram is a memory server for LLM agents and apps. It exposes a REST API (https://api.engram.weaviate.io) and a Python SDK (weaviate-engram).

Core capabilities:

Core concepts (keep these straight)

  • Memories — discrete facts, embedded as vectors for search
  • Topics — categories that guide extraction (e.g. UserKnowledge, experience)
  • Groups — bundles of topics + a pipeline for one use case (often default)
  • Scopes — who a memory belongs to:
  • project-wide (shared learning)
  • user-scoped (hard isolation via multi-tenancy)
  • property-scoped (e.g. one summary per conversation_id)
  • Pipelines — async graphs that extract, reconcile, and commit

Templates like Personalization get you started without designing pipelines from scratch.

Setup

  1. Create an Engram project in Weaviate Cloud (Personalization template is a good start).
  2. Create an API key and save it immediately.
  3. Install the client:

pip install weaviate-engram anthropic

# or: uv add weaviate-engram

export ENGRAM_API_KEY=”eng_…”

export ANTHROPIC_API_KEY=”sk-ant-…”

import os

from engram import EngramClient

client = EngramClient(api_key=os.environ[“ENGRAM_API_KEY”])

The agent memory loop

A practical agent loop with Engram has three steps each turn:

  1. Recall — search memories for the current user message
  2. Act — call the LLM with recent turns + recalled context
  3. Remember — fire-and-forget the new exchange into Engram

1) Store conversations (async)

run = client.memories.add(

[

{“role”: “user”, “content”: “I just moved to Berlin and prefer specialty coffee, not chains.”},

{“role”: “assistant”, “content”: “Got it — I’ll keep specialty spots in Berlin in mind.”},

],

user_id=”alice”,

group=”default”,

)

print(run.run_id, run.status)

Engram returns a run_id immediately. The pipeline:

  1. Extract — pull topic-matching facts
  2. Transform — dedupe / merge with existing memories
  3. Commit — persist to Weaviate

You can poll with client.runs.wait(run.run_id) when you need consistency before the next search. In most chat UIs, fire-and-forget is fine because the latest turn is already in short-term context.

Other input types:

  • String — app events (“User viewed pricing page”)
  • Pre-extracted — agent decides what to remember via tool calls

2) Recall before the model responds

from engram import HybridRetrieval

results = client.memories.search(

query=”What kind of coffee does the user like?”,

user_id=”alice”,

group=”default”,

retrieval_config=HybridRetrieval(limit=5),

)

memory_context = “\n”.join(f”- {m.content}” for m in results)

Retrieval options:

Minimal memory-enabled agent

import os

import anthropic

from engram import EngramClient, HybridRetrieval

engram = EngramClient(api_key=os.environ[“ENGRAM_API_KEY”])

llm = anthropic.Anthropic()

user_id = “alice”

recent = [] # short-term: last few turns only

def agent_turn(user_input: str) -> str:

# 1) Recall long-term memory

results = engram.memories.search(

query=user_input,

user_id=user_id,

group=”default”,

retrieval_config=HybridRetrieval(limit=5),

)

memory_context = “\n”.join(f”- {m.content}” for m in results) or “- (none yet)”

system = f”””You are a helpful agent with persistent memory.

What you remember about this user:

{memory_context}

Use memories when relevant. Do not invent facts not present here or in the chat.”””

recent.append({“role”: “user”, “content”: user_input})

# 2) Act with short-term context + recalled memory

response = llm.messages.create(

model=”claude-sonnet-4-5-20250929″,

max_tokens=1024,

system=system,

messages=recent[-6:], # last ~3 exchanges

)

assistant = response.content[0].text

recent.append({“role”: “assistant”, “content”: assistant})

# 3) Remember asynchronously

engram.memories.add(

[recent[-2], recent[-1]],

user_id=user_id,

group=”default”,

)

return assistant

This pattern replaces growing history with search + a small recent window, which cuts tokens while keeping personalization.

Give the agent control with tools

Automatic recall before every turn is simple. Tool-based recall is more powerful for multi-step agents.

Expose Engram as tools:

This matches the Hermes Agent plugin model (engram_search, engram_store, engram_fetch).

Sketch:

tools = [

{

“name”: “search_memory”,

“description”: “Search long-term memories about the current user.”,

“input_schema”: {

“type”: “object”,

“properties”: {“query”: {“type”: “string”}},

“required”: [“query”],

},

},

{

“name”: “store_memory”,

“description”: “Store or correct a fact about the user.”,

“input_schema”: {

“type”: “object”,

“properties”: {“content”: {“type”: “string”}},

“required”: [“content”],

},

},

]

def handle_tool(name: str, args: dict, user_id: str):

if name == “search_memory”:

return [

m.content

for m in engram.memories.search(

query=args[“query”],

user_id=user_id,

retrieval_config=HybridRetrieval(limit=5),

)

]

if name == “store_memory”:

run = engram.memories.add(args[“content”], user_id=user_id)

return {“run_id”: run.run_id, “status”: run.status}

When the agent “forgets,” it stores a correcting memory. Engram’s reconcile pipeline supersedes the old one instead of leaving contradictions in the store.

Continual learning for agents (not only users)

Engram is not limited to user preferences. Configure topics like experience or feedback so agents learn workflows over time:

  • User says genre filtering should use a genres property, not near-text search.
  • Engram extracts feedback, transforms it into an experience memory, and commits it.
  • Next task, the agent searches experience memories and avoids the same mistake.

Scope choices matter:

  • Project-wide experience — team agents improve together
  • User-scoped experience — personal agents that never leak learning across users

Design patterns that work in production

  1. Always pass user_id for user-scoped topics — Engram enforces isolation; do not invent a shared memory bag.
  2. Use hybrid search by default — best balance of meaning and exact terms.
  3. Keep short-term history short — last 2–3 exchanges + recalled memories.
  4. Fire-and-forget adds; wait only when needed — e.g. before a critical next-step search.
  5. Use bounded topics for profiles — one UserProfile per user, fetched into the system prompt every turn.
  6. Let agents store corrections — do not delete as the primary “forget”; reconcile instead.
  7. Separate groups by use case — personalization vs continual learning stay clean.

REST fallback (any language)

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.”]}},

“user_id”: “alice”

}’

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 UI preferences does the user have?”,

“user_id”: “alice”,

“retrieval_config”: {“retrieval_type”: “hybrid”, “limit”: 5}

}’

Summary

Building agents with memory is not “save the transcript.” It is extract, reconcile, scope, and retrieve.

With Weaviate Engram you get:

  1. A low-latency write path (memories.add) that pipelines extraction in the background
  2. Weaviate-backed search (vector / bm25 / hybrid) for relevant recall
  3. Hard multi-tenant isolation by user and soft isolation by properties
  4. Two integration styles: auto-recall into the prompt, or agent-controlled tools

Start with the Personalization template, wire the search → respond → store loop, then add tool-based recall and experience topics as your agent grows.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Tech

Poco X8 Power, X8 5G launched in India, price starts Rs 29,999

Poco has launched the X8 Power 5G with a 10,000mAh battery at Rs 35,999, alongside the standard X8 5G at Rs 29,999, with sales beginning September 11 on Flipkart.

Published

on

Poco X8 Power and Poco X8 5G have been launched in India, with prices starting at Rs 29,999.

The X8 Power, priced at Rs 35,999, is built around a 10,000mAh battery paired with 100W HyperCharge fast charging.

The X8 Power also features a Qualcomm Snapdragon 6 Gen 5 chipset and a 6.83-inch 1.5K, 120Hz AMOLED display.

The standard X8 5G runs on a Snapdragon 6s Gen 4 chipset, with a 9,000mAh battery and a 50-megapixel dual rear camera setup.

Both phones will be available from September 11, 2026, exclusively through Flipkart.

At 229 grams and 8.65mm thick, the X8 Power’s weight and dimensions reflect the trade-offs of housing a 10,000mAh battery in a phone of this size.

The standard Poco X8 5G runs on a Qualcomm Snapdragon 6s Gen 4 chipset, with RAM options of 6GB, 8GB and 12GB.

Camera hardware on the Poco X8 5G includes a 50-megapixel primary sensor paired with a 2-megapixel secondary lens, along with a 16-megapixel front camera.

The Poco X8 Power’s 10,000mAh Silicon-Carbon battery is paired with 100W HyperCharge fast charging, aiming to offset the downside of a larger battery with quicker top-up times.

Poco has positioned both phones squarely in the budget-to-midrange segment, competing against similarly specced offerings from Redmi, Realme and other Chinese-origin brands in India.

Both phones will go on sale from September 11, 2026, at 12 noon, exclusively through Flipkart.

Launch offers include a Rs 2,000 coupon discount and a Rs 1,000 bank offer or exchange bonus, bringing effective prices down to Rs 26,999 for the X8 and Rs 32,999 for the X8 Power.

The Poco X8 Power 5G is powered by a Qualcomm Snapdragon 6 Gen 5 chipset and features a 6.83-inch 1.5K, 120Hz AMOLED display.

The X8 Power carries IP66, IP68, IP69 and IP69K ratings for dust and water resistance, an unusually comprehensive set of protections for its price segment.

Wikimedia Commons, CC BY-SA 4.0 (representative Poco smartphone image)

Continue Reading

Tech

Yamaha launches R2 in India, price starts at Rs 2.30 lakh

Yamaha has launched the all-new R2 in India starting at Rs 2.30 lakh ex-showroom, with a 204cc engine, three variants and deliveries beginning mid-September.

Published

on

Yamaha has launched its new R2 motorcycle in India, with the base trim priced at Rs 2.30 lakh ex-showroom.

The lineup extends to the R2 Quick Shifter at Rs 2.39 lakh and the top-tier R2M at Rs 2.53 lakh, both ex-showroom.

The R2 runs on a new 204cc, liquid-cooled single-cylinder engine producing 26.5 PS and 19.1 Nm of torque, paired with a six-speed gearbox and assist-slipper clutch.

Weighing 149kg, the bike is 11 to 14kg lighter than rivals including the KTM RC 200 and Hero Karizma XMR.

Yamaha will start deliveries of the R2 from mid-September 2026 via its Blue Square dealerships in India.

All three variants get a 5-inch TFT display, dual-channel ABS, traction control and Yamaha’s Ride Control system with Street, Sport and Rain modes.

The R2’s main rivals include the KTM RC 200, priced between Rs 2.14 lakh and Rs 2.32 lakh, and the Hero Karizma XMR, priced between Rs 1.87 lakh and Rs 1.88 lakh.

Deliveries of the Yamaha R2 are set to begin from mid-September 2026, with the bike sold through Yamaha’s Blue Square dealership network across India.

Estimated on-road pricing in Delhi ranges from roughly Rs 2.60 lakh for the base variant to about Rs 2.85 lakh for the top-spec R2M.

The R2 had opened for bookings ahead of its official launch, with Yamaha collecting refundable pre-booking amounts as a gauge of early demand before the bike’s confirmed pricing was revealed.

The R2 is powered by a completely new 204cc, liquid-cooled, single-cylinder engine with double overhead camshafts and four valves, producing 26.5 PS at 10,000 rpm and 19.1 Nm of torque at 8,000 rpm.

Power is routed through a six-speed gearbox paired with an assist-slipper clutch, aimed at smoother downshifts during aggressive riding.

At 149kg kerb weight, the R2 is roughly 11 to 14kg lighter than key rivals, a difference Yamaha is positioning as a handling advantage.

Wikimedia Commons, CC BY-SA 4.0 (representative Yamaha YZF-R series motorcycle image)

Continue Reading

Tech

Xiaomi launches Redmi Note 17 Pro Max globally, India debut expected Sept 15

Xiaomi has launched the Redmi Note 17 Pro Max globally with a 10,000mAh battery and 100W charging, its largest battery yet, ahead of an expected India launch on September 15.

Published

on

Xiaomi has launched the Redmi Note 17 Pro Max globally, equipping the phone with a 10,000mAh battery, the largest fitted to any Xiaomi smartphone to date.

The battery is supported by 100W wired charging, giving the device a standout combination of endurance and fast top-up speed.

The global rollout on August 27 also included the standard Redmi Note 17 and Redmi Note 17 Pro as part of the same lineup refresh.

India pricing and availability have not been officially confirmed, but earlier reports suggest the Pro and Pro Max variants could launch in the country on September 15.

Globally, the Redmi Note 17 Pro Max starts at JPY 79,980, roughly Rs 48,000, for the 8GB RAM and 256GB storage configuration.

The global launch also included the standard Redmi Note 17 and the Redmi Note 17 Pro, both positioned below the Pro Max in Xiaomi’s refreshed lineup.

India pricing for the Redmi Note 17 Pro Max has not yet been officially announced, though industry watchers expect it to carry a premium of roughly Rs 5,000 to Rs 8,000 over its predecessor, the Redmi Note 15 Pro Plus, which launched at Rs 37,999.

The jump to a 10,000mAh battery marks a significant increase over typical flagship and mid-range battery capacities in the Indian market, most of which remain in the 5,000mAh to 7,000mAh range.

Xiaomi has not detailed the exact India availability channels yet, though its recent Redmi Note launches have typically been sold through Flipkart, the Mi India online store and offline retail partners.

The Redmi Note series remains one of Xiaomi’s best-selling smartphone lines in India, with the Pro Max positioning aimed at buyers seeking flagship-adjacent features at a mid-range price point.

The phone features a 6.83-inch AMOLED display with 1.5K resolution, a 120Hz refresh rate and support for HDR10+ and Dolby Vision streaming, with peak brightness rated up to 3,500 nits.

Wikimedia Commons, CC BY-SA 4.0 (representative Redmi Note series smartphone image)

Continue Reading

Trending