Skip to main content

An AI Work Reuse Engine — remember expensive AI work and reuse it intelligently.

Project description

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.

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

remem_ai-1.0.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

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

remem_ai-1.0.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file remem_ai-1.0.0.tar.gz.

File metadata

  • Download URL: remem_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for remem_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 14463c9549fdc44e5ca6c78975d3c7679488f8d90ceec3da20d0756465d1be96
MD5 d3967879129df80523b8d1cca4504d22
BLAKE2b-256 8e905006630d37daba4fc5e9b86fe76d798ad744d61ff81ade6dfdee93879ec0

See more details on using hashes here.

File details

Details for the file remem_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: remem_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for remem_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44812fdff3c888c3186aa10666743167b9702247494aa8888b6f1f730da03643
MD5 b2ad0f9020d6058de206b5b562f02e78
BLAKE2b-256 29da5139c4ebc8d130b98a4c197c22f0d1445042da8718cffc155bc9e6787630

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