Introduction

In agent development, conversation logs are usually not considered true memory. To give agents continuity across multi-turn interactions, a mechanism is needed to persist information. DSH-KRouter (dsh-krouter) aims to provide coding agents with a “second brain”. It seals and distills “yesterday’s” reasoning into Obsidian, allowing “tomorrow’s” agent to hit that page directly rather than relying on a vector dump from the previous session.

Plugin Positioning

dsh-krouter is a Memory-type plugin under the MIT license, maintained by developer 398894496-arch. It acts as the agent’s Knowledge Operating System (OS), with the core goal of solving the persistence and retrieval of agent memory.

Core Features

The plugin implements memory through the following mechanisms:

  1. Self-Evolution (Timer Enabled by Default)
    The plugin enables a timer by default to handle daily self-evolution. It distills each day’s interactions and automatically writes them to the Obsidian vault.

  2. Obsidian Persistence
    Daily thoughts are distilled and written to the Obsidian vault as the basis for subsequent retrieval.

  3. Retrieval Locking Mechanism
    Retrieval is based on “locking” rather than vector similarity. The system maps a short noun to a specific page and uses dual SHA-256 verification. This avoids the complexity of vector databases while ensuring retrieval accuracy.

  4. Five Gates and Automatic Methods
    Once the “five gates” checks pass, the system automatically generates a provisional method and writes it to the vault without manual intervention. When similar tasks are encountered later, the system asks the user whether to adopt it.

  5. Agent Knowledge OS
    The plugin provides a complete router and writer to manage the agent’s knowledge base structure.

Installation and Configuration

Installation requires cloning the code, creating a virtual environment, and installing dependencies. Ensure a Python environment is available.

git clone https://github.com/398894496-arch/DSH-KRouter.git
cd DSH-KRouter
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -r requirements.txt
./scripts/first_run.sh

Configure API Key:
An API key is required. You can paste it into a template file under the template/ directory, or inject it via the ~/.dsh-krouter-keys.env file. The system reads both locations.

Typical Usage

After installation, you can interact with the plugin through script commands.

1. Suggestions and Retrieval
Use the krouter suggest command; the system returns suggestions based on the noun. If there is a hit, it returns a receipt; if not, it returns a hint.

export OBSIDIAN_VAULT=/path/to/YourVault
./scripts/krouter suggest homz

2. Return Format on a Hit
When retrieval succeeds, the command returns a receipt containing verification information:

retrieval_status: canonical-match
canonical_source: /YourVault/Agent第二大脑.md
canonical_id: Q01
source_verified_at: 2026-01-01
source_sha256: d8c1d5af…
canonical_map_sha256: c55b8715…
canonical_match: true

Notes

  1. Resource Requirements
    The plugin does not depend on GPU, Docker, or an embedding daemon. It uses Python3 and ripgrep (rg) for local retrieval, so hardware requirements are low.

  2. Retrieval Mechanism
    The plugin does not use a vector database. Retrieval is entirely based on locked noun-to-page mappings, requiring accurate mapping relationships to be maintained in files such as canonical_sources.psv.

  3. Default Behavior
    The timer is enabled by default. This means the plugin periodically executes the self-evolution process.

Summary

dsh-krouter is a memory system designed for Coding Agents. By distilling daily thoughts into Obsidian and adopting a “locked” retrieval strategy, it achieves memory persistence and reproducibility. For development scenarios that require long-term memory and multi-turn reasoning, the plugin provides a lightweight solution with no dependency on vector databases.

  • GitHub Repository: https://github.com/398894496-arch/DSH-KRouter
  • Plugin Directory: https://www.skillhub.cn/plugins/398894496-arch/DSH-KRouter