tencentcloudbase/cloudbase-ai-toolkit/py
Claude Code and agent skill by tencentcloudbase/cloudbase-ai-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming + OpenAI-compatible endpoints, add tools (bash, filesystem, MCP, code execution), memory (in-memory, TDAI, MySQL, MongoDB), observability (OpenTelemetry/Langfuse), and middleware (auth, logging). Use this skill when the user wants to create an AI agent server, build a chatbot backend, set up human-in-the-loop workflows, integrate MCP tools, add agent observability, or deploy an agent API — even if they don't explicitly mention 'CloudBase Agent.'
Install
npx vskill@latest install tencentcloudbase/cloudbase-ai-toolkit/pySKILL.md
The same SKILL.md was published earlier as tencentcloudbase/cloudbase-ai-toolkit/py.
CloudBase Agent Python SDK
Build production-ready AI agent backends with multi-framework support, streaming protocol, rich tools, persistent memory, and full observability.
Note: This skill is for Python projects only.
When to use this skill
Use this skill for AI agent development when you need to:
- Deploy AI agents as HTTP services with AG-UI protocol support
- Build agent backends using LangGraph, CrewAI, or LlamaIndex frameworks
- Create custom agent adapters implementing the AbstractAgent interface
- Understand AG-UI protocol events and message streaming
- Build production-ready agent servers with FastAPI
Do NOT use for:
- Simple AI model calling without agent capabilities (use
ai-model-*skills) - CloudBase cloud functions (use
cloud-functionsskill) - CloudRun backend services without agent features (use
cloudrun-developmentskill) - TypeScript/JavaScript agent projects (use
cloudbase-agentskill, refer to thets/sub-directory)
How to use this skill (for a coding agent)
- Choose the right adapter
- Use LangGraph adapter for stateful, graph-based workflows
- Use CrewAI adapter for multi-agent collaboration patterns
- Build custom adapter for specialized agent logic
- Write agent code — follow the adapter-specific doc from the Routing table
- Deploy the agent server — follow the blocking deployment pipeline in agent-deployment
Routing (Execution Order)
⚠️ Deployment is a BLOCKING 4-step pipeline. Steps marked ✅ BLOCKINGmust be completed AND verified before proceeding to the next step.Do NOT callmanageAgentuntil all blocking steps pass.
| Step | Task | Document | Blocking? | |
|---|---|---|---|---|
| 0 | Choose adapter & write agent code | See "Adapter Selection" below | — | |
| 1 | Ensure Python 3.10 | agent-deployment § Step 1 | ✅ BLOCKING | |
| 2 | Build env/ (one-shot) | agent-deployment § Step 2 | ✅ BLOCKING | |
| 3 | Verify env/ integrity | agent-deployment § Step 3 | ✅ BLOCKING | |
| 4 | Deploy with manageAgent | agent-deployment § Step 4 | — |
Adapter Selection (Step 0)
| Framework | Read | Install | |
|---|---|---|---|
| LangGraph (stateful graphs) | adapter-langgraph | cloudbase-agent-langgraph | |
| CrewAI (multi-agent crews) | adapter-development | cloudbase-agent-crewai | |
| Coze platform | adapter-coze | cloudbase-agent-coze | |
| Custom / raw FastAPI | server-quickstart + adapter-development | cloudbase-agent-server |
Additional References (read on demand, NOT required for deployment)
| Task | Read | |
|---|---|---|
| Server setup, middleware, multi-agent, CORS | server-quickstart | |
| Authentication and user context | authentication |
Quick Start (Framework-Agnostic)
Prerequisites: Python >= 3.10 is required.
1. Install dependencies (pick ONE adapter):
2. Create server entry point:
3. Deploy to CloudBase:
Follow the 4-step deployment pipeline in agent-deployment.
Architecture
Installation
CloudBase Agent Python SDK is published to PyPI as separate packages. Note: PyPI package names use hyphens (`cloudbase-agent-*`), and Python imports use the same namespace (`cloudbase_agent.*`).
Import Note: All packages share the cloudbase_agent namespace:
Reference Documents
Based on what the user needs, read the corresponding reference document. Only read the relevant reference — don't load all of them.
| User Need | Reference | What It Covers | |
|---|---|---|---|
| Deploying agent to CloudBase | Read agent-deployment | manageAgent MCP tool (MUST USE), 4-step blocking pipeline, Python 3.10, env/ build, verification | |
| Server setup, deployment, middleware, multi-agent, CORS | Read references/server.md | AgentServiceApp 3 deployment methods, middleware (generator/yield/onion model), multi-agent server, Agent Creator pattern, health checks | |
| LangGraph agent, callbacks, tool proxy, HITL, checkpoints | Read adapter-langgraph | LangGraphAgent constructor, AgentCallback protocol, ToolProxy, human-in-the-loop with interrupt(), TDAICheckpointSaver, client-defined tools | |
| Tools: bash, filesystem, code execution, MCP, custom tools | Read references/tools.md | create_bash_tool, 8 file tools, code executors, MCPToolkit/CloudBaseMCPServer, @tool decorator, BaseTool, framework adapters | |
| Memory, persistence, short/long-term, MySQL, MongoDB | Read references/storage.md | InMemoryMemory, TDAIMemory, MySQLMemory, MongoDBMemory, TDAILongTermMemory, Mem0LongTermMemory, LangGraph checkpoint | |
| Tracing, monitoring, Langfuse, OpenTelemetry | Read references/observability.md | ConsoleTraceConfig, OTLPTraceConfig, setup_observability, env vars, manual observation spans | |
| Common patterns, JWT auth, MCP integration, production | Read references/recipes.md | JWT middleware, MCP + LangGraph, production deployment, adding tools to agents, client-defined tools |
Key Imports Quick Reference
Project Structure Convention
Environment Variables
| Variable | Purpose | |
|---|---|---|
OPENAI_API_KEY | OpenAI API key | |
AUTO_TRACES_STDOUT | Enable console tracing (true) | |
LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY | Langfuse keys | |
TDAI_ENDPOINT / TDAI_API_KEY | TDAI memory/checkpoint endpoint | |
SCF_RUNTIME_PORT | CloudBase runtime port (set automatically during deployment) |
Key Design Decisions
- Agent Creator Pattern: Every request creates a fresh agent via factory function. Supports cleanup callbacks for resource release.
- Dual Protocol: Every agent supports both AG-UI native (SSE + rich events) and OpenAI-compatible (
/chat/completions). - Middleware = Generator: Use
yield— pre-yield = pre-processing, post-yield = post-processing (onion model). - Namespace Package:
cloudbase_agentspans multiple PyPI packages (cloudbase-agent-core, cloudbase-agent-server, cloudbase-agent-langgraph, etc.). PyPI names use hyphens, but all imports usefrom cloudbase_agent.xxx import .... - Observability Auto-Integration: Install
cloudbase-agent-observabilityand tracing works automatically — zero config needed. - Deploy with manageAgent: Always use the
manageAgentMCP tool for CloudBase deployment. Follow the 4-step blocking pipeline in agent-deployment.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingconfig/source/skills/cloudbase-agent/py/skill.md
Popularity
- Repository stars
- 1,130
- Repository forks
- 146
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tencentcloudbase/cloudbase-ai-toolkit/py)