Skip to main content

CueMap Python SDK - High-performance temporal-associative memory

Project description

CueMap Python SDK

High-performance temporal-associative memory store that mimics the brain's recall mechanism.

Overview

CueMap implements a Continuous Gradient Algorithm inspired by biological memory:

  1. Intersection (Context Filter): Triangulates relevant memories by overlapping cues
  2. Pattern Completion (Associative Recall): Automatically infers missing cues from co-occurrence history, enabling recall from partial inputs.
  3. Recency & Salience (Signal Dynamics): Balances fresh data with salient, high-signal events prioritized by the Amygdala-inspired salience module.
  4. Reinforcement (Hebbian Learning): Frequently accessed memories gain signal strength, staying "front of mind".
  5. Autonomous Consolidation: Periodically merges overlapping memories into summaries, mimicking systems consolidation.

Installation

pip install cuemap

Quick Start

1. Start the Engine

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

2. Basic Usage

from cuemap import CueMap

client = CueMap()

# Add a memory (auto-cue generation by default using internal Semantic Engine)
client.add("The server password is abc123")

# Recall by natural language (resolves via Lexicon)
results = client.recall("server credentials")
print(results[0].content)
# Output: "The server password is abc123"

Core API

Add Memory

# Manual cues
client.add(
    "Meeting with John at 3pm",
    cues=["meeting", "john", "calendar"]
)

# Auto-cues (Semantic Engine)
client.add("The payments service is down due to a timeout")

Recall Memories

# Natural Language Search (Brain-Inspired)
results = client.recall(
    "payments failure",
    limit=10,
    explain=True # See how the query was expanded
)

print(results[0].explain)
# Shows normalized cues, expanded synonyms, etc.

# Explicit Cue Search
results = client.recall(
    cues=["meeting", "john"],
    min_intersection=2
)

Grounded Recall (Hallucination Guardrails)

Get verifiable context for LLMs with a strict token budget.

response = client.recall_grounded(
    query="Why is the payment failing?",
    token_budget=500
)

print(response["verified_context"])
# [VERIFIED CONTEXT] ...
print(response["proof"])
# Cryptographic proof of context retrieval

Context Expansion (v0.6.1)

Explore related concepts from the cue graph to expand a user's query.

response = client.context_expand("server hung 137", limit=5)
# {
#   "query_cues": ["server", "hung", "137"],
#   "expansions": [
#     { "term": "out_of_memory", "score": 25.0, "co_occurrence_count": 12 },
#     { "term": "SIGKILL", "score": 22.0, "co_occurrence_count": 8 }
#   ]
# }

Cloud Backup (v0.6.1)

Manage project snapshots in the cloud (S3, GCS, Azure).

# Upload current project snapshot
client.backup_upload("default")

# Download and restore snapshot
client.backup_download("default")

# List available backups
backups = client.backup_list()

Ingestion (v0.6+)

Ingest content from various sources directly.

# Ingest URL
client.ingest_url("https://example.com/docs")

# Ingest File (PDF, DOCX, etc.)
client.ingest_file("/path/to/document.pdf")

# Ingest Raw Content
client.ingest_content("Raw text content...", filename="notes.txt")

Lexicon Management (v0.6+)

Inspect and wire the brain's associations manually.

# Inspect a cue's relationships
data = client.lexicon_inspect("service:payment")
print(f"Synonyms: {data['outgoing']}")
print(f"Triggers: {data['incoming']}")

# Manually wire a token to a concept
client.lexicon_wire("stripe", "service:payment")

# Get synonyms via WordNet
synonyms = client.lexicon_synonyms("payment")

Job Status (v0.6+)

Check the progress of background ingestion tasks.

status = client.jobs_status()
print(f"Ingested: {status['writes_completed']} / {status['writes_total']}")

Advanced Brain Control

Disable specific brain modules for deterministic debugging.

results = client.recall(
    "urgent issue",
    disable_pattern_completion=True,    # No associative inference
    disable_salience_bias=True,         # No emotional weighting
    disable_systems_consolidation=True, # No gist summaries
    disable_temporal_chunking=True      # No episodic grouping
)

Async Support

from cuemap import AsyncCueMap

async with AsyncCueMap() as client:
    await client.add("Note")
    await client.recall(["note"])

Performance

  • Write Latency: ~2ms (O(1) complexity)
  • Read Latency: ~5-10ms (Raw vs Smart Recall)

License

MIT

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

cuemap-0.6.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

cuemap-0.6.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file cuemap-0.6.2.tar.gz.

File metadata

  • Download URL: cuemap-0.6.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for cuemap-0.6.2.tar.gz
Algorithm Hash digest
SHA256 a540535fa8b3589fbbaa72441415edf3b2b6f498d7f123b218d1b287332f3f58
MD5 dd2b75b2e8a8b0e2086950a2df8c2935
BLAKE2b-256 9ca60c2547f2d6a7817fb17815db8eb3c878ead3e959e81f6487e7cbcfef34df

See more details on using hashes here.

File details

Details for the file cuemap-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: cuemap-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for cuemap-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bacc880cc11b0027db63d9a56039b6a9949b9210e99366dbd96bd5544822086
MD5 1fb83c7c9b4cc41526ee9fc595ce79df
BLAKE2b-256 8d0ba1d5edb5279eebbcb34025039a016982e6d0eaa61f537d294d6b412936d8

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