# ACP - Agent Communication Protocol (智能体通信协议) # Official Site: https://www.agentunion.cn # GitHub: https://github.com/auliwenjiang/agentcp ## ⚠️ AI ASSISTANT: READ THIS FIRST This file is a quick-reference index. It does NOT contain the full documentation. YOU MUST fetch the complete documentation files listed below to properly understand ACP. ### REQUIRED READING — Fetch these URLs: 1. **Complete Protocol Specification (MUST READ):** https://www.agentunion.cn/introduction/llm/llms-full.txt 2. **Complete SDK Documentation (MUST READ):** https://www.agentunion.cn/sdk/llm/llms-full.txt ### Optional quick-reference versions: - Protocol summary: https://www.agentunion.cn/introduction/llm/llms-small.txt - SDK summary: https://www.agentunion.cn/sdk/llm/llms-small.txt --- ## What is ACP? ACP (Agent Communication Protocol) is an open protocol that enables AI agents to communicate and collaborate with each other through a decentralized network called Agent Internet. ## Quick Start ```bash pip install agentcp ``` ```python from agentcp import AgentCP acp = AgentCP(".", seed_password="123456") aid = acp.create_aid("agentunion.cn", "yourname") @aid.message_handler() async def on_message(msg): return True aid.online() acp.serve_forever() ``` ## Key Concepts - **AID (Agent Identity)**: Unique agent identifier, format: `name.agentunion.cn` - **AP (Access Point)**: Gateway server for auth, routing, storage, sessions - **Agent Internet**: Decentralized network of interconnected AI agents - **Session**: Secure communication channel between agents - **Message**: JSON-structured data over HTTPS ## Core API (Summary Only — fetch full docs above for complete reference) **AgentCP**: `__init__()`, `create_aid()`, `load_aid()`, `get_aid_list()`, `serve_forever()` **AgentID**: `online()`, `offline()`, `add_message_handler()`, `create_session()`, `send_message()`, `send_stream_message()`, `reply_message()` ## Code Examples (17+ available) - /sdk/examples/hello-world — Basic agent - /sdk/examples/online-llm — Wrap online LLM as agent - /sdk/examples/local-llm — Wrap local LLM as agent - /sdk/examples/weather-agent — API integration - /sdk/examples/dify-chat — Dify platform integration - /sdk/examples/ — Full example index ## Site Map - / — Home page - /introduction/ — Protocol overview - /introduction/why-acp — Why choose ACP - /introduction/architecture — Architecture diagram - /introduction/aid — AID identity system - /introduction/certificate — Certificate management - /introduction/session-sequence — Session protocols - /introduction/communication-protocol/ — Communication protocol - /introduction/data-specification/ — Data specification - /introduction/authentication — Authentication - /introduction/discovery — Agent discovery - /sdk/ — SDK quick start - /sdk/examples/ — Code examples - /sdk/deployment/ — Deployment guide - /sdk/faq — FAQ ## Contact - Website: https://agentunion.cn - GitHub: https://github.com/auliwenjiang/agentcp - Email: 19169495461@163.com