Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/fish827-08/rag-kb/kb-memorynpx skills add fish827-08/rag-kb --skill kb-memorygit clone --depth 1 https://github.com/fish827-08/rag-kbWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/fish827-08/rag-kb/kb-memory)<a href="https://agentmods.dev/skills/fish827-08/rag-kb/kb-memory"><img src="https://agentmods.dev/badge/skills/fish827-08/rag-kb/kb-memory.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01095 |
| Opus 5 | $0.00000 | $0.00548 |
| Sonnet 5 | $0.00000 | $0.00219 |
| Haiku 4.5 | $0.00000 | $0.00110 |
Grade A, and why
kb-memory scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- curl 是 Invoke-WebRequest 的**别名,不是原生 curl**:参数完全不同,直接写 curl 必然报错。 How it starts
The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.
name: kb-memory description: kb 本地记忆与知识服务接入规约。当会话需要给用户写入/检索长期记忆、导入文档/网页做 RAG 问答、或用户提到"kb 记忆/MCP 工具"时使用。已挂载 kb MCP 的客户端自动获得全局规约(instructions),本 skill 主要用于未挂载 MCP 时的 HTTP 兜底。
kb-memory:本地 Agent 记忆与知识服务接入规约
kb 是本机常驻服务(默认 http://127.0.0.1:8000),本地优先、免费、断网可用, 写入/检索不依赖大模型(仅 ask 问答需要 LLM)。接入前无需探测服务是否在跑—— 直接调用即可,一切正常就继续工作;只有工具/HTTP 调用报连接失败时才提示服务未启动。
1. 核心规约
-
记忆与知识全共享:任何客户端/任务写入的记忆对所有会话可见,跨 agent 跨任务共享。 不用传 client/project(仅审计归类),不传也完整可用;服务端自动识别来源客户端。
-
何时写入(write_memory,精炼 1~3 句):用户偏好 / 项目决策 / 事实与约定 / 敏感约束 / 任务进度。 不写:寒暄、临时计算、代码文档里能查到的实现细节。
-
写前查重:先 search_memory,已有同类则 update_memory 覆盖,不新增重复。
-
敏感不入库:密钥、凭据、身份证号等严禁写入。
-
何时检索:任务开始 / 回答涉及历史决策偏好 / 跨会话接力时,先 search_memory 主动召回。
2. 对用户反馈(极简)
-
写入/更新成功:只轻提一句(如"已记住你的偏好");失败才说明原因 (如"没记:与已有记忆重复 / 内容敏感 / 格式不支持")。
-
不要展示:健康检查过程、工具名、记录 ID、JSON、检索命中详情。
-
仅在工具/HTTP 调用真正报连接失败时,简提"kb 服务未启动,需先运行 python -m kb serve",不臆造结果。
3. 接入方式
-
MCP(首选):write_memory / search_memory / read_memory / update_memory / delete_memory / add_document / add_webpage / ask_kb(8 个工具,全共享,无归属限制)。
-
HTTP 兜底(未挂载 MCP 时):
-
写:POST /api/v1/memories {"content":"…","tags":["…"]}
-
检索:POST /api/v1/search {"query":"…","top_k":5}
-
问答:POST /api/v1/ask {"question":"…"}(LLM 未配 → LLM_DISABLED)
-
文档/网页入库:POST /api/v1/documents(multipart 或 {"path":"…"})、POST /api/v1/ingest/web {"url":"…"}
-
Windows PowerShell 注意事项
-
curl 是 Invoke-WebRequest 的别名,不是原生 curl:参数完全不同,直接写 curl 必然报错。 统一用 curl.exe 或 Invoke-RestMethod。
-
中文 JSON 必须强制 UTF-8:Windows PowerShell 默认按本机 ANSI/GBK 发送中文,服务端按 UTF-8 解析会全部变成
?乱码。含中文的写/查/答请求都用字节数组发送:
$json = ConvertTo-Json -InputObject @{ content = "用户喜欢的动画片"; tags = @("偏好") }
$bytes = [System.Text.Encoding]::UTF8.GetBytes($json)
Invoke-RestMethod -Uri http://127.0.0.1:8000/api/v1/memories -Method Post -ContentType 'application/json; charset=utf-8' -Body $bytes
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed · -30 lines · -98 tokens per session 3e8586c42632
- 5d ago First seen · 98 lines · 98 tokens per session scan A 295ecb77bd66
kb-memory is a skill published in the GitHub repository fish827-08/rag-kb (2 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,095 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
AgentDB Memory Patterns
Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use when building stateful agents, chat systems, or intelligent assistants.
pinecone-research
Agent RAG and long-term memory with Pinecone.
agent-v3-memory-specialist
Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.
langchain
Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG…
cognee-cli
Use when the user wants to drive cognee from the terminal with cognee-cli — remember/recall/forget/improve memory commands, managing datasets and config, or database migrations.
mem0-integration
Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.