llmem

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LLMem

LLMem

LLMem is a structured memory system (Go binary). It stores factual memories in SQLite with optional embedding-based semantic search via Ollama (nomic-embed-text). Semantic search uses a sqlite-vec HNSW ANN index for sub-linear retrieval, with automatic fallback to brute-force cosine similarity if the sqlite-vec extension is not available. Memories can be connected via typed relations (
related_to
,
supersedes
,
contradicts
,
depends_on
,
derived_from
). A background dreaming/consolidation system (light, deep, REM phases) runs automatically via systemd timer to decay idle memories, boost frequent ones, promote high-value ones, and merge near-duplicates.
LLMem是一个结构化记忆系统(Go二进制程序)。它将事实记忆存储在SQLite中,可通过Ollama(nomic-embed-text)实现基于嵌入的语义搜索。语义搜索使用sqlite-vec的HNSW ANN索引实现亚线性检索,如果sqlite-vec扩展不可用,会自动回退到暴力余弦相似度计算。记忆可通过类型化关系(
related_to
supersedes
contradicts
depends_on
derived_from
)关联。后台梦境/整合系统(轻度、深度、REM阶段)通过systemd定时器自动运行,用于衰减闲置记忆、增强频繁访问的记忆、提升高价值记忆并合并近似重复的记忆。

Installation

安装

  • CLI:
    ~/.local/bin/llmem
  • Config:
    ~/.config/llmem/config.yaml
  • DB:
    ~/.config/llmem/memory.db
  • Ollama:
    http://localhost:11434
    (local, for embeddings)
  • 命令行工具(CLI):
    ~/.local/bin/llmem
  • 配置文件:
    ~/.config/llmem/config.yaml
  • 数据库:
    ~/.config/llmem/memory.db
  • Ollama:
    http://localhost:11434
    (本地部署,用于生成嵌入向量)

Session Adapter Configuration

会话适配器配置

LLMem uses a session adapter to read conversation transcripts for memory extraction. Set
session.adapter
in config.yaml:
  • opencode
    (default) — reads from
    ~/.local/share/opencode/opencode.db
    . Auto-selected if the database exists.
  • copilot
    — reads from
    ~/.copilot/session-state/
    . Auto-selected if only Copilot session data exists. Full transcripts require
    --share
    .
  • none
    — no adapter. Context injection still works, but transcript extraction returns
    no_transcript
    .
yaml
undefined
LLMem使用会话适配器读取对话记录以提取记忆。在config.yaml中设置
session.adapter
  • opencode
    (默认)——读取
    ~/.local/share/opencode/opencode.db
    。若该数据库存在则自动选择。
  • copilot
    ——读取
    ~/.copilot/session-state/
    。若仅存在Copilot会话数据则自动选择。完整记录需要使用
    --share
    参数。
  • none
    ——无适配器。上下文注入仍可工作,但记录提取会返回
    no_transcript
yaml
undefined

For Copilot CLI:

针对Copilot CLI的配置:

session: adapter: copilot copilot: state_dir: ~/.copilot/session-state share_dir: .

`llmem init` auto-detects the adapter type based on which session state directory exists.
session: adapter: copilot copilot: state_dir: ~/.copilot/session-state share_dir: .

`llmem init`会根据存在的会话状态目录自动检测适配器类型。

Memory Types

记忆类型

TypeUse for
factObjective truths, definitions, state of the world
decisionChoices made and their rationale
preferenceUser preferences, style choices
eventThings that happened at a point in time
project_stateCurrent status of a project or system
procedureHow-to knowledge, step sequences
conversationNotable conversation outcomes or commitments
self_assessmentStructured introspective records — error patterns, behavioral corrections, recurring mistakes, proposed procedural updates
类型适用场景
fact客观事实、定义、世界状态
decision已做出的选择及其理由
preference用户偏好、风格选择
event特定时间点发生的事件
project_state项目或系统的当前状态
procedure操作知识、步骤序列
conversation重要对话结果或承诺
self_assessment结构化自省记录——错误模式、行为修正、重复失误、拟议流程更新

Error Taxonomy

错误分类体系

Self-assessment memories are categorized using a standard error taxonomy. Each category identifies a class of mistake that the introspection system tracks for pattern detection:
CategoryDescription
NULL_SAFETYMissing null/None/undefined checks before property access or method calls
ERROR_HANDLINGMissing try/except, bare except, swallowed errors, unhandled promise rejections
OFF_BY_ONEBoundary errors, wrong loop bounds, fencepost errors
RACE_CONDITIONConcurrency issues, async/await problems, missing locks
AUTH_BYPASSMissing auth checks, SSRF, injection vulnerabilities, security oversights
DATA_INTEGRITYStale derived fields, out-of-sync caches/embeddings/indexes, source-of-truth divergence
MISSING_VERIFICATIONSkipped test steps, unverified outputs, assumed-it-works
EDGE_CASEUnhandled empty input, unexpected types, boundary values
PERFORMANCEN+1 queries, unnecessary recomputation, memory leaks
DESIGNArchitectural issues, wrong abstraction level, coupling problems
REVIEW_PASSEDClean review with no findings — positive outcome for tracking purposes
自省记忆采用标准错误分类体系进行归类。每个类别标识自省系统跟踪的一类错误,用于模式检测:
类别描述
NULL_SAFETY属性访问或方法调用前缺少null/None/undefined检查
ERROR_HANDLING缺少try/except、裸except、吞掉错误、未处理Promise拒绝
OFF_BY_ONE边界错误、循环边界错误、栅栏柱错误
RACE_CONDITION并发问题、async/await问题、缺少锁
AUTH_BYPASS缺少权限检查、SSRF、注入漏洞、安全疏漏
DATA_INTEGRITY过时派生字段、缓存/嵌入向量/索引不同步、数据源分歧
MISSING_VERIFICATION跳过测试步骤、未验证输出、想当然认为可行
EDGE_CASE未处理空输入、意外类型、边界值
PERFORMANCEN+1查询、不必要的重计算、内存泄漏
DESIGN架构问题、抽象层级错误、耦合问题
REVIEW_PASSED无问题的评审——用于跟踪的积极结果

Structured self_assessment Format

结构化self_assessment格式

Self-assessment memories follow a structured format with nine fields:
FieldRequiredDescription
CategoryYesTaxonomy category from the Error Taxonomy above (e.g.
NULL_SAFETY
,
ERROR_HANDLING
)
ContextNoWhere and when — file, task, session date
What_happenedYesBehavioral description, not narrative
OutcomesNoWhat were the results? Did things work on first try or require iterations?
What_caught_itNoHow the error was discovered (
self-review
,
test
,
user
,
CI
)
Estimates_vs_actualNoWas the complexity assessment accurate? Did tasks take more or less effort?
RecurringNo
yes
or
no
; if yes, reference past self_assessment IDs
Proposed_updateNoSpecific procedural directive to prevent recurrence
Iteration_countNoHow many attempts before success (integer). 1 = first try, 2 = one retry, etc.
自省记忆遵循包含9个字段的结构化格式:
字段是否必填描述
Category来自上述错误分类体系的类别(例如
NULL_SAFETY
ERROR_HANDLING
Context发生地点和时间——文件、任务、会话日期
What_happened行为描述,而非叙事
Outcomes结果如何?首次尝试成功还是需要多次迭代?
What_caught_it错误如何被发现(
self-review
test
user
CI
Estimates_vs_actual复杂度评估是否准确?任务耗时比预期多还是少?
Recurring
yes
no
;如果是,引用过往self_assessment的ID
Proposed_update防止重复发生的具体流程指令
Iteration_count成功前的尝试次数(整数)。1=首次尝试成功,2=重试一次,依此类推

Key Commands

核心命令

bash
undefined
bash
undefined

Add a memory

添加记忆

llmem add --content "content" --type fact llmem add --content "prefer dark theme" --type preference --confidence 0.9
llmem add --content "内容" --type fact llmem add --content "偏好深色主题" --type preference --confidence 0.9

Search memories (hybrid RRF fusion by default)

搜索记忆(默认使用混合RRF融合)

llmem search "query" llmem search "query" --type decision --limit 5 llmem search "query" --fts-only # FTS5 keyword search only (no embedder needed) llmem search "query" --semantic-only # Semantic (embedding) search only (requires embedder) llmem search "query" --valid-only # Only show valid (non-expired) memories
llmem search "查询词" llmem search "查询词" --type decision --limit 5 llmem search "查询词" --fts-only # 仅使用FTS5关键词搜索(无需嵌入向量生成器) llmem search "查询词" --semantic-only # 仅使用语义(嵌入向量)搜索(需要嵌入向量生成器) llmem search "查询词" --valid-only # 仅显示有效(未过期)记忆

List all

列出所有记忆

llmem list llmem list --type fact --limit 20 llmem list --all # Include expired memories
llmem list llmem list --type fact --limit 20 llmem list --all # 包含过期记忆

Get specific memory (read-only, does not update access stats)

获取特定记忆(只读,不更新访问统计)

llmem get <id>
llmem get <id>

Update a memory

更新记忆

llmem update <id> --content "new content" llmem update <id> --confidence 0.95 llmem update <id> --summary "short summary" llmem update <id> --metadata '{"key": "value"}'
llmem update <id> --content "新内容" llmem update <id> --confidence 0.95 llmem update <id> --summary "简短摘要" llmem update <id> --metadata '{"key": "value"}'

Invalidate (soft-delete — marks as expired)

失效(软删除——标记为过期)

llmem invalidate <id> --reason "no longer relevant"
llmem invalidate <id> --reason "不再相关"

Delete permanently

永久删除

llmem delete <id>
llmem delete <id>

Stats

统计信息

llmem stats
llmem stats

Context injection for sessions

会话上下文注入

llmem context --session-id <session_id> # Inject context for a new session llmem context --compacting --session-id <session_id> # Inject key memories during compaction
llmem context --session-id <session_id> # 为新会话注入上下文 llmem context --compacting --session-id <session_id> # 压缩期间注入关键记忆

Session lifecycle hooks

会话生命周期钩子

llmem hook --type idle --session-id <session_id> # Memory extraction + introspection llmem hook --type created --session-id <session_id> # Context injection on session start llmem hook --type ending --session-id <session_id> # Automatic introspection on session end llmem hook --type ending --session-id <session_id> --model glm-5.1:cloud --base-url http://localhost:11434 llmem hook --type compacting --session-id <session_id># Context during compaction
llmem hook --type idle --session-id <session_id> # 记忆提取 + 自省 llmem hook --type created --session-id <session_id> # 会话启动时注入上下文 llmem hook --type ending --session-id <session_id> # 会话结束时自动执行自省 llmem hook --type ending --session-id <session_id> --model glm-5.1:cloud --base-url http://localhost:11434 llmem hook --type compacting --session-id <session_id># 压缩期间注入上下文

Dream — background consolidation (decay, boost, promote, merge)

梦境——后台整合(衰减、增强、提升、合并)

llmem dream # Preview all phases (dry-run) llmem dream --apply # Execute all phases llmem dream --phase light # Run only the light phase llmem dream --phase deep # Run only the deep phase llmem dream --phase rem # Run only the REM phase llmem dream --apply --phase deep # Apply only the deep phase llmem dream --apply --report /path/to/report.html # Generate HTML dream report
llmem dream # 预览所有阶段(试运行) llmem dream --apply # 执行所有阶段 llmem dream --phase light # 仅运行轻度阶段 llmem dream --phase deep # 仅运行深度阶段 llmem dream --phase rem # 仅运行REM阶段 llmem dream --apply --phase deep # 仅执行深度阶段 llmem dream --apply --report /path/to/report.html # 生成HTML梦境报告

Learn a lesson from a wrong→right correction

从错误→正确的修正中总结经验

llmem learn --wrong "called wrong function" --right "call correctFunction() instead" --context "handler.py:42"
llmem learn --wrong "调用了错误的函数" --right "改为调用correctFunction()" --context "handler.py:42"

Introspect — analyze a failure and store self_assessment memory

自省——分析失败并存储self_assessment记忆

Manual mode: specify fields directly

手动模式:直接指定字段

llmem introspect --category NULL_SAFETY --what-happened "missing null check" --context "handler.py:42" --caught-by self-review --proposed-fix "always check for None before .field" llmem introspect --category NULL_SAFETY --what-happened "missing null check" --model glm-5.1:cloud --base-url http://localhost:11434
llmem introspect --category NULL_SAFETY --what-happened "缺少空值检查" --context "handler.py:42" --caught-by self-review --proposed-fix "访问.field前始终检查是否为None" llmem introspect --category NULL_SAFETY --what-happened "缺少空值检查" --model glm-5.1:cloud --base-url http://localhost:11434

Automatic mode: introspect a session transcript or arbitrary text

自动模式:自省会话记录或任意文本

llmem introspect --auto --session <session-id> # Read transcript from OpenCode adapter llmem introspect --auto --text "Encountered a null pointer error" # Introspect arbitrary text llmem introspect --auto --session <session-id> --model glm-5.1:cloud --base-url http://localhost:11434
llmem introspect --auto --session <session-id> # 从OpenCode适配器读取记录 llmem introspect --auto --text "遇到空指针错误" # 自省任意文本 llmem introspect --auto --session <session-id> --model glm-5.1:cloud --base-url http://localhost:11434

Track review findings as self_assessment memories (automatic post-review hook)

将评审发现跟踪为self_assessment记忆(自动评审后钩子)

llmem track-review --single --category NULL_SAFETY --context "handler.py:42" # Single finding (uses --single flag) llmem track-review --findings /tmp/review-findings.json --context "handler.py" # Batch mode: persist findings from JSON file llmem track-review --clean # Invalidate all existing track-review memories llmem track-review # Clean review (no findings) → creates REVIEW_PASSED memory
llmem track-review --single --category NULL_SAFETY --context "handler.py:42" # 单个发现(使用--single参数) llmem track-review --findings /tmp/review-findings.json --context "handler.py" # 批量模式:从JSON文件导入发现 llmem track-review --clean # 失效所有现有跟踪评审记忆 llmem track-review # 无问题评审(无发现)→ 创建REVIEW_PASSED记忆

Export/import

导出/导入

llmem export --output memories.json llmem import memories.json
llmem export --output memories.json llmem import memories.json

Embedding quality metrics

嵌入向量质量指标

llmem metrics
llmem metrics

Initialize config and database

初始化配置和数据库

llmem init llmem init --ollama-url http://localhost:11434
undefined
llmem init llmem init --ollama-url http://localhost:11434
undefined

Relations

关系

Memories can be linked by typed relations:
supersedes
,
contradicts
,
depends_on
,
related_to
,
derived_from
.
Relations are managed internally by the dream system and extraction pipeline. The Go backend supports relation traversal in search (exposed via the
Retriever
API) but the CLI does not yet expose
--traverse-relations
as a flag.
记忆可通过类型化关系关联:
supersedes
contradicts
depends_on
related_to
derived_from
关系由梦境系统和提取管道内部管理。Go后端支持搜索中的关系遍历(通过
Retriever
API暴露),但CLI尚未提供
--traverse-relations
参数。

Multi-Signal Reranking

多信号重排序

After RRF fusion, search results are automatically reranked using a blend of the RRF score and four weighted signals:
final_score = rrf_score * (1 - blend) + weighted_signal * blend
Default blend factor: 0.3 (70% RRF, 30% signals).
Signals and weights:
SignalWeightFormula
Confidence0.4Direct use of
confidence
field (0.0–1.0, default 0.0)
Recency0.3
exp(-0.01 * days_since_access)
(0.0 if never accessed)
Access frequency0.2
log(1 + access_count / max(age_days, 1))
(0.0 if never accessed)
Type priority0.1Lookup in
TYPE_PRIORITY
dict (default 1.0 for unknown types)
Type priority weights:
TypePriority
decision1.2
preference1.1
procedure1.1
fact1.0
project_state1.0
self_assessment1.0
event0.9
conversation0.7
RRF融合后,搜索结果会自动结合RRF分数和四个加权信号进行重排序:
final_score = rrf_score * (1 - blend) + weighted_signal * blend
默认混合因子:0.3(70% RRF,30%信号)。
信号及权重:
信号权重公式
Confidence0.4直接使用
confidence
字段(0.0–1.0,默认0.0)
Recency0.3
exp(-0.01 * days_since_access)
(从未访问则为0.0)
Access frequency0.2
log(1 + access_count / max(age_days, 1))
(从未访问则为0.0)
Type priority0.1
TYPE_PRIORITY
字典查找(未知类型默认1.0)
类型优先级权重:
类型优先级
decision1.2
preference1.1
procedure1.1
fact1.0
project_state1.0
self_assessment1.0
event0.9
conversation0.7

Important Notes

重要说明

  • Go binary
    llmem
    is now a compiled Go binary at
    ~/.local/bin/llmem
    , symlinked from
    /usr/local/bin/llmem
    . No Python virtualenv needed.
  • Invalidate, don't delete unless the memory was wrong. Invalidated memories stay for reference but aren't returned in searches.
  • Embeddings require Ollama running with
    nomic-embed-text
    pulled. If Ollama is down, semantic search falls back to FTS5-only.
  • ANN vector index — semantic search uses sqlite-vec (
    vec0
    virtual table) for fast ANN retrieval, with automatic fallback to brute-force cosine similarity if sqlite-vec is not available.
  • Confidence is 0.0-1.0. Higher = more certain. Facts from the user directly should be 0.9+, auto-extracted should be 0.7.
  • Context generation is what gets injected into the system prompt for context. Use
    llmem context --session-id <id>
    to preview what gets injected.
  • Session hooks use
    llmem hook --type <idle|created|ending|compacting> --session-id <id>
    . The idle hook processes the session's transcript, extracts memories, and runs introspection automatically. The ending hook performs automatic introspection on the session transcript and stores a
    self_assessment
    memory; use
    --model
    and
    --base-url
    to configure the LLM for introspection.
  • Access tracking
    llmem get
    is read-only and does not update
    access_count
    or
    accessed_at
    . Search operations automatically track access — each returned result's
    access_count
    and
    accessed_at
    are updated (best-effort).
  • Calibration status metadata — procedure memories created by behavioral insights receive
    calibration_status
    (trend:
    decreasing
    ,
    stable
    , or
    increasing
    ) and
    calibrated_at
    metadata when calibration runs. Stale procedures get
    stale_procedure: true
    and
    stale_at
    metadata. These are visible via
    llmem get <id>
    .
  • Review outcome tracking
    llmem track-review
    persists review findings as
    self_assessment
    memories. Three modes:
    --single
    for a single finding,
    --findings <file>
    for batch from JSON, or no flags for a clean review (creates
    REVIEW_PASSED
    memory). Use
    --clean
    to invalidate all existing track-review memories before storing new ones.
  • Go二进制程序 ——
    llmem
    现在是编译后的Go二进制程序,位于
    ~/.local/bin/llmem
    ,并软链接到
    /usr/local/bin/llmem
    。无需Python虚拟环境。
  • 优先失效而非删除,除非记忆内容错误。失效的记忆仍保留供参考,但不会在搜索结果中返回。
  • 嵌入向量需要运行Ollama并拉取
    nomic-embed-text
    。如果Ollama停机,语义搜索会回退到仅使用FTS5。
  • ANN向量索引 —— 语义搜索使用sqlite-vec(
    vec0
    虚拟表)实现快速ANN检索,如果sqlite-vec不可用,会自动回退到暴力余弦相似度计算。
  • 置信度范围为0.0-1.0,值越高表示越确定。用户直接提供的事实应设为0.9+,自动提取的应设为0.7。
  • 上下文生成是指注入到系统提示符中的内容。使用
    llmem context --session-id <id>
    可预览将被注入的内容。
  • 会话钩子使用
    llmem hook --type <idle|created|ending|compacting> --session-id <id>
    。idle钩子处理会话记录、提取记忆并自动运行自省。ending钩子对会话记录执行自动自省并存储
    self_assessment
    记忆;可使用
    --model
    --base-url
    配置自省用的LLM。
  • 访问跟踪 ——
    llmem get
    是只读操作,不会更新
    access_count
    accessed_at
    。搜索操作会自动跟踪访问——每个返回结果的
    access_count
    accessed_at
    都会更新(尽力而为)。
  • 校准状态元数据 —— 由行为洞察创建的procedure记忆在校准运行时会获得
    calibration_status
    (趋势:
    decreasing
    stable
    increasing
    )和
    calibrated_at
    元数据。过时的procedure会被标记
    stale_procedure: true
    stale_at
    元数据。这些可通过
    llmem get <id>
    查看。
  • 评审结果跟踪 ——
    llmem track-review
    将评审发现存储为
    self_assessment
    记忆。三种模式:
    --single
    用于单个发现,
    --findings <file>
    用于从JSON批量导入,无参数表示无问题评审(创建
    REVIEW_PASSED
    记忆)。使用
    --clean
    可在存储新记忆前失效所有现有跟踪评审记忆。

Dream — Background Consolidation

梦境——后台整合

The dream system is an automated memory maintenance pipeline that runs three phases:
  • Light — finds near-duplicates using cosine similarity (configurable threshold, default 0.92). Produces merge candidates for the deep phase.
  • Deep — decays idle memories (confidence decreases over time), boosts frequently accessed memories, promotes high-scoring memories, and merges near-duplicates using LLM-assisted merge with fallback to concatenation.
  • REM — extracts themes and clusters from memory, writes a human-readable dream diary to
    ~/.config/llmem/dream-diary.md
    . Self-assessment memories are grouped by error taxonomy category (e.g. "2 self_assessment memories about NULL_SAFETY") for pattern detection. When a category has 3+ occurrences (configurable via
    skill_patch_threshold
    ), the REM phase generates three outputs: (1) a procedural memory (Tier 1 — automatic, low confidence), (2) a behavioral insight entry in
    proposed-changes.md
    (Tier 2 — human review), and (3) a skill patch entry in
    proposed-changes.md
    marked with
    [SKILL PATCH]
    (Tier 3 — human review). Skill patches are structured markdown snippets with Detection Rule, Checklist, Pitfall, and Verification sections that can be appended to existing skills or used as mini-skills. They are NOT auto-applied — they require human review and deployment. When behavioral insights are generated, calibration tracking compares self_assessment error rates (or average iteration counts) before and after each adaptation was introduced, marking them as effective (decreasing) or ineffective (stable/increasing). Procedure memories that are never accessed and older than
    stale_procedure_days
    are aggressively decayed (confidence reduced at double the normal decay rate). The dream diary includes a
    ### Calibration
    section with per-category effectiveness and stale procedure counts.
Default mode is dry-run — use
--apply
to actually make changes. Without it,
llmem dream
only previews what would happen. Use
--report /path/to/report.html
to generate an HTML dream report.
Scheduling: A systemd user timer (
llmem-dream.timer
) runs
llmem dream --apply
nightly at 3am. See
harness/llmem-dream.service
and
harness/llmem-dream.timer
.
Dream config lives under the
dream:
key in
~/.config/llmem/config.yaml
:
KeyDefaultDescription
similarity_threshold
0.92Cosine similarity for near-duplicate detection
decay_rate
0.05Confidence reduction per decay interval
decay_interval_days
30Days per decay interval
decay_floor
0.3Minimum confidence after decay
confidence_floor
0.3Memories at or below this are invalidated
boost_threshold
5Access count that triggers confidence boost
boost_amount
0.05Confidence boost amount
diary_path
~/.config/llmem/dream-diary.mdPath to dream diary file
report_path
(none)Path for HTML dream report output
behavioral_threshold
3Minimum self_assessment occurrences to trigger behavioral insight
behavioral_lookback_days
30Days of self_assessment memories for behavioral insights
auto_link_threshold
(none)Cosine similarity threshold for auto-linking related memories
梦境系统是自动化的记忆维护管道,包含三个阶段:
  • 轻度阶段 —— 使用余弦相似度查找近似重复项(可配置阈值,默认0.92)。为深度阶段生成合并候选。
  • 深度阶段 —— 衰减闲置记忆(置信度随时间降低)、增强频繁访问的记忆、提升高分数记忆,并使用LLM辅助合并近似重复项(回退到拼接模式)。
  • REM阶段 —— 从记忆中提取主题和集群,将人类可读的梦境日记写入
    ~/.config/llmem/dream-diary.md
    。自省记忆按错误分类体系类别分组(例如“2条关于NULL_SAFETY的self_assessment记忆”)用于模式检测。当某个类别出现3次以上(可通过
    skill_patch_threshold
    配置),REM阶段会生成三个输出:(1) procedure记忆(Tier 1——自动生成,低置信度),(2)
    proposed-changes.md
    中的行为洞察条目(Tier 2——需人工评审),(3)
    proposed-changes.md
    中标记为
    [SKILL PATCH]
    技能补丁条目(Tier 3——需人工评审)。技能补丁是结构化的Markdown片段,包含检测规则、检查清单、陷阱和验证部分,可附加到现有技能或用作迷你技能。它们不会自动应用——需要人工评审和部署。生成行为洞察时,校准跟踪会比较引入每项调整前后的自省错误率(或平均迭代次数),标记其为有效(下降)或无效(稳定/上升)。从未访问且超过
    stale_procedure_days
    的procedure记忆会被大幅衰减(置信度降低速度为正常衰减的两倍)。梦境日记包含
    ### Calibration
    部分,展示各类别的有效性和过时procedure数量。
默认模式为试运行 —— 使用
--apply
实际执行更改。不添加该参数时,
llmem dream
仅预览会发生的操作。使用
--report /path/to/report.html
可生成HTML梦境报告。
调度:systemd用户定时器(
llmem-dream.timer
)会在每天凌晨3点运行
llmem dream --apply
。详见
harness/llmem-dream.service
harness/llmem-dream.timer
梦境配置位于
~/.config/llmem/config.yaml
dream:
键下:
默认值描述
similarity_threshold
0.92近似重复项检测的余弦相似度阈值
decay_rate
0.05每个衰减周期的置信度降低幅度
decay_interval_days
30衰减周期天数
decay_floor
0.3衰减后的最低置信度
confidence_floor
0.3置信度等于或低于此值的记忆会被失效
boost_threshold
5触发置信度增强的访问次数阈值
boost_amount
0.05置信度增强幅度
diary_path
~/.config/llmem/dream-diary.md梦境日记文件路径
report_path
(无)HTML梦境报告输出路径
behavioral_threshold
3触发行为洞察的自省记忆最低出现次数
behavioral_lookback_days
30用于行为洞察的自省记忆回溯天数
auto_link_threshold
(无)自动关联相关记忆的余弦相似度阈值