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

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.1
File Size Uploaded Provenance Actions
llama_index_memory_recallic-0.2.1.tar.gz 5.9 kB Without provenance Details for llama_index_memory_recallic-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 11.6 kB

Release files / llama_index_memory_recallic-0.2.1.tar.gz

Download URL llama_index_memory_recallic-0.2.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31884e5a453d4a594dc76106d4239f1792779d78ebf3489970cbf20ec151bca9
BLAKE2b-256 checksum
How to use checksums
d23a77346d7943fd7644d85e42b159c813ae479f320f14124e53f8d1fc4c4549
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.1-py3-none-any.whl

Download URL llama_index_memory_recallic-0.2.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1dca52eacdeafc17a167115d31dbdc3fe88843ae66a7ed8454bef2ec0329d08
BLAKE2b-256 checksum
How to use checksums
9c2d1ed8bcebc88143a6b9e1016fa5fadeb6d0d4e0211dd02d555d950ba4a137
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.1

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