Agent Selma - 一个基于 Python 和 Ollama 的 OpenClaw “玩具”实现
概览
是对OpenClaw项目的简化、教育性重实现。 主要目标是通过从零重建自主智能体的底层架构来理解。通过去除复杂性,Selma 成为学习智能体组件相互作用的清晰基线。 Selma 没有为生产环境加固。没有安全审计,没有 SLA 保证,也没有稳定性或正确性的保证。使用请自行承担风险。 必须安装UV。如果你还没有安装: (本地模型)——从 ollama.com 下载并安装,然后拉取模型: Ollama 安装后会自动作为后台服务运行。请确认其运行状态: 对于浏览器工具(Playwright),只需安装一次Chromium: 运行一次设置脚本,创建.selma/目录,生成默认selma.json,并将技能和模板部署到工作区:
概述(AI 翻译)
一个带有Python的OpenClaw“玩具”实现
🌟 概述
Selma特工是OpenClaw项目的简化教育重实现。
主要目标是通过使用Python从零重建自主智能体的底层架构,来理解它们。通过去除复杂性,Selma为学习智能体组件如何相互作用提供了清晰的基线。
[!警告] 这是一个仅供学习目的的玩具项目。 Selma 未经过生产环境加固。无安全审计、无服务水平协议(SLA)保证,也无稳定性或正确性保证。** 请勿在任何生产或商业环境中使用此软件。** 使用请自行承担风险。
🛠 技术堆栈
| 组件 | 库 |
|---|---|
| 语言 | Python 3.13+ |
| LLM API | Ollama(本地)或任何兼容 OpenAI 的 API |
| 代理框架 | Pydantic AI——看看为什么它没有被使用 |
| Gateway | FastAPI + Uvicorn |
| 仪表盘 | Streamlit |
| Telegram频道 | python-telegram-bot |
| 追踪 | OpenTelemetry + Arize Phoenix |
| 网络工具 | 剧作家、Trafilatura、DDGS |
| 灵感来源 | OpenClaw / PI-Agent |
🚀 安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Agent Selma 👩🏻
A “Toy” Implementation of OpenClaw with Python
🌟 Overview
Agent Selma is a simplified, educational reimplementation of the OpenClaw project.
The primary goal is to deconstruct and understand the underlying architecture of autonomous agents by rebuilding them from scratch using Python. By stripping away complexity, Selma serves as a clean baseline for learning how agentic components interact.
[!WARNING] This is a toy project for learning purposes only. Selma is not hardened for production use. There are no security audits, no SLA guarantees, and no guarantees of stability or correctness. Do not use this in any production or commercial environment. Use at your own risk.
🛠 Tech Stack
| Component | Library |
|---|---|
| Language | Python 3.13+ |
| LLM API | Ollama (local) or any OpenAI-compatible API |
| Agent Framework | Pydantic AI — see why it wasn’t used |
| Gateway | FastAPI + Uvicorn |
| Dashboard | Streamlit |
| Telegram Channel | python-telegram-bot |
| Tracing | OpenTelemetry + Arize Phoenix |
| Web tools | Playwright, Trafilatura, DDGS |
| Inspiration | OpenClaw / PI-Agent |
🚀 Installation
Prerequisites: uv must be installed. If you don’t have it yet:
pip install uv
git clone https://github.com/YOUR_USERNAME/agent-selma.git
cd agent-selma
uv sync
Ollama (for local models) — download and install from ollama.com, then pull a model:
ollama pull llama3.2 # recommended default (~2 GB)
ollama pull qwen2.5:14b # more capable, requires ~9 GB RAM
Ollama runs as a background service automatically after installation. Verify it is running:
ollama list
For the browser tool (Playwright), install Chromium once:
uv run playwright install chromium
⚙️ Configuration
Run the setup script once to create the .selma/ directory, generate a default selma.json, and deploy skills and templates into the workspace:
uv run setup.py
The script is safe to re-run — it never overwrites existing files.
The generated .selma/selma.json contains all available options with their defaults. The most important setting is the model:
"model": {
"model": "ollama/llama3.1",
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add gkvoelkl/python-selma