Contributing
Development setup
bash
git clone https://github.com/heichaowo/openclaw-amem
cd openclaw-amem
npm install
npm run buildRunning 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 File | What It Covers |
|---|---|
test/embedding.test.ts | ONNX embedding shape & cosine similarity |
test/storage.test.ts | Qdrant note add / soft-delete (live integration) |
test/memory.test.ts | Consolidation & cascading link updates |
test/tokenize.test.ts | Jieba Chinese segmentation, mixed-language, edge cases |
test/bfs-gate.test.ts | BFS relevance gate: filter / admit / disable |
test/heat-decay.test.ts | Time-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 notesReferences
| Reference | Role |
|---|---|
| Xu et al., A-MEM: Agentic Memory for LLM Agents, NeurIPS 2025 · arXiv:2502.12110 | Core architecture |
| Robertson & Zaragoza, The Probabilistic Relevance Framework: BM25 and Beyond, 2009 | BM25 ranking formula |
| Cormack et al., Reciprocal Rank Fusion, SIGIR 2009 | RRF fusion formula |
| Sun et al., Jieba Chinese Text Segmentation | Chinese word segmentation |
