Skip to main content

Memory infrastructure for AI agents. Your Qdrant, your hardware, our intelligence.

Project description

engrammemory-ai

Memory infrastructure for AI agents. Your Qdrant, your hardware, our intelligence.

pip install engrammemory-ai

Quick Start

from engrammemory import Engram

client = Engram(
    api_key="eng_live_xxx",
    qdrant_url="http://localhost:6333"
)

# Store — embedded & deduplicated by Engram, stored in YOUR Qdrant
client.store("User prefers TypeScript and dark mode", category="preference")

# Search — three-tier recall (hot → hash → vector)
results = client.search("What does the user prefer?")
for r in results:
    print(f"[{r.tier}] {r.content} ({r.score:.2f})")

# Forget
client.forget("mem_abc123")

Why Engram?

Engram Mem0 Supermemory Zep
Data ownership Your Qdrant, your hardware Their cloud Their cloud Their cloud
Three-tier recall Hot → Hash → Vector Single-tier Single-tier Two-tier
Stateless intelligence Embeds + classifies, never stores Stores everything Stores everything Stores everything
Edge/fleet support Per-device agents, zone isolation No No Limited
Local-first + overflow Store locally, overflow to cloud Cloud only Cloud only Cloud only
Open community edition OpenClaw skill, full recall engine No Partial No

Three-Tier Recall

Every search flows through three tiers automatically:

results = client.search("database config")
for r in results:
    print(f"[{r.tier}] {r.content} ({r.score:.2f})")
    # [hot]    PostgreSQL 15 with read replicas (0.94)   — sub-ms, cached
    # [hash]   Migrated from MongoDB last quarter (0.81)  — O(1) LSH lookup
    # [vector] Old DB credentials in vault (0.67)         — full ANN fallback

Auto-Recall for Agent Prompts

# Inject relevant memories into your agent's system prompt
memories = client.recall("User is asking about their database setup")
system_prompt = f"You know: {', '.join(m.content for m in memories)}"

Async

from engrammemory import AsyncEngram

async with AsyncEngram(api_key="eng_live_xxx") as client:
    await client.store("User prefers TypeScript")
    results = await client.search("language preferences")

Multi-Agent / Fleet

# Each agent gets its own namespace
client = Engram(api_key="eng_live_xxx", project="icu-floor-3")

# Store with agent tracking
client.store("Patient allergic to penicillin", category="fact", agent="tablet-icu-3a")

# Search scoped to project
results = client.search("allergies", agent="tablet-icu-3a")

MiroFish Integration

Replace Zep with Engram in your MiroFish .env:

MEMORY_PROVIDER=engram
ENGRAM_API_KEY=eng_live_xxx
ENGRAM_QDRANT_URL=http://localhost:6333

API Reference

Constructor

Engram(
    api_key: str,                          # Your Engram API key
    qdrant_url: str = "http://localhost:6333",  # Your Qdrant instance
    base_url: str = "https://api.engrammemory.ai",
    collection: str = "agent-memory",
    project: str | None = None,            # Memory isolation namespace
    max_retries: int = 3,
    timeout: float = 30.0,
)

Methods

Method Description
store(content, category?, importance?, metadata?, agent?) Store a memory (embedded + deduplicated + compressed)
search(query, limit?, min_score?, category?, agent?) Three-tier recall: hot → hash → vector
recall(context, top_k?, agent?) Auto-inject relevant memories for agent prompts
get(memory_id) Get a specific memory by ID
forget(memory_id) Remove from all three tiers
forget_by_query(query) Forget memories matching a search
list(limit?, offset?, category?, agent?) List memories with filtering
health() Check Engram + Qdrant connectivity

Models

from engrammemory import Memory, SearchResult, StoreResult, HealthStatus
Model Fields
Memory id, content, category, metadata, created_at, access_count
SearchResult memory, score, tier ("hot", "hash", "vector")
StoreResult id, stored, deduplicated
HealthStatus status, qdrant_connected, version

Exceptions

from engrammemory import EngramError, AuthenticationError, RateLimitError, NotFoundError, ValidationError
Exception HTTP Code When
AuthenticationError 401 Invalid or missing API key
RateLimitError 429 Too many requests (auto-retries with Retry-After)
NotFoundError 404 Memory ID doesn't exist
ValidationError 400/422 Invalid request body
EngramError Other Base class for all errors

Community Edition

Don't need cloud? The community edition runs the full three-tier recall engine locally as an OpenClaw skill with no API dependency.

Links

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

engrammemory_ai-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

engrammemory_ai-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file engrammemory_ai-0.1.1.tar.gz.

File metadata

  • Download URL: engrammemory_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for engrammemory_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 420c61a34972a6267d6535d4fca0ec5075cb9216d236e6af9e6617a4d0749ed9
MD5 167fd491c11f90b6c0e74c8827f2257d
BLAKE2b-256 9a09b739e9eafde2f3a7e55e5afb0a173bec4456de6f460e9f51d8d74251790b

See more details on using hashes here.

File details

Details for the file engrammemory_ai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for engrammemory_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91e8706809f30ff2e254cdd8be67e08d788b7fe97249f3fa5baebdc13da1ce2b
MD5 3fa4e8b1add46cdff7546872cfbc4518
BLAKE2b-256 357747f46697ad683f9c4f5fa3a60bf846aafcfb678d9932384dfde5f61a778e

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