Skip to main content

Recall SDK

PyPI version Python

Recall is a pluggable memory layer for LLM applications. It enables long-term memory by extracting, storing, and retrieving relevant information from user input, and injecting it back into prompts. Compatible with any OpenAI-style API.


Overview

Recall SDK gives your LLM apps long-term memory. It:

  • Extracts memory-worthy facts from user input
  • Stores them with TTL, tags, importance, and source
  • Injects relevant context into future prompts

It works with any OpenAI-compatible LLM API (OpenAI, Groq, etc.).


Installation

pip install recall-sdk

Quickstart

from recall import withrecall
from recall.memory import MemoryStore
from recall.llm.llm_client import create_openai_client

llm = create_openai_client(
    api_key="your-key",
    base_url="https://api.groq.com/openai/v1",
    model="mixtral-8x7b-32768"
)

store = MemoryStore()

with_recall = withrecall(llm=llm, store=store)
response = with_recall.chat("My dog's name is Ollie.")
print(response)

with_recall.remember("I live in Berlin.", tags=["location"], importance=0.8)

High Level API: withrecall()

Contructor

with_recall = withrecall(
    llm,                 # Callable that takes prompt and optional system_prompt
    store,               # MemoryStore instance
    user_id="default",   # Optional session/user ID
    strategy="always",   # Extraction strategy: always, batch
    metadata=None        # Optional metadata passed to handler
)

Methods

with_recall.chat(message: str) -> str

Extracts memory, injects relevant context, returns LLM response.

chat.remember(content: str, tags: List[str] = [], importance: float = 0.5)

Manually store memory entries.

Low-Level API (for more granular control over the memory)

Memory Store

from recall.memory import MemoryStore

store = MemoryStore()

store.add_memory(MemoryEntry(...))
store.get_memories("user-id")
store.export_memories("user-id", path="backup.json")
store.import_memories(data)

Memory Entry

from recall.memory import MemoryEntry

MemoryEntry(
    user_id="user-id",
    content="The Eiffel Tower is in Paris.",
    tags=["travel"],
    importance=0.9
)

Extraction Strategies

  • "always" : Extract memory from every message sent by the user [an extra LLM call to create a memory from the user's prompt and store it in the Memory]
  • "batch" : Extract memory every N messages [meta data controlled] [an extra LLM call after every N messages. This call uses all previous user prompts to get MemoryEntries]
  • "heuristic" : TBD

Memory Structure

Memory Structure Each memory is stored with:

  • id (UUID)
  • user_id
  • content
  • created_at
  • last_accessed
  • tags (list of strings)
  • importance (float 0–1)
  • ttl_days (time to live)
  • source (chatbot, manual, etc.)
  • embedding (To be integrated with high level API in future for semantic search)

Metadata

Release files for recall-sdk 0.2.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 recall-sdk 0.2.0
File Size Uploaded Provenance
recall_sdk-0.2.0.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for recall-sdk 0.2.0
File Interpreter ABI Platform
recall_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / recall_sdk-0.2.0.tar.gz

Download URL recall_sdk-0.2.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
961691cbc11e83d572a1d3dd1f9eda2470ec3716206d97bbe891e4e61eebb73d
BLAKE2b-256 checksum
How to use checksums
0bbaa4f99d264dc5526d9510d219f5d7b500aef9344d9fe34a9113d9ff91b13a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / recall_sdk-0.2.0-py3-none-any.whl

Download URL recall_sdk-0.2.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01d97b88b1be4466ec066b29907c6461df8cf4dc5c5e2e874167e1639d6b74af
BLAKE2b-256 checksum
How to use checksums
ecfa04acf61514c4736c41e2c972efd1eb95502ddbdcde10621077edbc18d56e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for recall-sdk 0.2.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.

Release history Release notifications | RSS feed

This release

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