Skip to main content

Remem

Remember expensive AI work. Reuse it intelligently.

An AI-native work reuse engine for RAG pipelines, AI agents, and LLM applications

Python Version License PyPI

Quickstart · API Reference · Architecture · Benchmarks · Roadmap · FAQ


Overview

Modern AI applications repeatedly execute expensive operations — vector database searches, LLM calls, tool executions, reranking passes — for requests that are often semantically identical or very similar to ones already served.

Remem sits between your application and its expensive AI operations. It observes what has already been computed, and for each new request it determines the highest level of previous work that can be safely reused — based on semantic similarity, not exact key matching.

User asks: "What is our company's vacation policy?"
User asks: "How many paid leaves do employees get?"   <-- Remem reuses the first answer
User asks: "What are the PTO rules?"                  <-- Remem reuses the first answer

Why Not Just Use Redis?

Redis answers: "Have I seen this exact key before?" Remem answers: "Have I already done similar expensive AI work before?"

Redis Remem
Matching strategy Exact key Semantic similarity (embeddings)
Scope Key-value lookup Full AI pipeline reuse
Deployment Separate service Python library — import and go
AI-aware No Yes — understands embeddings, models, and prompts

How It Works

Remem makes a three-way decision for every incoming request, based on how similar it is to work that has already been done:

Decision When it happens Effect
Full reuse The request is nearly identical to a past one The cached response is returned immediately — no vector search, no LLM call
Partial reuse The request is related, but not identical Cached retrieval results are reused; only the generation step re-runs
Miss Nothing sufficiently similar has been seen The full pipeline runs, and the result is stored for next time

Similarity is only ever compared between compatible executions — Remem is aware of concepts like namespace, knowledge-base version, and model, so updating your data or switching models never results in stale or incorrect reuse.

For the full decision model, thresholds, and configuration options, see the Architecture guide and API Reference.

Features

  • Three-level reuse engine — full response reuse, partial retrieval reuse, or a clean miss
  • Semantic similarity matching — cosine similarity over embedding vectors, no exact-match required
  • Context-aware filtering — namespace, knowledge-base version, prompt version, and model constraints are respected before anything is reused
  • Configurable reuse policy — tune thresholds and constraints to match your application
  • Durable persistence — a file-backed store that survives process restarts, with atomic writes
  • In-memory mode — zero-disk-I/O storage for tests, notebooks, and short-lived jobs
  • Pluggable storage — bring your own backend (Redis, Postgres, S3, or anything else)
  • Built-in telemetry — hit rate, reuse breakdown, and average similarity, out of the box
  • Minimal footprint — a single runtime dependency (numpy)

Installation

Requirements: Python 3.10 or later.

pip install remem-ai

Remem has a single runtime dependency (numpy), which is installed automatically.

Installing from source
git clone https://github.com/harshvardhansingh7/remem.git
cd remem
pip install -e ".[dev]"    # editable install with pytest and ruff

Quickstart

from remem import Client, ExecutionResult

client = Client()   # durable persistence by default

def my_pipeline():
    docs = search_vector_db(query)
    answer = call_llm(query, docs)
    return ExecutionResult(response=answer, references=docs)

outcome = client.get_or_compute(
    query_embedding=embed(query),
    compute_callback=my_pipeline,
)

print(outcome.result)   # cached or freshly computed — Remem decides

New to Remem? Start with the 5-minute Quickstart. For the complete method-by-method reference, see the API Reference.

Documentation

Guide Description
Quickstart Get a working integration in under five minutes
API Reference Every class, method, and configuration option
Architecture How Remem is designed internally
Benchmarks What Remem measures and why
Roadmap Where the project is headed
FAQ Common questions
Troubleshooting Fixes for common issues

Contributing

Contributions are welcome. As the project is in beta, architecture discussions and design feedback are especially valuable. Please read CONTRIBUTING.md before opening issues or pull requests.

License

Licensed under the Apache License 2.0.

Author

Harshvardhan Singh — building Remem as an open-source AI infrastructure project to explore distributed systems, storage engines, and high-performance backend engineering.

If this project is useful to you, consider giving it a star and following its progress.


⭐ Star the repository if you find Remem useful.

Metadata

Release files for remem-ai 1.0.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 remem-ai 1.0.0
File Size Uploaded Provenance Actions
remem_ai-1.0.0.tar.gz 27.1 kB Without provenance Details for remem_ai-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for remem-ai 1.0.0
File Interpreter ABI Platform Actions
remem_ai-1.0.0-py3-none-any.whl Python 3 none any Details for remem_ai-1.0.0-py3-none-any.whl

Total release size: 55.7 kB

Release files / remem_ai-1.0.0.tar.gz

Download URL remem_ai-1.0.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
14463c9549fdc44e5ca6c78975d3c7679488f8d90ceec3da20d0756465d1be96
BLAKE2b-256 checksum
How to use checksums
8e905006630d37daba4fc5e9b86fe76d798ad744d61ff81ade6dfdee93879ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / remem_ai-1.0.0-py3-none-any.whl

Download URL remem_ai-1.0.0-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44812fdff3c888c3186aa10666743167b9702247494aa8888b6f1f730da03643
BLAKE2b-256 checksum
How to use checksums
29da5139c4ebc8d130b98a4c197c22f0d1445042da8718cffc155bc9e6787630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for remem-ai 1.0.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.

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