项目预览
项目数据
项目介绍
Star 增长趋势
本站每日记录该项目 GitHub 星标变化,观测越久曲线越完整
数据来源:GitHub API 逐日快照 · 收录于 2026-08-09 · 当前星标 ★ 18327
使用教程
ℹ 本教程由 AI 依据该项目 README 整理,个别步骤可能需要按你的环境微调。
环境要求
- Python 环境,且 pip 可正常使用(README 用 pip install 安装)
- 能访问 PyPI 网络源以下载 parlant 包
- Python 环境支持 async/await 语法(示例代码使用 async with)
安装与启动步骤
-
1安装 parlant
在命令行执行 pip 安装。README 只给出这一条安装命令,未提供 Docker 或源码安装方式。
pip install parlant -
2编写代理脚本
按 README 示例导入 parlant.sdk,用 p.Server() 上下文创建服务器与客服代理,并定义观察与指导方针。
import parlant.sdk as p async with p.Server(): agent = await server.create_agent( name="Customer Support", description="Handles customer inquiries for an airline", ) # Evaluate and call tools only under the right conditions expert_customer = await agent.create_observation( condition="customer uses financial terminology like DTI or amortization", tools=[research_deep_answer], ) # When the expert observation holds, always respond # with depth. Set the guideline to automatically match # whenever the observation it depends on holds... expert_answers = await agent.create_guideline( matcher=p.MATCH_ALWAYS, action="respond with technical depth", dependencies=[expert_customer], ) beginner_answers = await agent.create_guideline( condition="customer seems new to the topic", action="simplify and use concrete examples", ) # When both match, beginners wins. Neither expert-level # tool-data nor instructions can enter the agent's context. await beginner_answers.exclude(expert_customer) -
3运行脚本
把上一步代码保存为脚本文件后运行,启动 parlant 服务器并加载代理定义。文件名可自行修改。
python main.py -
4完成完整快速上手
README 指向官网 5 分钟 quickstart,按该链接的完整流程走一遍,补齐工具函数等未在 README 中给出的内容。
如何确认成功
脚本运行后 p.Server() 上下文正常启动且控制台无报错,即说明 parlant 已安装并可创建代理;完整功能按官网 quickstart 验证。
常见问题
Q:示例中的 research_deep_answer 报未定义怎么办?
A:README 示例把它当作工具直接引用,但未给出定义。这是演示代码片段,需要你自己实现并注册对应工具后才能运行。
Q:示例里 async with p.Server() 后面直接用 server 变量?
A:README 片段如此书写,可能被裁剪过。若报 NameError,请按官网 quickstart 的完整写法把 Server 上下文绑定到变量再使用。
Q:有 Docker 或环境变量配置说明吗?
A:README 节选中没有提供 Docker 镜像、端口或环境变量配置,只给了 pip 安装与 Python 代码示例,请勿自行假设。
Q:如何查看更多可运行示例?
A:README 提供了官网 Examples 页面和 5-minute quickstart 链接,建议直接访问 parlant.io 的文档与示例章节。
注意事项
- README 仅提供 pip install parlant 一种安装方式,未涉及 Docker、源码编译或云服务部署。
- 示例代码中的 research_deep_answer 等工具需自行实现,直接复制运行可能报错。
- 完整上手请参考官网 5-minute quickstart:https://www.parlant.io/docs/quickstart/installation
- 遇到问题可加入官方 Discord 社区:https://discord.gg/duxWqxKk6J
核心亮点
- 通过代码化指导方针精确控制代理行为,避免输出跑偏
- 内置评估和调试工具,便于验证和优化代理表现
- 支持工具调用和上下文管理,适合复杂业务逻辑
不足之处
- 学习曲线较陡,需要理解指导方针机制
- 文档/社区待观察
适用场景
- 客户支持自动化,确保回答符合公司政策
- 销售线索筛选,按规则引导对话并收集信息
- 内部知识库问答,限制回答范围避免误导
替代项目
LangChain、Dify、Rasa
上一篇:DeepResearch
下一篇:mcp-toolbox
同类项目推荐
dao-code
开源
在终端用 DeepSeek 写代码,跨会话记忆几乎零成本
Open-source TypeScript terminal coding agent for DeepSeek-V4 — builds on DeepSeek's···
lobehub
开源
把 AI 团队组织起来,7×24 小时自动干活
LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already···
event-deep-research
开源
输入历史人物,自动生成结构化事件时间线
AI Agent that researches the lives of historical figures and extracts events into st···
mcd-1024-skill
开源
把麦当劳点餐能力封装成 AI 智能体可直接调用的 MCP 技能
McDonald's China MCP innovation skill - entry for MCD Developer Innovation Challenge···
BotSharp
开源
用 C# 快速搭建企业级多智能体对话系统
AI Multi-Agent Framework in .NET
claude-code-plugins-plus-skills
开源
海量 Claude Code 插件技能,一条命令装好即用
Model-agnostic agent-skills platform with a harness-free canonical layer, verified a···
MCP-Airflow-API
开源
用自然语言控制 Airflow,聊天即可管理 DAG 和任务
⚡ Control Apache Airflow with natural language via MCP. Chat with your workflows us···
Aivatar-Demo
开源
代码写累了抬头看,AI 伙伴就在桌面上陪你。
Aivatar is a local-first desktop companion for AI coding agents. It turns Codex, Cla···
askimo
开源
一个客户端搞定多模型、RAG 和智能体工具调用
AI desktop app for chat, RAG, Skills, MCP tools, and agents. Support multiple LLMs (···
