gitmyhub

TraceClaw

Python ★ 12 updated 12d ago

👾 下一代透明智能体架构 | Next-Gen Transparent Agent Architecture 🔍 全行为审计 | 🛡️ 两段式安全调用 | 🧠 双水位记忆 | ⏰ 心跳任务 📊 P0 级事故率降低 80% | 兼容 OpenClaw + Claude Code 技能生态 | 📕支持飞书远程通信 | 🏗️ Harness 约束层 | 🔎 Trace 全链路审计

A Python framework for building AI assistants that log every step they take, use a two-step safety check before running tools, maintain persistent memory across sessions, and can receive and reply to messages in Feishu group chats.

Pythonsetup: hardcomplexity 4/5

TraceClaw is a Python framework for building AI assistants that show their work. The central idea is that AI systems often behave like black boxes, making decisions and taking actions without explanation. TraceClaw tries to fix that by logging every step the AI takes in a structured format, so you can see exactly what inputs it received, what tools it called, and what results came back.

The safety design uses a two-step process before any tool actually runs. First the AI reads the tool's documentation, then it decides whether to proceed with that specific tool or pick a different one. The README claims this reduces the rate of critical mistakes by about 80% compared to single-step tool execution.

Memory works in two layers. A long-term profile file stores facts about the user that persist across sessions, such as preferences or job context. A short-term layer in a local database stores summaries of recent conversations and trims old context automatically to avoid running out of token space.

A background heartbeat process checks a task queue every second and fires scheduled reminders or actions at set times, including daily, weekly, and monthly repeating tasks. These tasks survive a restart because they are saved to a local file.

The framework can connect to Feishu, a business messaging platform popular in China (also known as Lark outside China), so the AI can receive messages from a Feishu group and reply directly into that conversation. This makes it possible to interact with the agent from a phone without running a separate interface.

TraceClaw supports skills from two other projects (OpenClaw and Claude Code) without requiring rewriting, and it works with several AI providers including OpenAI-compatible APIs, Anthropic, and several Chinese cloud AI services. The primary documentation and interface text is in Chinese, though the code structure follows standard Python conventions.

Where it fits