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 Recallic finds no memory at all, tell the model not to guess about the user's past.
keep_on_decline True When Recallic declines but found memories, still give them to the model, with a note that Recallic is not sure they answer the message. False: a decline gives the no-record note only.

Every memory is shown with its date, and the model is told that a fact stays true until a later memory changes it, so it can use an older fact that nothing has replaced.

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.3

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.3
File Size Uploaded Provenance Actions
llama_index_memory_recallic-0.2.3.tar.gz 11.0 kB Without provenance Details for llama_index_memory_recallic-0.2.3.tar.gz

Built distribution (wheel)

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

Total release size: 21.4 kB

Release files / llama_index_memory_recallic-0.2.3.tar.gz

Download URL llama_index_memory_recallic-0.2.3.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
689378ddcefac316db44b336c57524e8e49f4103fa0b24c4bf62facd4f05a82b
BLAKE2b-256 checksum
How to use checksums
c5c4e06e26ccca122e9b6b0531ca8e477bc699ce2e20de4c9f5b4a74b43f2377
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.3-py3-none-any.whl

Download URL llama_index_memory_recallic-0.2.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59a03bd01bbe69700d738b9012ab5eaac66d0502713c00d8577f251005ae72ea
BLAKE2b-256 checksum
How to use checksums
bb0caac2e557f4f97c009eb208dc5d44f0b5d286b3130566d5ffc02d65cac478
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.3

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