Skip to main content

llama-index-memory-recallix: Recallix memory for LlamaIndex agents

RecallixMemoryBlock plugs a self-hosted Recallix server into LlamaIndex's Memory as a long-term memory block.

  • No LLM calls for memory. Storing and searching use Recallix's local models.
  • Across sessions and agents. Each turn, the block recalls what this user said before, in any earlier session, that bears on their latest message.
  • Honest. When nothing answers it, the model is told there is no record instead of being handed near-misses to guess from.
  • Stored right away. New user messages are stored every turn, not only when LlamaIndex moves them out of short-term memory; re-sending one Recallix already holds is skipped.
  • Your data stays on your server, separated per user and per agent.

Install

pip install llama-index-memory-recallix

Run Recallix (quickstart) and create a key with role service, which acts for each of your users (or use a user's own key and leave user_id out):

python -m backend.tools.keys create --user my-llamaindex-app --role service

Use

import os

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.core.memory import Memory
from llama_index.memory.recallix import RecallixMemoryBlock

block = RecallixMemoryBlock(api_key=os.environ["RECALLIX_SERVICE_KEY"], base_url="http://localhost:8000",
                            user_id="alice", mode="balanced")       # or "cautious" / "helpful"
memory = Memory.from_defaults(session_id="alice-chat-1", memory_blocks=[block])

agent = FunctionAgent(llm=llm, tools=[...])
await agent.run("I moved to Pune in March.", memory=memory)

# days later, a new session: a new Memory, the same user
later = Memory.from_defaults(session_id="alice-chat-2", memory_blocks=[block])
await agent.run("Which city did I move to?", memory=later)   # "You moved to Pune."
Parameter Default What it does
user_id None Whose memory this is. Needed with a service key; leave out with a user's own key.
agent_id llamaindex Recallix agent id; each agent reads back what it wrote (and what any agent shared).
mode server's recall.mode cautious checks every answer twice; helpful answers more counting, ordering and "how long between" questions and adds a worked-out result.
limit 5 Memories given to the model per turn.
store_roles ("user",) Which message roles are stored. The default stores what users said, not the model's replies.
store_immediately True Store new messages every turn (after recalling). False: only when LlamaIndex moves them out of short-term memory.
tell_model_on_decline True When nothing answers, tell the model not to guess about the user's past.

Notes:

  • The block is queried with the user's latest message. A message's original time can be given as additional_kwargs={"timestamp": <unix seconds>}; the LlamaIndex session id is kept in the memory's metadata.
  • The API key is not included when the block is serialized.
  • Needs Recallix server 0.2.5 or newer; messages go in one request per 100 on server 0.2.6 or newer.
  • Tested with llama-index-core 0.14.

Tests

Against a running Recallix: RECALLIX_URL=http://127.0.0.1:8000 RECALLIX_SERVICE_KEY=rx_... pytest tests. They include a real LlamaIndex chat engine run with a scripted model.

Licence: Apache-2.0.

Metadata

Release files for llama-index-memory-recallix 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-memory-recallix 0.1.0
File Size Uploaded Provenance Actions
llama_index_memory_recallix-0.1.0.tar.gz 5.8 kB Without provenance Details for llama_index_memory_recallix-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-memory-recallix 0.1.0
File Interpreter ABI Platform Actions
llama_index_memory_recallix-0.1.0-py3-none-any.whl Python 3 none any Details for llama_index_memory_recallix-0.1.0-py3-none-any.whl

Total release size: 11.4 kB

Release files / llama_index_memory_recallix-0.1.0.tar.gz

Download URL llama_index_memory_recallix-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
32feeb225d77c6c4b58668079d6581b83ee36df1adbfe9129b6f29b132c7e223
BLAKE2b-256 checksum
How to use checksums
f4ab6a09ee44b00f3b71027f0f5a46852ec720d21905f7a1928a7439d716baa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / llama_index_memory_recallix-0.1.0-py3-none-any.whl

Download URL llama_index_memory_recallix-0.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a822176b0ece0f1d85fa0021817ed5e7fb3ccec5dc5683d4e15de0f54c605ce5
BLAKE2b-256 checksum
How to use checksums
5a8fcf25e3ec5fd4e7aa9009977383f7277308931b472f24e5520d5eb3a2ef7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for llama-index-memory-recallix 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page