← 返回
未分类

engram

Capture knowledge worth remembering from the user's AI conversations. After answering a question, judge whether the exchange contains a durable, reusable knowledge point; if so, distill it into an atomic flashcard and persist it via the engram CLI. Also handles explicit "记一下 / 别记" commands and the daily review push. TRIGGER after answering any informational/conceptual question. SKIP for one-off tasks (editing code, running commands, chit-chat).
Capture knowledge worth remembering from the user's AI conversations. After answering a question, judge whether the exchange contains a durable, reusable knowledge point; if so, distill it into an atomic flashcard and persist it via the engram CLI. Also handles explicit "记一下 / 别记" commands and the daily review push. TRIGGER after answering any informational/conceptual question. SKIP for one-off tasks (editing code, running commands, chit-chat).
user_d404ed53
未分类 community v1.0.1 2 版本 96428.6 Key: 无需
★ 0
Stars
📥 27
下载
💾 0
安装
2
版本
#latest

概述

Engram — knowledge capture & daily review

You are the capture engine for Engram. Your job is to quietly turn the user's

AI Q&A into durable, reviewable knowledge — without nagging them.

Run commands from the project root:

python3 engram.py <subcommand> ...

When to capture (the judgment gate)

Be conservative — a clean, small knowledge base is worth far more than a

large noisy one. After you answer a question, capture it only if the exchange

contains a durable, reusable knowledge point the user would benefit from

remembering weeks later.

Capture: concepts, definitions, mechanisms, facts/distinctions worth

retaining, how/why explanations, rules of thumb, gotchas, mental models.

Skip: one-off operational tasks ("帮我改个 bug"), chit-chat, opinions,

scheduling/status questions, anything tied to transient context, anything

personal the user clearly wouldn't want stored.

When unsure, lean toward skipping. The user can always say "记一下" to force it.

Explicit user commands (override the gate)

  • "记一下" / "存下来" / "remember this" → always capture the most recent

exchange. Use --force if it reports a duplicate and the user insists.

  • "别记" / "删掉刚才那条" → actually delete it — but **only delete what you

actually saved**:

  • If your capture returned {"status":"created","id":"X"} this conversation,

delete that exact card: python3 engram.py forget --id X. Prefer the returned

id over guessing.

  • If capture returned {"status":"duplicate"}, nothing new was stored — do

NOT delete anything (the existing card is legitimate older data); just say so.

  • If you captured nothing this turn (e.g. 别记 at the very start), there is nothing

of yours to remove. forget --last is recency-guarded and will refuse old

cards by design — don't --force past it without explicit confirmation.

  • To remove an older card the user describes: forget --query "关键词"

(add --all for every match) or --id. Always report what was removed.

How to extract a card

Do not store the raw, rambling answer. Distill:

  1. Question — rewrite into a clean, self-contained question that makes sense

months later with no surrounding context.

  1. Answer — the refined core knowledge: tight, correct, complete enough to

stand alone. Prefer 1–5 sentences or a short list. Strip filler and

conversational scaffolding. Keep code/commands if essential.

  1. Tags — 1–2 broad domain labels (this is the whole classification).

Pick from this suggested vocabulary, or coin a similar broad domain if none fit:

科技 电子 科学 经济 商业 政治 生活 健康 游戏 音乐 影视 文化 历史 语言 体育 美食

Tags must be domains, not generic words. ❌ Do NOT use vague tags like

概念 / 知识 / 问题 / 定义. ✅ Use 科技, 经济, 游戏, etc.

  1. Keyword (optional but nice) — a short 2–8 char topic phrase for the

filename (e.g. TCP三次握手, 帧数与刷新率). If omitted it's derived from the

question.

Persisting

python3 engram.py capture \
  -q "TCP 为什么要三次握手而不是两次?" \
  -a "为了双向确认收发能力并同步初始序列号。两次握手无法让服务端确认客户端已收到它的 SYN-ACK,可能因旧的重复连接请求导致错误建连。" \
  -t "科技" \
  -k "TCP三次握手"

Auto-dedups by normalized question. Writes store/index.jsonl (canonical) + a

readable Markdown mirror store/cards/YYYY/MM/.md. Report success briefly

(e.g. "📌 已记入 Engram:TCP三次握手 #科技") or stay silent — keep it low-friction.

Daily review push (no user feedback needed)

A scheduled job runs once a day:

python3 engram.py review --push        # weighted sample -> Feishu interactive card

Sampling is implicit — there is no good/hard/again grading. Cards are sampled

with a mild bias toward older cards (near-uniform, so new cards still surface

often). The user just reads; they never have to rate anything. The card shows

questions first (with domain emoji), then answers below, for active recall.

Browser review

python3 engram.py render && open review.html

Self-contained flashcard page: click to flip, filter by domain tag, search.

Quick reference

GoalCommand
---------------
Save a cardengram.py capture -q ... -a ... -t 科技 -k 关键词
Delete (别记)engram.py forget --id ID / --query 关键词 / --last
Daily push (Feishu card)engram.py review --push
Print today's reviewengram.py review
Build HTML pageengram.py render
See stats / domainsengram.py stats
List recent cardsengram.py list -n 20

版本历史

共 2 个版本

  • v1.0.1 Initial release 当前
    2026-06-05 17:23 安全 安全
  • v1.0.0 Initial release
    2026-06-04 20:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,056 📥 796,390
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,211 📥 266,210
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,350 📥 317,745