Preface¶
In the development practice of DeepSeek Harness (DSH), long-term memory is often treated as a static dataset, which can easily lead to “stale injection” (finished projects still occupying the context budget) or “loss of validity time” (inability to record when facts were true or became invalid). ForeSight aims to treat memory as scheduled data with explicit temporal semantics and solve the above issues through lifecycle management mechanisms.
Plugin Positioning¶
ForeSight is a plugin that provides temporal long-term memory for DeepSeek Harness (DSH). It does not rely on hard-coded behavior; instead, it drives memory decay, injection, and conflict resolution through configurable policy files.
Core Features¶
The core design of ForeSight is based on two dimensions in linguistics: “Aspect” and “Anchor”:
- Aspect: Controls the lifecycle stage of memory, such as progressive aspect (ongoing, will expire), perfective aspect (completed, permanent), imperfective aspect (pending verification), and stative aspect (invariant facts, such as user preferences).
- Anchor: Defines the time range during which a fact is true, such as a time point, time interval, open interval, or no time restriction.
- Lifecycle management: Automatically performs decay (anchor expiry), TTL fallback, renewal reminders, forward-looking review, and predictive validation.
- Conflict resolution: Provides two knobs (β), conservative/aggressive, for conflict arbitration based on evidence.
- Architecture features: Agent-agnostic design, supports pluggable embedding and LLM services, and uses SQLite vector storage.
Installation and Startup¶
Installation must be executed in the DSH profile directory:
# 在 ~/.dsh/profiles/<name>/ 目录下
pnpm add @foresight/memory
To enable it, configure the plugin in cordis.patch.yml and specify the data root directory, embedding service, and database file:
# cordis.patch.yml (profile-level)
- id: foresight-core
config:
memoryRoot: '<your data directory>' # 例如 /home/you/.config/foresight
dbFile: 'foresight.db'
embedBaseUrl: 'http://localhost:11434'
embedModel: 'nomic-embed-text-v1-moe'
Configuration and Data Directory¶
Data is stored in a local directory and not in the repository. The directory structure is as follows:
<memoryRoot>/
├── SOUL.md # 个性设定(需复制 templates/SOUL.md.example)
├── user.md # 用户档案(需复制 templates/user.md.example)
├── policy.yaml # 策略配置(需复制 templates/policy.yaml.example)
└── foresight.db # SQLite 向量存储(自动创建)
Before the first run, manually copy the templates and adjust the configuration:
mkdir -p ~/.config/foresight
cp templates/SOUL.md.example ~/.config/foresight/SOUL.md
cp templates/user.md.example ~/.config/foresight/user.md
cp templates/policy.yaml.example ~/.config/foresight/policy.yaml
Configuration priority is: explicit options > environment variables > policy.yaml > default values.
Notes¶
- Experimental status: The plugin is currently experimental; the taxonomy, policy model, and mechanisms are being actively revised.
- Dependency requirements: Requires Node.js ≥ 20 and DeepSeek Harness (dsh) with the cordis plugin system installed.
- Default embedding service: Uses local Ollama by default, with the model
nomic-embed-text-v1-moe. - Permissions and data: The plugin creates directories but does not silently write policy files; templates must be copied manually.
Conclusion¶
ForeSight shifts memory management from prompt engineering to data management, providing DSH Agents with a controllable long-term memory solution. Its temporal semantic design based on aspect and anchor helps filter outdated information while maintaining contextual relevance.