← 返回 Skills 市场
aaroncxxx

老子智能体

作者 aaroncxxx · GitHub ↗ · v0.2.0 · MIT-0
cross-platform ⚠ suspicious
59
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install laozi-agent
功能描述
老子智能体(李耳)— 基于 RAG 的《道德经》问答系统。使用 LangChain + Chroma 向量数据库, 检索增强生成,以老子身份回答关于道家思想和《道德经》的问题。 支持多版本原文对比、思想主题导航、对话记忆。 触发场景:用户提到"老子"、"道德经"、"道家"、"请问老子"、"老子说"、"李耳"、 "...
使用说明 (SKILL.md)

老子智能体 SKILL

基于 LangChain + Chroma 的 RAG 问答系统,以春秋时期思想家老子(李耳)的身份回答问题。

前置依赖

pip install -r requirements.txt

无需 API Key。Embedding 使用 BAAI/bge-base-zh-v1.5(本地加载),LLM 使用 Qwen2.5-72B(HuggingFace 免费推理 API)。

快速启动

# Web 界面(推荐)
python3 app.py

# 或命令行交互
python3 scripts/laozi_agent.py

核心功能

1. 问答 (laozi_skill)

以老子身份回答问题,引用《道德经》原文,返回引用来源。

from scripts.laozi_agent import laozi_skill
result = laozi_skill("什么是道?")
# result["answer"] — 老子的回答
# result["sources"] — 引用来源列表

2. 多版本对比 (compare_versions)

对比同一章节的不同版本原文(郭店楚简、马王堆帛书、王弼注本等)。

from scripts.laozi_agent import compare_versions
versions = compare_versions(1)  # 对比第1章

3. 主题导航 (get_topics / get_topic_content)

获取老子思想主要主题及相关内容。

from scripts.laozi_agent import get_topics, get_topic_content
topics = get_topics()
content = get_topic_content("道论")

知识库结构

知识库目录 ./laozi_knowledge_base/,向量集合名 laozi_collection

文档元数据字段:

  • type — "原文" / "注释" / "研究"
  • version — 版本名(郭店楚简本、马王堆帛书甲本 等)
  • chapter — 章节号
  • topic — 主题标签(道论、德论 等)
  • title — 书名/篇名
  • page — 页码

详细书单见 references/knowledge_base_booklist.md

配置项

scripts/laozi_agent.py 顶部可调整:

参数 默认值 说明
EMBEDDING_MODEL BAAI/bge-base-zh-v1.5 向量模型(中文优化,免费)
LLM_MODEL Qwen/Qwen2.5-72B-Instruct 生成模型(免费推理)
TEMPERATURE 0.3 温度(越低越严谨)
RETRIEVAL_K 5 返回文档数
FETCH_K 20 MMR 候选池大小
PERSIST_DIR ./laozi_knowledge_base 向量库目录
COLLECTION_NAME laozi_collection 集合名

准确性保障

  • 低温度 (0.1) 减少幻觉
  • MMR 检索 兼顾相关性与多样性
  • 强制引用原文 — Prompt 要求先引原文再解释
  • 未知就说不知 — 超出范围回答"吾不知也"
  • 禁止编造 — 严禁无上下文支持的内容

注意事项

  1. 严格区分道家(哲学)与道教(宗教),不涉及神仙体系
  2. 坚持学术中立,避免过度解读
  3. 有争议问题说明不同学者观点
  4. 保持老子本人的谦逊态度
安全使用建议
Review before installing if you may ask sensitive questions or add private documents. Treat the app as a hosted-model chatbot: prompts, retrieved text, and conversation history may be sent to Hugging Face, and some scripts may require or use OpenAI APIs despite the no-API-key wording. Use only non-sensitive source documents unless the publisher adds explicit privacy disclosure, consent/local-only controls, and removes or documents the OpenAI code paths.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The RAG chatbot, Chroma vector store, Gradio UI, bundled Laozi texts, and local persistence fit the stated purpose, but the artifacts mix a Hugging Face-hosted LLM path with leftover OpenAI-based CLI/setup paths despite advertising a fully free/no-API-key approach.
Instruction Scope
SKILL.md uses broad activation keywords such as Laozi, Daoism, wuwei, and topic names, which could trigger the persona/RAG workflow during ordinary discussion before the user clearly intends remote inference.
Install Mechanism
The install path is conventional Python dependencies from public registries, and the supplied static scan and dependency registry scan are clean; VirusTotal telemetry was not supplied.
Credentials
The main app sends prompts, retrieved passages, and conversation memory to HuggingFaceHub, while setup/CLI code can use OpenAIEmbeddings or ChatOpenAI; these remote data flows are only partially disclosed and lack an explicit privacy notice or local-only control.
Persistence & Privilege
Local Chroma persistence in ./laozi_knowledge_base and in-process conversation memory are expected for a RAG assistant, but users adding private documents to the source directory could have them embedded or used in remote prompts depending on the code path.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install laozi-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /laozi-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.0
v0.2.0: 全免费方案 + Gradio Web 界面。Embedding: BGE-base-zh, LLM: Qwen2.5-72B, 无需API Key
v0.1.0
初始发布: 帛书甲本81章 + 王弼本81章, RAG问答/版本对比/主题导航
元数据
Slug laozi-agent
版本 0.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

老子智能体 是什么?

老子智能体(李耳)— 基于 RAG 的《道德经》问答系统。使用 LangChain + Chroma 向量数据库, 检索增强生成,以老子身份回答关于道家思想和《道德经》的问题。 支持多版本原文对比、思想主题导航、对话记忆。 触发场景:用户提到"老子"、"道德经"、"道家"、"请问老子"、"老子说"、"李耳"、 "... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 59 次。

如何安装 老子智能体?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install laozi-agent」即可一键安装,无需额外配置。

老子智能体 是免费的吗?

是的,老子智能体 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

老子智能体 支持哪些平台?

老子智能体 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 老子智能体?

由 aaroncxxx(@aaroncxxx)开发并维护,当前版本 v0.2.0。

💬 留言讨论