Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Quantum Memory Graph

v0.4.0

Quantum-optimized memory retrieval for AI agents. Use when building agent memory systems, replacing Mem0/LangChain memory, or needing relationship-aware reca...

0· 107· 1 versions· 0 current· 0 all-time· Updated 12h ago· MIT-0

Install

openclaw skills install quantum-memory

Quantum Memory Graph

Relationship-aware memory for AI agents. Knowledge graphs + quantum-optimized subgraph selection (QAOA).

When to Use

  • Building or upgrading an AI agent's memory system
  • Replacing flat similarity search (Mem0, LangChain memory, raw vector DB)
  • Need memories that work together as connected context, not isolated matches
  • Want recency-aware retrieval (recent memories rank higher)

Install

pip install quantum-memory-graph

For high-accuracy mode (needs ~2GB RAM, GPU recommended):

pip install quantum-memory-graph
# Then use model="thenlper/gte-large" — 96.6% R@5

Quick Start

from quantum_memory_graph import store, recall

# Store memories — automatically builds knowledge graph
store("Project Alpha uses React frontend with TypeScript.")
store("Project Alpha backend is FastAPI with PostgreSQL.")
store("FastAPI connects to PostgreSQL via SQLAlchemy ORM.")

# Recall — graph traversal + QAOA finds the optimal combination
result = recall("What is Project Alpha's full tech stack?", K=4)
for memory in result["memories"]:
    print(f"  {memory['text']}")

Model Selection

Read references/models.md for full comparison table.

  • Default (all-MiniLM-L6-v2): 90MB, no GPU, 93.4% R@5. Use for laptops/CI.
  • High accuracy (thenlper/gte-large): 1.3GB, GPU recommended, 96.6% R@5.
from quantum_memory_graph import MemoryGraph
mg = MemoryGraph(model="thenlper/gte-large")

Short-Term Memory (v0.4.0+)

Recency boost is ON by default. Recent memories score higher automatically.

from quantum_memory_graph import store, recall, get_stm

store("User prefers dark mode")  # Gets recency boost

# Track conversation context
stm = get_stm()
stm.conversation.add_turn("What are preferences?", memory_ids=["m1"])

Three layers:

  • Recency: +0.3 last hour, +0.15 last day, +0.05 last week
  • Working memory: Last 20 memories always available
  • Conversation context: Current topic gets priority

Deploy as Microservice

pip install quantum-memory-graph[api]
python -m quantum_memory_graph.api --port 8502

Endpoints: POST /store, POST /recall, POST /store-batch, GET /stats

Multiple agents share one API server. See references/deployment.md for migration guide.

Migrate from Mem0

from quantum_memory_graph import store
for memory in existing_memories:
    store(memory["text"], metadata=memory.get("metadata"))
# Graph connections built automatically

IBM Quantum Hardware

pip install quantum-memory-graph[ibm]
export IBM_QUANTUM_TOKEN=your_token

Runs QAOA on real quantum hardware (validated on ibm_fez, ibm_kingston).

Version tags

agentsvk976p7jzah8rqqwe674t75exm984fdb6knowledge-graphvk976p7jzah8rqqwe674t75exm984fdb6latestvk976p7jzah8rqqwe674t75exm984fdb6memoryvk976p7jzah8rqqwe674t75exm984fdb6quantumvk976p7jzah8rqqwe674t75exm984fdb6