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.0b1.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.0b1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: remem_ai-1.0.0b1.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.0b1.tar.gz
Algorithm Hash digest
SHA256 977947972e944c1e5970fbb5d9f5a27c5ee0f732094bbe18e86658e7be23b13a
MD5 d2755c2905979e2fccce223be5ef3fc9
BLAKE2b-256 d7b1780fd701b8ad542170426b2684b19bd03847b7c38b495d0831c87053e9c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: remem_ai-1.0.0b1-py3-none-any.whl
  • Upload date:
  • Size: 28.7 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.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a3d82d6b61ec5d950751eb0139bebfa0bdfce780accc2ff16abd021d8e5ef80
MD5 1559261235b5666985e1ed01a87c09b1
BLAKE2b-256 ea0ee71689928e7451b79df31e99af17a9200d337db4af76666de6dbff1a33de

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