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 agents/labilezhu/everlingo/chat-agent-specgit clone --depth 1 https://github.com/labilezhu/everlingoWrote 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/agents/labilezhu/everlingo/chat-agent-spec)<a href="https://agentmods.dev/agents/labilezhu/everlingo/chat-agent-spec"><img src="https://agentmods.dev/badge/agents/labilezhu/everlingo/chat-agent-spec.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 | $0.00000 | $0.05583 |
| Opus 5 | $0.00000 | $0.02792 |
| Sonnet 5 | $0.00000 | $0.01117 |
| Haiku 4.5 | $0.00000 | $0.00558 |
Grade A, and why
chat-agent-spec scanned grade A with 0 findings 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 5d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 339 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Chat Agent
应实现于: /src/everlingo/agents/agent.py ,主要实现在 class MainAgent 。
Chatbot 中处理用户输入的消息,均应该使用 langchain 的 agent 去处理。
这里的 langchain 的 agent , 可由类似以下的代码来创建:
from langchain.agents import create_agent
agent = create_agent("openai:gpt-5.5", tools=tools)
用户意图分析、执行、回复响应
用户意图的分析,应该交由 LLM / langchain agent 去判断,而不是代码实现。
envelope.task 的作用
envelope 的 task 字段表达用户偏好的任务(translate / look_up / none),
是偏好而非命令。即使 task=translate,用户仍可追问其他问题,LLM 应按消息实际内容识别意图。
task 仅作为优先级提示:look_up 偏向查单词,translate 偏向翻译,none 不影响意图识别。
用户意图类型 按识别优先级从高到低分为(与 system prompt agent.py 中 _build_system_prompt() 一致):
- 查单词
- 翻译
- 语言学习问题智能问答
- 管理 USER.md
- 查询配置(只读;禁止修改
everlingo.yaml) - 未识别输入
- 笔记读取和浏览
- 抽取对话内容到笔记
- 笔记删除
- 笔记编辑
其中 #8 走异步 request_memory_extraction 工具(见下文「记忆抽取触发」节);#9 / #10 走同步 memory_writer_action 工具(见下文「笔记删除与编辑」节)。
Agent 的用户意图分析 与 用户意图的执行与回复响应 见 Agent 的 system prompt:
src/everlingo/agents/agent.py 中的 _build_system_prompt()
结构化用户输入(envelope)(2026-07)
system prompt 在 ## 用户意图分类 之前新增 ## 结构化用户输入(envelope) 节,说明 <envelope> 标签包裹的 JSON 输入格式及各字段含义。所有 Channel 统一产 UserInputEnvelope(详见 envelope-spec.md),LLM 看到的用户消息始终是 {envelope} 序列化格式。
本地加载:envelope schema 是 agent 输入契约(代码资产),在 _refresh_agent_if_needed() 中从 src/everlingo/agents/spec/ 包本地加载(PackageSource("everlingo.agents.spec") + compile_prompt),经 shift_headings(+2) 后注入到 ## 结构化用户输入(envelope) 节(h1→h3 嵌套于外层 h2 之下)。不依赖 vault 在线,无兜底需求。
该节附加一条延续语义规则:当 task=look_up 且 chat.message 为空且 chat_context.resource_contexts 不含 selected_text 项时,视为"延续上一轮笔记话题"——LLM 不应回复"未收到输入",而应基于对话历史继续推进相关工作(如读取/编辑上一轮提到的笔记)。该规则同时写入 agent.py system prompt。
invoke -> ainvoke
MainAgent.invoke 为 async 方法 ainvoke,因为 MCP 工具(vault 只读)需要异步 session。
Session.run 用 await self.agent.ainvoke(...) 调用。
system prompt 构造
system prompt 刷新
由于 system prompt 使用了 User Profile 与 用户自由偏好笔记 (USER.md) 。而用户/Agent 可能动态修改它们。所以 system prompt 也要刷新。
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.
- 5d ago First seen · 339 lines · 0 tokens per session scan A 2142a4f66298
chat-agent-spec is an agent published in the GitHub repository labilezhu/everlingo (12 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,583 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
context
You are the Context agent. Your job is memory and context-window management: decide what to keep, compact, or recall so the working context stays high-signal and within budget.
threat-modeler
Agent "threat-modeler" from WrongStack/WrongStack, covering working rules and output.
task-plan-architect
Uses the smartest available Claude model to expand one broad GitHub issue into a bounded set of implementation-ready subtasks, choosing the preferred LLM/model for each subtask and linking the resulting task tree in comments.
ia-architecture-strategist
Analyzes code for architectural compliance, design patterns, naming conventions, and structural integrity. Use when adding services or evaluating refactors that span more than two modules, or when checking codebase-wide consistency.
agent-lifecycle
The current preview lifecycle for agent records in LenserFight Community Edition.
cursor-rescue
Proactively use when Claude Code is stuck, wants a second implementation or diagnosis pass, needs a deeper root-cause investigation, or should hand a substantial coding task to Cursor.