Skip to main content

A pluggable memory layer for LLM apps

Project description

Recall

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 such as OpenAI, Groq, Together.ai, and OpenRouter.


Installation

pip install recall-sdk

For development:

git clone https://github.com/yourusername/recall
cd recall
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Quickstart

from recall import MemoryStore, handle_user_message, serialize_for_openai
from openai import OpenAI

# Initialize your LLM client (OpenAI, Groq, etc.)
client = OpenAI(api_key="sk-...")

def llm_call(prompt, system_prompt=None):
    messages = []
    if system_prompt:
        messages.append({"role": "system", "content": system_prompt})
    messages.append({"role": "user", "content": prompt})

    response = client.chat.completions.create(model="gpt-4", messages=messages)
    return response.choices[0].message.content.strip()

# Memory setup
store = MemoryStore()
user_id = "user-001"

# Extract and store memory from user input
handle_user_message(user_id, "I'm allergic to peanuts", store, llm_call)

# Retrieve and inject memory into prompt
memories = store.search_memories(user_id, min_importance=0.4)
system_prompt = serialize_for_openai(memories)

# Generate response with context
response = llm_call("What should I eat?", system_prompt)
print(response)

Features

Automatic memory extraction from user input using an LLM

Persistent memory store with TTL, importance, tags, and embeddings

Relevance-based memory search and filtering

Prompt injection for OpenAI-compatible APIs

Works with any model that supports OpenAI's chat API format

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recall_sdk-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recall_sdk-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file recall_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: recall_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for recall_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ce3858c2181a8d727903f965b3045019849314b2f1710568725ce5a0ca872d5
MD5 c237989e58be582bf8b7a5a931bb2ea4
BLAKE2b-256 ecd46de0fa8f7fbf588197d2c86b7e7c6c16a528a660eab492435d9e87518672

See more details on using hashes here.

File details

Details for the file recall_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: recall_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for recall_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 654d63191f3253e4e81629a369559ef6c2f752a94b00c435b169fa946deff721
MD5 5edde92099eeaf79ab8e8ff8e87459c0
BLAKE2b-256 05c96a4ababdd14255956ba2d951b5df8a3c5f78dd219d6c72fe3f8d83a03809

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page