Skip to main content

LlamaIndex + Memanto

LlamaIndex Give your LlamaIndex agents and query engines persistent memory across sessions using Memanto. LlamaIndex excels at querying documents and data, but context resets between runs. Memanto adds a semantic memory layer so your agents can store insights, user preferences, and decisions - and recall them later.

How It Works

Memanto is wired in as three FunctionTool instances (remember, recall, answer) that your LlamaIndex agent can call during reasoning. The agent decides when to store something, when to search raw memories, and when to get a synthesized answer directly from memory.

Prerequisites

Install

Step 1: Start Memanto Server

Step 2: Create the Memory Tools

Create memanto_tools.py:
Set MOORCHEH_API_KEY on the Memanto server � clients only send X-Session-Token.

Step 3: Build the Agent

Create agent.py:

Step 4: Run

Getting Synthesized Answers from Memory

The answer_tool calls Memanto’s built-in RAG - it synthesizes a direct response from stored memories using Memanto’s native model. No extra LLM token usage on your side.
When to use answer_tool vs recall_tool
  • Use recall_tool when the agent needs to reason over multiple raw memory items.
  • Use answer_tool when the agent (or user) needs a clean, direct response from memory.

Using with a Query Engine

Combine Memanto memory with LlamaIndex document retrieval:

Persistent Memory Across Sessions

Because memories live in Memanto and not in-process, they persist across agent restarts:

Next Steps