← 返回
未分类 Key 中文

agentMemo

agentMemo is a Semantic Memory Mesh server for AI agents. Use this skill when you need to store, search, or retrieve agent memory across sessions with semant...
agentMemo 是一个面向 AI 代理的语义记忆网格服务器。当需要跨会话存储、搜索或检索代理记忆时使用此技能,进行语义检索。
yxjsxy
未分类 clawhub v3.2.2 1 版本 100000 Key: 需要
★ 0
Stars
📥 343
下载
💾 0
安装
1
版本
#latest

概述

agentMemo — Semantic Memory Mesh

FastAPI-based memory server with HNSW embeddings, hybrid search, versioning, RBAC, and real-time event bus for AI agents.

Prerequisites

  • Python 3.12+ and pip
  • AGENTMEMO_ADMIN_KEY environment variable (required, secret) — the server refuses to start without it
  • Network access on first run: the embedding model (all-MiniLM-L6-v2, ~90MB) is downloaded from HuggingFace on first startup and cached locally at ~/.cache/torch/sentence_transformers/

Install

pip install -r requirements.txt

This installs FastAPI, uvicorn, sentence-transformers, hnswlib, aiosqlite, and other dependencies. Review requirements.txt before running. Prefer installing inside a virtualenv or container.

Required Environment Variables

VariableRequiredSecretDefaultDescription
--------------------------------------------------
AGENTMEMO_ADMIN_KEYyesyesAPI key for RBAC auth. Server exits if unset.
AGENTMEMO_PORTnono8790HTTP port (localhost only)
AGENTMEMO_DBnonoagentmemo.dbSQLite DB path
AGENTMEMO_RATE_LIMITnono120Requests/min per key
AGENTMEMO_POOL_SIZEnono5DB connection pool size

Start

export AGENTMEMO_ADMIN_KEY="your-secret-key"
python server.py

The server binds to 127.0.0.1:8790 (localhost only). For networked deployments, use a reverse proxy with TLS + auth. Never expose port 8790 to the internet directly.

Security

  • Auth is mandatory: server refuses to start without AGENTMEMO_ADMIN_KEY
  • All endpoints require X-API-Key header (except /health)
  • Localhost binding by default: only accessible from the local machine
  • First-run network activity: downloads embedding model (~90MB) from HuggingFace; subsequent starts use local cache

Quick Reference

Store

curl -X POST http://localhost:8790/v1/memories \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: your-secret-key' \
  -d '{"text": "User prefers dark mode", "namespace": "prefs", "tags": ["ui"], "importance": 0.9}'

Search

curl -H 'X-API-Key: your-secret-key' \
  'http://localhost:8790/v1/memories/search?q=dark+mode&mode=hybrid&tags=ui'

Python Client

from client import AgentMemoClient
memo = AgentMemoClient("http://localhost:8790", api_key="your-secret-key")
memo.store("Decision: use PostgreSQL", namespace="arch", tags=["db"], importance=0.8)
results = memo.search("database choice", mode="hybrid")

Batch API

curl -X POST http://localhost:8790/v1/memories/batch \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: your-secret-key' \
  -d '{"operations": [{"op": "create", "text": "fact A"}, {"op": "create", "text": "fact B"}]}'

Versioning & Rollback

curl -H 'X-API-Key: your-secret-key' http://localhost:8790/v1/memories/{id}/versions
curl -X POST -H 'X-API-Key: your-secret-key' \
  http://localhost:8790/v1/memories/{id}/rollback -d '{"version": 2}'

API Endpoints

MethodPathDescription
---------------------------
GET/healthHealth check (no auth)
GET/metricsServer metrics
GET/dashboardWeb dashboard
POST/v1/memoriesStore memory
GET/v1/memories/searchSearch (semantic/keyword/hybrid)
PUT/v1/memories/{id}Update (creates new version)
DELETE/v1/memories/{id}Delete
GET/v1/memories/{id}/versionsVersion history
POST/v1/memories/{id}/rollbackRollback to version
POST/v1/memories/batchBatch operations
POST/v1/importBulk import
GET/v1/exportBulk export
GET/v1/events/streamSSE event stream
WS/v1/wsWebSocket stream

Key Features

  • Hybrid Search: RRF fusion of semantic (HNSW cosine) + keyword (BM25-style)
  • Importance Decay: score = importance × 0.5^(age/half_life) — older memories fade naturally
  • Versioning: Every update creates a new version; full rollback support
  • RBAC: Namespace isolation + API key access control
  • Event Bus: SSE + WebSocket for real-time agent-to-agent notifications
  • Dashboard: Web UI at /dashboard for browsing and searching memories

版本历史

共 1 个版本

  • v3.2.2 当前
    2026-05-07 09:56 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,069 📥 803,659
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,828
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,221 📥 267,204