# mnemon

> Equip DSH Web with the Mnemon persistent memory backend, connecting session hot memory and project archives with Mnemon long-term storage as a three-layer supervised memory system.

## Metadata

- Author: [@mnemon-dev](https://github.com/mnemon-dev)
- Repo: <https://github.com/mnemon-dev/mnemon.git>
- GitHub: [mnemon-dev/mnemon](https://github.com/mnemon-dev/mnemon)
- Stars: 494
- Language: Go
- License: [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html)
- Homepage: <https://github.com/mnemon-dev/mnemon#readme>
- Topics: `agent-framework`, `agent-memory`, `ai-agent`, `ai-tools`, `claude`, `claude-code`, `cli`, `context-window`, `dsh`, `dsh-plugin`, `knowledge-graph`, `llm-agent`, `llm-memory`, `llm-supervised`, `memory`, `openclaw`, `persistent-memory`
- Forks: 63
- Open Issues: 16
- Last push: 2026-08-19T14:43:18.000Z
- Added: 2026-08-16T00:00:00.000Z

## Install

```bash
dsh plugin --profile web add github:mnemon-dev/mnemon
```

## Wiki

## One-Line Positioning
mnemon turns DSH Web into an AI client with persistent memory: the host LLM remains the decision-maker, while the mnemon binary is responsible for precipitating conversations into local graph memory, which is recalled into context when the next session starts.

## Core Capabilities
- Injects three layers of supervised memory into DSH sessions: DSH's built-in runtime hot memory, managed project archives, and Mnemon's long-term memory space
- Replaces database INSERT/SELECT with three primitives: remember/link/recall, aligning memory operations with the LLM's cognitive vocabulary
- Performs four types of relation searches on the graph (temporal, entity, causal, semantic), with automatic deduplication and conflict merging during recall
- Automatically preserves key continuity before session window compression, preventing early decisions from being squeezed out of context by long conversations
- Cross-session persistence: write once, all subsequent sessions can read from the default store
- Supports optional local Ollama vector retrieval, no internet required, no inference quota consumed

## Technical Implementation
- **Language**: Go 1.24.6 (plus root package.json describing DSH assembly contract)
- **Key Dependencies**: modernc.org/sqlite (pure Go SQLite, no CGo), spf13/cobra (CLI framework), google/uuid, go.yaml.in/yaml/v3
- **Architecture Pattern**: Uses `cordis.patch.yml` to mount the `dsh-mnemon` sub-plugin to the DSH host; the plugin internally calls the `mnemon` binary on the host for storage and retrieval, with the host deciding write and recall between the binary and LLM
- **Entry Points**: Declared by `cordis.patch.yml` on the DSH side; on the Go binary side, started by `main.go` + `cmd/memory/root.go`

## Use Cases
You frequently use DSH Web for cross-session continuous work (multi-round iterations, long-term refactoring, long-term client/project archives), but find important decisions and context always get compressed or forgotten. After installing mnemon, each new session will automatically recall the previous session's memory, and at the end you decide whether to persist it. If you also need to share memory between other runtimes like Claude Code / Cursor / Codex during daily development, you can also run `mnemon setup --target <runtime>`, which reads from the same `~/.mnemon` database.

## Prerequisites & Compatibility
| Dependency | Minimum Version | Description |
|---|---|---|
| mnemon binary | Same version as this repo (0.0.1) | Must be installed on the host first, otherwise DSH internal calls will fail |
| Node | >=20 | Declared in package.json `engines.node` |
| Operating System | macOS / Windows / Linux | Release configuration (`release_distribution_test.go:45-50`) covers linux/darwin/windows three platforms amd64 and arm64 |
| Native Modules | None | modernc.org/sqlite is pure Go implementation, no CGo toolchain required |

## Installation
```bash
dsh plugin --profile web add github:mnemon-dev/mnemon
```

## Configuration
DSH side plugin layer configuration (injected by `cordis.patch.yml`, adjustable in DSH's Plugin Config → Mnemon):

| Config | Type | Description | Default |
|---|---|---|---|
| routingGuidance | boolean | Whether Mnemon option appears in DSH routing guidance | true |
| lifecycleEnabled | boolean | Whether to enable session lifecycle hooks (Prime/Remind/Nudge/Compact) | true |
| recallMode | enum | Recall mode, guided lets host LLM decide when to recall | guided |
| writebackMode | enum | Writeback mode, guided lets host LLM decide when to persist | guided |
| idleReviewMs | integer | Polling interval for idle check (milliseconds) | 30000 |
| tabEnabled | boolean | Whether to show Memory System tab in session sidebar | true |
| writeEnabled | boolean | Whether to allow writing to long-term memory | true |
| timeoutMs | integer | Timeout for calling mnemon binary (milliseconds) | 10000 |
| defaultRecallLimit | integer | Default number of items returned per recall | 10 |

Environment variables on mnemon binary side (generally no need to modify):

| Environment Variable | Description | Default |
|---|---|---|
| MNEMON_DATA_DIR | Root directory for memory database | `~/.mnemon` |
| MNEMON_STORE | Named memory store used by current session | `default` (or most recently activated named store) |
| MNEMON_EMBED_ENDPOINT | Local Ollama vector retrieval endpoint (only used when vector is enabled) | `http://localhost:11434` |
| MNEMON_EMBED_MODEL | Ollama embedding model name | `nomic-embed-text` |
| MNEMON_EMBED_DIMENSIONS | Embedding vector dimensions | Undeclared, follows model default |

## FAQ
**Q: What needs to be installed on the system for this plugin?**

A: You need to install the `mnemon` binary on the host first (recommended `brew install --cask mnemon-dev/tap/mnemon` or `go install github.com/mnemon-dev/mnemon@latest`). The DSH plugin side only connects mnemon to the Web client; without the main program, it won't work.

**Q: Do I need to apply for an extra API Key?**

A: No. Mnemon completely delegates memory judgment to the host LLM; the binary only handles the deterministic work of storage and retrieval; only when you additionally enable Ollama vector augmentation does it involve local models.

**Q: Will memory be shared between different sessions?**

A: Yes by default. All sessions share a store named `default`, write once and subsequent reads can all access it. If you need project-level isolation, use `mnemon store create <name>` to create a store, then `mnemon store set <name>` to switch, or temporarily start the process with `MNEMON_STORE=work`.

**Q: Where do I go to customize memory judgment rules?**

A: Edit `~/.mnemon/prompt/guide.md` (mounted in DSH Plugin Config), which contains the human-readable rules for "when to recall, when to remember". `SKILL.md` only describes command syntax; don't mix them together.

**Q: Can it be used on macOS/Windows/Linux?**

A: The core memory functionality works on all three platforms. On Windows, the `mnemon agency …` command family is currently not available (source code `cmd/agency/*.go` is restricted with `//go:build !windows`), only the memory core is available. If you need Agency capability, please run on macOS or Linux.

**Q: Do I have to start local Ollama?**

A: No. Without Ollama, Mnemon only runs graph retrieval (four types of edges: temporal, entity, causal, semantic), and recall quality is already sufficient for daily use; enable Ollama only if you want vector similarity recall in addition.

**Q: How to completely uninstall?**

A: Uninstall dsh-mnemon in DSH's Plugin Config; then run `mnemon setup --eject` on the host, which will clear all hooks, skills and guide files distributed by runtimes.

## Difficulty Level
Getting Started — just run one `dsh plugin --profile web add …` plus one line of `mnemon setup` on the host; default values already enable all common hooks and tabs, so regular users basically don't need to modify any configuration.

## Known Issues & Limitations
- Windows currently does not support `mnemon agency …` subcommand family (`cmd/agency/serve.go:1`, `cmd/agency/setup.go:1`, etc. restricted with `//go:build !windows`), only the memory core is available.
- Depends on pre-installed mnemon binary on host; DSH plugin side does not include the binary, must install or link to the local version first.
- If Ollama vector augmentation is enabled, local Ollama service must be available and model name must match `MNEMON_EMBED_MODEL`, otherwise it degrades to pure graph retrieval (functional but with reduced recall quality).
- DSH's specific minimum compatible version is not declared in `package.json`, needs actual verification on the Web side.

---

This document is auto-generated by [deepseek-plugin.org](https://deepseek-plugin.org). HTML page: [mnemon](https://deepseek-plugin.org/plugins/mnemon-dev/mnemon)
Wiki generated by AI (model: `MiniMax-M2.5`)
