xiangrui979/foresight0

@foresight/memory

ForeSight: a temporal-aspect long-term memory plugin for DeepSeek Harness (dsh)

包名
@foresight/memory
版本
0.1.0
许可证
MIT
最近更新
2026年8月22日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xiangrui979/foresight

Configuration — where does my data go?

Your data lives OUTSIDE the repo, in your own data directory. The plugin never ships any user data; the repository is pure code + templates.

Data directory layout

/
├── SOUL.md          # personality (copy from templates/SOUL.md.example)
├── user.md          # user profile (copy from templates/user.md.example)
├── policy.yaml      # all tunables (copy from templates/policy.yaml.example)
└── foresight.db     # SQLite store (created automatically)

On first run the plugin expects the three text files to exist. The plugin creates the directory if needed but does not silently write policy — copy the templates, then adjust:

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

Resolution chain

explicit options (adapter) → environment variables → policy.yaml → defaults

SettingEnv varDefault
data directoryFORESIGHT_MEMORY_DIR%APPDATA%/foresight (win) / ~/.local/share/foresight (unix)
db fileFORESIGHT_DB_FILEforesight.db
embed URLFORESIGHT_EMBED_URLhttp://localhost:11434
embed modelFORESIGHT_EMBED_MODELnomic-embed-text-v2-moe
LLM base URLFORESIGHT_LLM_BASE_URLhttps://api.deepseek.com/v1
LLM modelFORESIGHT_LLM_MODELdeepseek-v4-flash

Policy file

policy.yaml is the single source of truth for behavior: permission matrix, aspect registry (TTL, dwell, injection mode), gate categories, activation β and decay constants, retrieval factor weights, injection budgets, nudge cadence, server port/token. You decide your assistant's personality, profile, and memory policy — none of it is baked into the code.