Tech
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
- Create an Engram project in Weaviate Cloud (Personalization template is a good start).
- Create an API key and save it immediately.
- 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:
- Recall — search memories for the current user message
- Act — call the LLM with recent turns + recalled context
- 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:
- Extract — pull topic-matching facts
- Transform — dedupe / merge with existing memories
- 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
- Always pass user_id for user-scoped topics — Engram enforces isolation; do not invent a shared memory bag.
- Use hybrid search by default — best balance of meaning and exact terms.
- Keep short-term history short — last 2–3 exchanges + recalled memories.
- Fire-and-forget adds; wait only when needed — e.g. before a critical next-step search.
- Use bounded topics for profiles — one UserProfile per user, fetched into the system prompt every turn.
- Let agents store corrections — do not delete as the primary “forget”; reconcile instead.
- 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:
- A low-latency write path (memories.add) that pipelines extraction in the background
- Weaviate-backed search (vector / bm25 / hybrid) for relevant recall
- Hard multi-tenant isolation by user and soft isolation by properties
- 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.
Tech
Bank of Baroda investigates alleged data leak on dark web
Bank of Baroda is investigating an alleged data leak after nearly 1TB of data was found on the dark web.
Bank of Baroda is investigating an alleged data leak after nearly a terabyte of data reportedly linked to the bank surfaced on the dark web.
The dataset was first identified by cybersecurity researcher Srikanth Lakshmanan, founder of the consumer advocacy platform Cashless Consumer, who found the listing over the weekend.
The alleged leak reportedly includes customer identity documents, loan application and appraisal records, internal audit reports, branch documents, customer application forms and internal communications.
Some reports have additionally claimed the dataset contains Aadhaar numbers and account records tied to savings, current and loan accounts, as well as NRI and corporate banking customers.
Researchers have suggested a possible link to a threat actor known as TripleX, previously tied to attacks on Indonesian financial institutions, though the connection is unconfirmed.
Bank of Baroda said the incident originated from the compromise of an employee’s email account, not any breach of its core banking infrastructure.
“The bank’s core banking systems were not accessed and continue to remain secure,” the bank said, confirming a comprehensive forensic investigation had been launched.
The bank said it was working closely with relevant authorities as the probe into the alleged breach continues.
Bank of Baroda’s share price fell 1.50 per cent to Rs 240.35 on the NSE on July 28, as the alleged breach added to concerns following the lender’s weaker first-quarter FY27 results.
The bank said containment measures were implemented immediately once the breach was detected, and that it was complying with all applicable regulatory requirements during the ongoing probe.
Data breaches involving Indian financial institutions have drawn increasing regulatory attention in recent years, with lenders required to report significant cybersecurity incidents to sector regulators within stipulated timeframes.
Bank of Baroda is one of India’s largest public sector banks, with a network spanning thousands of branches across the country as well as international operations in several countries.
(Image: Photo by Raghavan2010, Wikimedia Commons, CC BY-SA 4.0)
Tech
OnePlus N6x India launch confirmed for July 31
OnePlus has confirmed its N6x will launch in India on July 31, with a 7,000mAh battery and AI camera tools among its highlights.
OnePlus has confirmed that its N6x smartphone will launch in India on July 31 at 12 pm IST.
The device will go on sale on August 4, available via Amazon India and OnePlus India’s official online store.
A 7,000mAh battery has been confirmed, with OnePlus stating it can offer up to 2.5 days of use on a single charge.
Specific figures shared by the company include up to 20.56 hours of video playback and 133.56 hours of music playback on a full charge.
Camera features on the N6x will include AI Portrait Glow for low-light portraits, AI Eraser to remove unwanted objects or people, and AI Unblur to sharpen blurry photos.
The phone has a flat display with a refresh rate of up to 120Hz.
It will be sold in Burgundy Red and Ice Blue colour options.
Pricing has not yet been made official and is expected to be announced at the July 31 launch event.
The 7,000mAh cell marks one of the largest batteries OnePlus has fitted into a phone sold in India, reflecting a broader industry trend of manufacturers prioritising longer battery life in budget and mid-range devices.
OnePlus has said further details on the N6x, including its full specification sheet and official price, will be confirmed only once the July 31 launch event takes place, with the company keeping some details under wraps until then.
The AI camera suite being introduced on the N6x mirrors similar tools OnePlus has rolled out on its more expensive Nord and flagship number-series phones over the past year, suggesting the company is extending these features further down its lineup.
The N6x is expected to be the second device in OnePlus’s budget-focused N series, following the OnePlus N6, and is likely to be positioned at a similar or slightly lower price point once official pricing is announced.
(Image: Dsr07 (CC BY-SA 4.0))
Tech
Galaxy Z Fold8 priced from Rs 1,79,999 as India pre-orders open
Samsung’s Galaxy Z Fold8 is priced from Rs 1,79,999 in India as pre-orders open today, ahead of sales starting August 8.
Samsung’s Galaxy Z Fold8 is priced from Rs 1,79,999 in India as pre-orders opened today, following its unveiling at the Galaxy Unpacked event on July 22.
The 12GB+512GB variant costs Rs 1,99,999, and the 16GB+1TB variant is priced at Rs 2,39,999. Open sales are scheduled to begin on August 8.
The phone features a 7.6-inch Dynamic AMOLED 2X foldable display with a 120Hz adaptive refresh rate and up to 3,000 nits of peak brightness, driven by the Snapdragon 8 Elite Gen 5 chipset.
Its camera system includes dual 50MP rear sensors, with a wide-angle lens offering OIS and 2x optical quality zoom, plus a 50MP ultra-wide lens.
A 4,800mAh battery supports up to 63 per cent charge in about 30 minutes through 45W wired charging, along with 20W wireless charging and Wireless PowerShare.
Weighing 201 grams, it is Samsung’s lightest Z Fold model so far, with an exchange bonus of Rs 10,000 or an instant bank discount of Rs 9,000 on offer.
(Image: Vasonesiku (CC BY-SA 4.0))
-
Brandpost2 years agoRedfox Overseas: Customize Your Own Energy Drink and Stand Out in the Market
-
Brandpost2 years agoZamzam Company CEO Chhote Bhai-Bade Bhai gave a grand welcome to Indian writer Devhari Sirvi in Dubai
-
Fashion2 years agoShikha Sharma: The Fashion Journalist, Blogger, and Plus-Size Model Taking the Industry by Storm
-
Entertainment1 year ago
Lucky Roxx’s “Yadav Ki Pukar” Goes Viral! Youth Celebrate Unity & Power
-
Entertainment9 years agoMeet Superman’s grandfather in new trailer for Krypton
-
Entertainment9 years agoNew Season 8 Walking Dead trailer flashes forward in time
-
Brandpost2 years agoFrom Local Hero to National Icon: Satyam Yadav’s Journey with TwentyOne
-
Business2 years agoThe journey of Matrix Coded: From a freelancer to a renowned brand
