Skip to content

Contributing

Development setup

bash
git clone https://github.com/heichaowo/openclaw-amem
cd openclaw-amem
npm install
npm run build

Running checks

bash
npm run lint               # ESLint (Flat Config)
npm run format             # Prettier check
npm run check:boundaries   # Import boundary & absolute path audit
npm run test               # Vitest unit & integration tests
npm run check              # Full suite (format + lint + boundaries + test)

Test coverage

Test FileWhat It Covers
test/embedding.test.tsONNX embedding shape & cosine similarity
test/storage.test.tsQdrant note add / soft-delete (live integration)
test/memory.test.tsConsolidation & cascading link updates
test/tokenize.test.tsJieba Chinese segmentation, mixed-language, edge cases
test/bfs-gate.test.tsBFS relevance gate: filter / admit / disable
test/heat-decay.test.tsTime-decay heat boost: fresh > stale ranking, decay magnitude

Project structure

openclaw-amem/
├── src/
│   ├── index.ts          # Plugin entry point & OpenClaw hooks
│   ├── memory.ts         # Core A-MEM operations (add, search, consolidate)
│   ├── storage.ts        # Qdrant client & collection management
│   ├── embedding.ts      # Local ONNX embedding via Transformers.js
│   ├── llm.ts            # LLM calls (note construction, CRUD, links, evolution)
│   ├── bm25.ts           # BM25 ranking with Jieba tokenization
│   └── types.ts          # Shared TypeScript types
├── test/                 # Vitest test suite
├── website/              # This documentation site (VitePress)
└── docs/                 # Internal development notes

References

ReferenceRole
Xu et al., A-MEM: Agentic Memory for LLM Agents, NeurIPS 2025 · arXiv:2502.12110Core architecture
Robertson & Zaragoza, The Probabilistic Relevance Framework: BM25 and Beyond, 2009BM25 ranking formula
Cormack et al., Reciprocal Rank Fusion, SIGIR 2009RRF fusion formula
Sun et al., Jieba Chinese Text SegmentationChinese word segmentation

Released under the MIT License.