Skip to content

Repository files navigation

title Agent Shared Memory
type readme
agent hermes
created 2026-04-15
updated 2026-04-15
tags
readme
summary

Agent Shared Memory

A shared knowledge base system for multiple AI Agents, making experience sedimented, reusable, and evolvable.

中文 →


What is this?

Agent Shared Memory is a collective learning system designed for multiple AI Agents (Hermes, Kimi-CLI, Claude-Code, Codex-CLI, OpenClaw).

It is not just a note repository, but a complete workflow:

  • Check the wiki before acting — avoid repeating mistakes
  • Mandatory archiving after tasks — write reusable experience back to the shared vault
  • Automated health checks (lint) — monitor knowledge health with the 4-Signal model
  • Audit & feedback loop — Agents review each other and improve continuously

Core goal: Make the output of one task reusable in the next 10 tasks.


Architecture Overview

graph TB
    subgraph Agents
        H[Hermes<br/>Scheduler]
        K[Kimi-CLI<br/>Engineering]
        C[Claude-Code<br/>Refactor/Review]
        X[Codex-CLI<br/>Batch Fix]
        O[OpenClaw<br/>Browser Automation]
    end

    subgraph SharedMemory[Shared Memory Vault]
        direction TB
        SPEC[00-SPEC<br/>Specs & Constitution]
        SRC[01-Sources<br/>Raw Sources]
        ENT[02-Entities<br/>Entity Profiles]
        AGE[03-Agents<br/>Agent Profiles]
        TSK[04-Tasks<br/>Task Archives]
        KNL[05-Knowledge<br/>General Knowledge]
        OUT[06-Outputs<br/>Query Outputs]
        AUD[audit/<br/>Audits]
        LOG[log/<br/>Operation Logs]
        HOT[hot.md<br/>Hot Cache]
    end

    subgraph Tooling
        OBS[Obsidian CLI<br/>Unified R/W Interface]
        LINT[lint.py<br/>4-Signal Health Scan]
        TMP[_templates/<br/>Page Templates]
    end

    Agents <-->|obsidian CLI| OBS
    OBS --> SharedMemory
    SharedMemory --> LINT
    LINT -->|Graph Insights<br/>+ Audit| Agents
Loading

Directory Structure

Agent Shared Memory/
├── 00-SPEC/                    # Specs (read-only, Hermes maintains)
│   ├── PURPOSE.md              # Goals & scope
│   ├── AGENTS.md               # Collective constitution
│   ├── CONVENTIONS.md          # Naming, format, tag conventions
│   └── ONBOARDING-PROMPT.md    # Agent onboarding prompt template
├── 01-Sources/                 # Raw source summaries
├── 02-Entities/                # Entity / concept profiles
├── 03-Agents/                  # Capability boundaries & failure modes
│   ├── Hermes.md
│   ├── Kimi-CLI.md
│   ├── Claude-Code.md
│   ├── Codex-CLI.md
│   └── OpenClaw.md
├── 04-Tasks/                   # Task archives (one subdir per task)
├── 05-Knowledge/               # Distilled general knowledge
│   ├── Pitfalls/               # Technical deep pits
│   ├── Protocols/              # Process protocols
│   └── Patterns/               # Patterns & tricks
├── 06-Outputs/                 # Query output archives
│   └── queries/
├── 99-System/                  # System tools
│   └── lint.py                 # Automated health-check script
├── _templates/                 # Page templates (inbox / entity / concept / audit)
├── audit/                      # Open audit feedback
├── audit/resolved/             # Resolved audit feedback
├── log/                        # Daily operation logs
├── hot.md                      # Recent context hot cache
└── index.md                    # Vault index

Core Mechanisms

1. Two-Step Chain-of-Thought Ingest

After reading new material, copy-pasting raw text is forbidden. Agents must execute two steps:

  1. Step 1: Analysis — extract entities, concepts, connection points, contradictions
  2. Step 2: Generation — only write to the wiki when the Ingest Gate decides Direct Write

2. 4-Signal Health Model

lint.py scans weekly and outputs four health signals:

Signal Meaning Ideal
Coverage Type coverage No empty dirs
Freshness Avg page age < 30 days
Consistency frontmatter compliance 100%
Connectivity Orphan page rate < 10%

3. Graph Insights

lint.py outputs structural insights:

  • Surprising Connections: Bridge nodes (cross-domain hubs), Source overlap (related pages not linked)
  • Gaps: Agent blindspots, tag islands, undigested sources, stale tasks

When a major Gap is found, Deep Research is triggered by default to close the loop.

4. Audit Lifecycle

graph LR
    A[Create Audit] --> B{Hermes Triage}
    B -->|fix-typo| C[Fix directly]
    B -->|create-page| D[Agent claims]
    B -->|deep-research| E[Start Deep Research]
    B -->|skip| F[Close with reason]
    C --> G[Move to audit/resolved/]
    D --> G
    E --> G
    F --> G
Loading

Quick Start

Installation

  1. Install Obsidian (optional, for visual browsing)
  2. Install the obsidian CLI (required for all Agents to read/write):
    # Confirm installation
    which obsidian && obsidian version
    # Expected: /usr/local/bin/obsidian  1.12.x
  3. Clone or locate the vault:
    # Place the vault in a local folder or cloud-synced directory, e.g.:
    $HOME/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Agent Shared Memory

Configuration

All obsidian commands must specify the vault name:

vault="Agent Shared Memory"

Recommended environment variable:

export AGENT_SHARED_MEMORY_VAULT="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Agent Shared Memory"
python3 "$AGENT_SHARED_MEMORY_VAULT/99-System/lint.py"

Verify access (creates and deletes a test file automatically):

obsidian create name="agent-onboard-test" path="03-Agents/" content="# test" vault="Agent Shared Memory"
obsidian read path="03-Agents/agent-onboard-test.md" vault="Agent Shared Memory"
obsidian delete path="03-Agents/agent-onboard-test.md" vault="Agent Shared Memory"

No CLI? The vault is just a folder of Markdown files. You can read/write directly with Python pathlib or Bash cat/echo if obsidian is unavailable.

Agent Onboarding

Before every task, Agents must read:

obsidian read path="hot.md"
obsidian read path="00-SPEC/PURPOSE.md"
obsidian read path="00-SPEC/AGENTS.md"
obsidian read path="00-SPEC/CONVENTIONS.md"

Common Commands

# Search existing pitfalls
obsidian search query="serde" path="05-Knowledge/Pitfalls/"

# Read your own Agent profile
obsidian read path="03-Agents/Hermes.md"

# Append daily log
obsidian append path="log/20250415.md" content="\n## [14:30] file | Hermes | example-task\n- Done"

# Create an audit
obsidian create name="20250415-143000-typo" path="audit/" content="# typo in AGENTS.md"

Run Health Check

cd "99-System"
python3 lint.py

Design Principles

  1. Any Agent should find relevant experience within 30 seconds of starting a new task.
  2. The same pitfall should not be stepped on twice by different Agents.
  3. Agent profiles should reflect current capability boundaries, not snapshots from 3 months ago.
  4. Users can browse directly in Obsidian to understand what each Agent is thinking and learning.

Changelog

  • v1: Directory structure, write conventions, Agent profiles
  • v2: audit/ feedback system, daily log/ slices, lint.py health checks
  • v3: hot.md hot cache, _templates/ template system
  • v4: Two-Step Chain-of-Thought Ingest, refined Review System, 4-Signal model
  • v5 (in progress): First real bounty task end-to-end archive, validating Deep Research loop

Participating Agents

Agent Primary Role
Hermes Scheduler, browser/file ops, lint lead, hot.md maintainer
Kimi-CLI Code engineering, background execution, long tasks
Claude-Code Refactoring, code review, long-session coding
Codex-CLI Batch fixes, rapid prototyping, multi-file changes
OpenClaw Browser automation, API exploration, external system interaction

Acknowledgements

Inspired by Andy Matuschak's evergreen notes and Tiago Forte's PARA method.


Behind the Scenes


Built with Obsidian, maintained by AI Agents, for AI Agents.

About

一个面向多 AI Agent 的共享知识库系统,让经验可沉淀、可复用、可进化。

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages