360 Secure SkillHub
360 安全技能中心

Quantum Agent Memory

面向 AI Agent 的记忆管理工具,用 QAOA 量子算法实现三层能力:记忆聚类、压缩(从 M 条中选留 K 条)与召回(寻找协同组合),材料称其效果优于经典贪心与 Top-K 检索;提供基准测试,可选对接 QMG 实例与 IBM Quantum 硬件,需 Python 3.10+ 与 Qiskit。

dustin-a11y
dustin-a11y
热度 56.53
最近更新 2026-05-30 09:51:19
分类:知识依赖:代码执行 / 第三方 API应用场景:数据处理 / 研究 / 笔记整理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add quantum-agent-memory
Metadata
name
quantum-agent-memory
title
Quantum Agent Memory
description
QAOA-powered memory optimization for AI agents. Three quantum layers: clustering, compaction, and recall. Integrates with QMG v1.2 for chunked gte-large retrieval. Uses Qiskit for IBM Quantum hardware.
tags
["quantum","qaoa","memory","agents","qiskit","ibm","compaction","clustering","retrieval"]

Quantum Agent Memory

QAOA-powered memory management for AI agents. Three quantum layers replace classical heuristics for clustering, compaction, and recall.

Companion to Quantum Memory Graph (QMG) v1.2 — #1 on LongMemEval (98.6% R@5).

Three Quantum Layers

Layer 1: Clustering

Group N memories into coherent clusters via balanced graph-cut QAOA.

  • Cost matrix: temporal (25%), relational (30%), categorical (25%), recency (20%)
  • 100% optimal for n≤14, speed crossover at n=20

Layer 2: Compaction

Select optimal K memories to keep from M total.

  • Maximizes coverage + coherence + value + recency with budget penalty
  • Beats greedy selection by ~1% consistently

Layer 3: Recall

Find the best K memories for a query — optimizes for synergy, not just individual relevance.

  • Finds memory combinations that Top-K similarity search misses
  • Individual relevance (40%) + pairwise synergy (30%) + diversity (20%) + recency (10%)

Quick Start

git clone https://github.com/Dustin-a11y/quantum-agent-memory.git
cd quantum-agent-memory
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python -m quantum_agent_memory benchmark

Integration with QMG v1.2

Point the benchmark at a live QMG instance:

python -m quantum_agent_memory benchmark --qmg-url http://localhost:8503

For OpenClaw agent integration, see references/openclaw-plugin.md.

IBM Quantum Hardware

Submit circuits to real IBM quantum processors:

pip install qiskit-ibm-runtime
python -m quantum_agent_memory submit --ibm-token YOUR_TOKEN

Benchmarking

Run the full 3-layer benchmark:

python -m quantum_agent_memory benchmark

Expected output:

  • Clustering: ~98-100% optimal
  • Compaction: 100% optimal
  • Recall: 100% optimal, quantum finds synergistic combos Top-K misses
  • Avg accuracy: ~99.7%

Requirements

  • Python 3.10+
  • Qiskit 2.0+
  • qiskit-aer (simulation)
  • numpy

Optional:

  • qiskit-ibm-runtime (real hardware)
  • sentence-transformers (embeddings)