CueMap

Redis for AI Agents

Temporal-associative memory that combines recency, intersection, and reinforcement to retrieve the right context at the right time.

$ pip install cuemap
$ npm install cuemap
$ docker run -p 8080:8080 cuemap/engine:latest

The Problem

Vector Databases

Best for: Semantic search, exploration

  • • Semantic similarity-based retrieval
  • • Great for finding related content
  • • Time-agnostic by design
  • • Requires embedding models

Redis

Best for: Key-value storage, caching

  • • Simple key-value operations
  • • Excellent for caching
  • • Single-key lookups
  • • Manual multi-dimensional filtering

CueMap

Best for: AI agent memory, state management

  • • Multi-dimensional cue intersection
  • • Built-in temporal ordering
  • • Reinforcement-based ranking
  • • ~4ms P99 at 10M scale

The Insight

"Your brain doesn't do semantic search when you recall your password. It uses cues (server + password) to retrieve the most recent memory."

CueMap mimics this mechanism:

1

Intersection

Memories matching multiple cues rank higher

2

Recency

Recent memories are more accessible

3

Reinforcement

Frequently accessed memories stay "front of mind"

When to Use CueMap

You need multi-dimensional filtering (User + Topic + Version + Time)
You want recency-aware retrieval without manual sorting
You need sub-5ms latency at scale
You want explicit, predictable results over fuzzy similarity

If this sounds right → pip install cuemap or npm install cuemap

1. Hallucination-Proof Slot Filling

Building a booking agent that needs to track the current destination

User: "I want to go to Paris."
User: "Actually, make that London."
User: "But keep the dates from the Paris trip."

Vector DB Challenge

Semantic search may return "Paris" due to high similarity scores, even though "London" is the current intent.

Redis Challenge

Simple key-value overwrites lose history. You'd need manual versioning with ZSETs.

CueMap Solution

client.add("London", cues=["session_123", "destination"])

# Get current destination (0.3ms, deterministic)
current = client.recall(["session_123", "destination"])[0]
# → Returns "London" (latest state)

# History is preserved for context
history = client.recall(["session_123", "destination"], limit=10)
# → ["London", "Paris", ...]

Acts like a version-controlled variable store

2. Context-Window Optimizer

Coding copilot needs exact documentation chunk, not 20 similar ones

Vector DB Challenge

May return multiple similar chunks (deprecated, advanced, basic versions), requiring post-processing.

Redis Challenge

Multi-dimensional filtering requires complex ZSET intersections and manual management.

CueMap Solution

# Surgical extraction at intersection of 4 dimensions
docs = client.recall([
    "pandas",
    "read_csv", 
    "v2.0",
    "beginner_friendly"
])

# Returns EXACTLY the right chunk
# Sorted by latest documentation update
# Zero token waste

This isn't search. It's surgical extraction.

3. Real-Time Personalized Feed

"What happened in Project X while I was sleeping?"

Vector DB Challenge

Embedding-based search adds latency. Not ideal for real-time, high-frequency queries.

Redis Challenge

LPUSH works for simple feeds, but filtering requires fetching all items or complex ZSET operations.

CueMap Solution

# User refreshes feed
feed = client.recall([
    "project_x",
    "urgent",
    "user_mention_tom"
], limit=10)

# Intersection: Only items matching ALL tags
# Recency: Pre-sorted by time
# Speed: Renders in 1ms

CueMap is a personalized feed engine out of the box

Performance

~4ms
P99 Latency at 10M scale
~5GB
RAM for 10M memories
700+
Queries/sec at 10M scale
100%
Recall Correctness

CueMap excels at multi-dimensional, time-aware queries where explicit cue intersection matters more than semantic similarity.

Quick Start

Python

pip install cuemap
from cuemap import CueMap

client = CueMap()

# Add with explicit cues
client.add(
    "Server password is abc123",
    cues=["server", "password", "credentials"]
)

# Recall by cues
results = client.recall(["server", "password"])
print(results[0].content)
# → "Server password is abc123"

TypeScript

npm install cuemap
import CueMap from 'cuemap';

const client = new CueMap();

// Add with explicit cues
await client.add(
    "Server password is abc123",
    ["server", "password", "credentials"]
);

// Recall by cues
const results = await client.recall(["server", "password"]);
console.log(results[0].content);
// → "Server password is abc123"

Docker

docker run -p 8080:8080 cuemap/engine:latest

Or from source:

git clone https://github.com/cuemap-dev/engine
cd engine
cargo build --release
./target/release/cuemap-rust