Skip to main content

llama-index-memory-recallic: Recallic memory for LlamaIndex agents

Website: recallic.com

Formerly llama-index-memory-recallix (0.1.x); renamed with the project, nothing else changed.

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

  • No LLM calls for memory. Storing and searching use Recallic'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 Recallic already holds is skipped.
  • Your data stays on your server, separated per user and per agent.

Install

pip install llama-index-memory-recallic

Run Recallic (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.recallic import RecallicMemoryBlock

block = RecallicMemoryBlock(api_key=os.environ["RECALLIC_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 Recallic agent id; each agent reads back what it wrote (and what any agent shared).
mode server's recall.mode cautious reads with a stricter reader and declines more (more "I don't know"); 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 Recallic 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 Recallic: RECALLIC_URL=http://127.0.0.1:8000 RECALLIC_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-recallic 0.2.2

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-recallic 0.2.2
File Size Uploaded Provenance Actions
llama_index_memory_recallic-0.2.2.tar.gz 9.9 kB Without provenance Details for llama_index_memory_recallic-0.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 19.8 kB

Release files / llama_index_memory_recallic-0.2.2.tar.gz

Download URL llama_index_memory_recallic-0.2.2.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c1508d1b40089c548af9c8902e480dd452126ff1de42db8adddd795b5b05d0e2
BLAKE2b-256 checksum
How to use checksums
5c609a445cd7429e98d9f4b046ae82b8abe86d61533c1b67893ec26f74e2e436
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_recallic-0.2.2-py3-none-any.whl

Download URL llama_index_memory_recallic-0.2.2-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e322b8b48d3d5ad4a6e7198fa183500f17c172285ea1b1e3a8abb67e12d39d16
BLAKE2b-256 checksum
How to use checksums
c893546bb25690d802387346cffd2a7023336121fe421f6d9d17e7c47257fdd5
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-recallic 0.2.2

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.

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