← 返回 Skills 市场
escapethefate1991

Engram Memory

作者 engram · GitHub ↗ · v2.1.0 · MIT-0
cross-platform ⚠ suspicious
170
总下载
0
收藏
0
当前安装
11
版本数
在 OpenClaw 中安装
/install engrammemory
功能描述
Persistent semantic memory for AI agents. Store, search, recall, and forget memories across sessions using Qdrant + FastEmbed.
使用说明 (SKILL.md)

Engram for OpenClaw Agents

Persistent semantic memory that makes your agent remember across sessions.

What This Provides

Instead of starting fresh every session, your agent will:

  • Remember your preferences, facts, and past decisions
  • Automatically recall relevant context for new conversations
  • Search through stored memories semantically
  • Categorize and organize knowledge by type

Quick Start

# Install the skill
clawhub install engrammemory

# Setup (requires Docker — deploys Qdrant + FastEmbed)
bash scripts/setup.sh

# Store a memory
memory_store "I prefer direct communication style" --category preference

# Search memories
memory_search "communication preferences"

Core Functions

memory_store(text, category, importance)

Save information to long-term memory with semantic embedding.

# Save preferences
memory_store("User prefers TypeScript over JavaScript for new projects", 
            category="preference", importance=0.8)

# Save facts  
memory_store("Database migration completed on 2024-03-15, moved from SQLite to PostgreSQL",
            category="fact", importance=0.7)

# Save decisions
memory_store("Decided to use React Query for state management in the frontend",
            category="decision", importance=0.9)

memory_recall(query, limit, category)

Search stored memories using semantic similarity.

# Find relevant memories
memory_recall("database migration")
memory_recall("frontend preferences", category="preference")
memory_recall("recent decisions", limit=10)

memory_profile(action, key, value, category)

Manage user profile data (static preferences + dynamic context).

# View profile
memory_profile("view")

# Add static preference  
memory_profile("add", "communication_style", "Direct, no fluff", "static")

# Add dynamic context
memory_profile("add", "current_project", "Building memory system", "dynamic")

memory_forget(query, memory_id)

Remove memories by search or specific ID.

memory_forget("old project requirements")
memory_forget(memory_id="uuid-string")  

Memory Categories

  • preference — User preferences, communication style, technical choices
  • fact — Objective information, system states, completed work
  • decision — Important decisions made, rationale, outcomes
  • entity — People, projects, organizations, relationships
  • other — Miscellaneous information that doesn't fit above

Context System

Engram includes a context management system that gives your agent structured knowledge about any codebase. Initialize a project, and your agent can search and query its architecture, patterns, and APIs.

Context Commands

engram-context — Core Management

# Initialize context for a project
engram-context init /path/to/project --template web-app
engram-context init /path/to/project --template python-api
engram-context init /path/to/project --template generic

# Build search index
engram-context index

# Search context files
engram-context find "authentication patterns"

# Check status
engram-context status

engram-ask — Natural Language Queries

engram-ask "How does authentication work?"
engram-ask "Where are the API endpoints defined?"
engram-ask interactive

engram-semantic — Embedding-Based Search

engram-semantic find "user login process"
engram-semantic index
engram-semantic status

Project Templates

Template Best for
web-app Full-stack web apps (React/Vue + Node/Python + DB)
python-api Python API servers (FastAPI, Django)
generic Any project type

Context Structure

Each project gets a .context/ directory:

.context/
├── metadata.yaml       # Project configuration
├── architecture.md     # System architecture
├── patterns.md         # Code patterns and standards
├── apis.md             # API documentation
├── development.md      # Development workflows
├── troubleshooting.md  # Common issues and solutions
└── index.db            # Search index (auto-generated)

All context queries are scoped to the current project.

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   OpenClaw      │    │  FastEmbed      │    │     Qdrant      │
│   Agent         │───▶│  nomic-embed    │───▶│  Vector Store   │
│                 │    │  text-v1.5      │    │  Port 6333      │
└─────────────────┘    └─────────────────┘    └─────────────────┘

Components:

  • Qdrant — Vector database for semantic storage/search
  • FastEmbed — Local embedding model (nomic-embed-text-v1.5)
  • Plugin — OpenClaw integration with auto-recall and capture

Installation

Prerequisites

  • OpenClaw 2026.3.13+
  • Docker and docker-compose
  • 4GB+ RAM for embedding model
  • 10GB+ storage for vector database

Automated Setup

# 1. Install the skill
clawhub install engrammemory

# 2. Run setup script  
cd ~/.openclaw/workspace/skills/engrammemory
bash scripts/setup.sh

# 3. Follow the configuration prompts
# (The script will generate the exact config to add to openclaw.json)

# 4. Restart OpenClaw gateway
openclaw gateway restart

Manual Setup

If you prefer manual installation or need custom configuration:

  1. Deploy Qdrant + FastEmbed:

    # Copy docker-compose template
    cp config/docker-compose.yml ~/engram-stack/
    cd ~/engram-stack
    docker-compose up -d
    
  2. Configure OpenClaw plugin: Add to ~/.openclaw/openclaw.json:

    {
      "plugins": {
        "allow": ["engram"],
        "slots": {
          "memory": "engram"
        },
        "entries": {
          "engram": {
            "enabled": true,
            "config": {
              "qdrantUrl": "http://localhost:6333",
              "embeddingModel": "nomic-ai/nomic-embed-text-v1.5",
              "collection": "agent-memory", 
              "autoRecall": true,
              "autoCapture": true,
              "maxRecallResults": 5,
              "minRecallScore": 0.35,
              "embeddingUrl": "http://localhost:11435"
            }
          }
        }
      }
    }
    
  3. Restart gateway:

    openclaw gateway restart
    

Configuration Options

Option Default Description
qdrantUrl http://localhost:6333 Qdrant vector database URL
embeddingUrl http://localhost:11435 FastEmbed API endpoint
embeddingModel nomic-ai/nomic-embed-text-v1.5 Embedding model
collection agent-memory Memory collection name
autoRecall true Auto-inject relevant memories
autoCapture true Auto-save important context
maxRecallResults 5 Max memories per auto-recall
minRecallScore 0.35 Minimum similarity threshold
profileFrequency 20 Update profile every N messages
debug false Enable debug logging

Example Configuration

{
  "qdrantUrl": "http://localhost:6333",
  "embeddingUrl": "http://localhost:11435",
  "collection": "agent-memory",
  "autoRecall": true,
  "autoCapture": true
}

Multi-Agent Setup

For multiple agents sharing memory:

{
  "agents": {
    "list": [
      {
        "id": "main",
        "plugins": {
          "memory": {
            "collection": "main-agent-memory"
          }
        }
      },
      {
        "id": "coding-assistant", 
        "plugins": {
          "memory": {
            "collection": "coding-agent-memory"
          }
        }
      }
    ]
  }
}

Usage Examples

Research Assistant

# Save research findings
memory_store("Found that React 18 concurrent rendering improves performance by 15-30% for large lists", 
            category="fact", importance=0.8)

# Later, when discussing performance:
memories = memory_recall("React performance improvements")
# Auto-recalls the research finding

Project Manager

# Save project decisions
memory_store("Team decided to use PostgreSQL over MongoDB for better ACID compliance in financial app",
            category="decision", importance=0.9)

# Track preferences
memory_profile("add", "deployment_preference", "Docker with Kubernetes", "static")

# Later project planning auto-recalls relevant decisions and preferences

Customer Support

# Remember customer preferences
memory_store("Customer prefers email over phone calls for non-urgent issues",
            category="preference", importance=0.7)

# Track issue patterns
memory_store("Billing module API timeout issue affects 15% of enterprise customers",
            category="fact", importance=0.8)

Backup and Migration

Export Memory

# Export all memories as JSON
curl "http://localhost:6333/collections/agent-memory/points/scroll" \
  -H "Content-Type: application/json" \
  -d '{"limit": 10000}' > memory_backup.json

Import Memory

# Import memories from backup
# Re-import using memory_store
python scripts/memory_store.py --json '{"text": "...", "category": "fact"}'

Performance Tuning

Vector Quantization (New Feature)

Engram now includes automatic scalar quantization for 4x memory reduction with no recall loss:

  • Memory Usage: Reduces vector storage by ~75% (32-bit → 8-bit per dimension)
  • Search Speed: Unchanged (quantized vectors stay in RAM for fast search)
  • Quality: No degradation (99th percentile quantile preserves accuracy)
  • Automatic: Enabled by default in new installations
# Quantization is automatically applied when you run:
bash scripts/setup.sh

Technical Details:

  • Uses int8 scalar quantization with 99th percentile
  • Compresses 768-dimension vectors from ~3KB to ~768 bytes each
  • Enables storing 4x more memories in the same RAM
  • Fully compatible with existing memory collections

For Large Memory Sets (10K+ memories)

{
  "config": {
    "maxRecallResults": 3,
    "minRecallScore": 0.45,
    "autoCapture": false
  }
}

For High-Frequency Agents

{
  "config": {
    "profileFrequency": 50,
    "autoRecall": false
  }
}

Troubleshooting

Common Issues

Memory not persisting:

  • Check Qdrant is running: curl http://localhost:6333/collections
  • Verify plugin config in openclaw status

Poor recall quality:

  • Lower minRecallScore (try 0.25)
  • Check embedding model is loaded: curl http://localhost:11435/models

High memory usage:

  • Increase Docker memory limits
  • Reduce maxRecallResults
  • Enable auto-cleanup in config

Debug Mode

{
  "config": {
    "debug": true
  }
}

Enables detailed logging for memory operations.

Advanced Usage

Custom Categories

memory_store("Customer uses advanced React patterns", category="customer_tech_profile")
memory_recall("customer tech preferences", category="customer_tech_profile")

Importance-Based Filtering

# Only recall highly important memories  
memory_recall("project decisions", min_importance=0.8)

Time-Based Queries

# Recent memories (last 30 days)
memory_recall("recent changes", days_back=30)

Security Considerations

  • Local-first: All data stays on your infrastructure
  • No external APIs: Embeddings generated locally
  • Encryption: Use encrypted storage for sensitive data
  • Access control: Configure Qdrant authentication if needed

Contributing

Found a bug or want to add features?

  • GitHub: engram-memory-community
  • Issues: Report bugs and feature requests
  • Docs: Help improve documentation
  • Examples: Share usage patterns

License

MIT License - Use freely in personal and commercial projects.


Transform your agent from stateless to stateful. Install Engram today.

OpenClaw Integration

🟢 Fully Integrated - Engram is now available as native OpenClaw tools.

Available Tools

  • memory_search - Search memories using semantic similarity
  • memory_store - Store text with embeddings in long-term memory

How to Use

Once Engram is set up (FastEmbed service + Qdrant running), these tools are automatically available in OpenClaw sessions:

// Search stored memories
memory_search("FastEmbed integration status", 10, 0.3)

// Store new memories
memory_store("User prefers detailed explanations", "preference", 0.8)

Implementation

  • Plugin Type: Native Python plugin
  • Backend: FastEmbed (localhost:8000) + Qdrant (localhost:6333)
  • No MCP Server Required: Direct integration through OpenClaw's plugin system

See OPENCLAW_INTEGRATION.md for complete technical details.

安全使用建议
What to check before installing or running this skill: - Do not run setup scripts or docker-compose in a sensitive production environment until you audit them. The provided setup pulls Docker images (engrammemory/fastembed) from an external registry; pull/rebuild images locally from the included Dockerfile if you want to avoid running untrusted images. - Review scripts/setup.sh and docker-compose.yml to see exactly what containers and network ports will be created. Prefer running in an isolated VM or disposable machine the first time. - Inspect docker/fastembed/Dockerfile and the fastembed service code for any unexpected network calls or telemetry. The README claims 'no phone‑home', but confirm by grepping the repo for outbound HTTP requests and external domains (e.g., engrammemory.ai) before trusting it. - If you are concerned about privacy, disable autoCapture and autoRecall in the plugin config (set autoCapture=false and autoRecall=false) or limit them until you’re comfortable with behavior; check where conversation content is stored (Qdrant collection) and how retention/forgetting works. - Audit mcp/server.py and any server scripts for open network bindings; if you expose an MCP server, bind to localhost or restrict access via firewall. - If you lack the expertise to audit containers and Python/JS code, run the stack in an isolated environment (VM) and observe network egress (e.g., with a network monitor) to ensure nothing phones home. Taken together: the functionality matches the stated purpose, but because the skill will pull and run third‑party containers and can automatically persist conversation content into a local store, treat it as potentially risky until you've inspected or rebuilt the images and confirmed no unexpected external communications.
功能分析
Type: OpenClaw Skill Name: engrammemory Version: 2.1.0 The Engram skill bundle is a legitimate persistent semantic memory system for AI agents using Qdrant and FastEmbed. It includes robust features for memory storage, search, and automated context injection, with explicit security measures such as a credential scrubbing mechanism in `src/index.ts` to prevent the accidental storage of sensitive tokens or keys. The installation scripts (`scripts/setup.sh`) and plugin logic (`plugin.py`, `mcp/server.py`) follow standard practices for local-first AI tools, and the provided agent instructions in `docs/SOUL-RULES.md` are strictly aligned with the stated purpose of improving agent continuity and performance.
能力评估
Purpose & Capability
The name/description align with the repository contents: code, scripts, and docs implement a Qdrant + FastEmbed local memory system and an OpenClaw plugin that auto-recalls and auto-captures memories. Minor inconsistency: registry metadata lists this as instruction-only (no install spec) but the package includes many executables, Docker manifests, and server scripts — i.e., it's not purely instruction-only.
Instruction Scope
SKILL.md instructs the agent/operator to run scripts/setup.sh and docker-compose to deploy Qdrant and a FastEmbed service, to add the plugin to openclaw.json, and to enable autoRecall/autoCapture. Those instructions legitimately relate to the memory purpose, but the plugin's lifecycle hooks (before_agent_start/after_agent_response) mean the skill will automatically read conversation content and inject stored memories into agent context (privacy-sensitive behavior). The docs claim context queries are scoped to .context/, but the context tools also try to discover project roots and will read or index files under project directories when initialized.
Install Mechanism
There is no formal install spec in the registry, yet SKILL.md and scripts run a setup that uses docker-compose and will pull Docker images (notably engrammemory/fastembed:1.0.0). Pulling and running third‑party container images from an unverified/unknown publisher is higher risk because those images could run arbitrary code. The repo includes a Dockerfile for fastembed (suggesting you can rebuild), but the default docker-compose references published images.
Credentials
The skill does not request environment variables or cloud credentials in registry metadata. Runtime configuration is local URLs (qdrantUrl, embeddingUrl) and optional model names. This matches the stated local/self‑hosted design. However several scripts and services read config files and may respect environment variables if present (e.g., EMBEDDING_URL / MODEL_NAME) — nothing appears to require unrelated cloud credentials.
Persistence & Privilege
always:false (good). The plugin is designed to integrate into the agent lifecycle and, when enabled, will automatically recall memories before responses and capture conversation content after responses. That autonomous storage behavior is expected for a memory plugin but is privacy‑sensitive; combined with the fact that setup pulls and runs code (containers), it increases the potential blast radius if you haven't audited the code or images.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install engrammemory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /engrammemory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.0
OpenClaw plugin now routes through three-tier recall engine
v2.0.3
Fix point IDs for Qdrant compatibility, all three tiers verified
v2.0.2
Fix delete errors and empty hot-tier entries
v2.0.1
Fix content/text field compatibility in recall engine
v2.0.0
Three-tier recall engine: hot cache, multi-head hash index, vector search fallback
v1.1.0
Noise filtering, credential exclusion, structured context recall, graceful degradation
v1.0.4
Address security scan: pin Docker tag, add privacy docs, soften prompt language
v1.0.3
Trim requirements to plugin deps — Docker handles fastembed
v1.0.2
Handle systems without python3-venv
v1.0.1
Fix: setup.sh now creates venv and installs Python deps
v1.0.0
Initial release — persistent semantic memory for AI agents
元数据
Slug engrammemory
版本 2.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 11
常见问题

Engram Memory 是什么?

Persistent semantic memory for AI agents. Store, search, recall, and forget memories across sessions using Qdrant + FastEmbed. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 170 次。

如何安装 Engram Memory?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install engrammemory」即可一键安装,无需额外配置。

Engram Memory 是免费的吗?

是的,Engram Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Engram Memory 支持哪些平台?

Engram Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Engram Memory?

由 engram(@escapethefate1991)开发并维护,当前版本 v2.1.0。

💬 留言讨论