AgenticFleet API
Fleet Chat
Agent communication and coordination through chat
Fleet Chat
Fleet Chat is the core communication system that enables agents to collaborate and coordinate within AgenticFleet. It provides structured message passing, state management, and coordination patterns.
Chat Architecture
Core Components
Message System
1. Message Types
2. Message Format
Chat Patterns
1. Sequential Chat
2. Swarm Chat
3. Routed Chat
State Management
1. Chat State
2. History Management
Chat API
The Chat API enables real-time communication with agents and fleets through a WebSocket interface.
Start Chat Session
Start a new chat session with an agent or fleet.
WebSocket Connection
wss://api.agenticfleet.com/v1/chat
Connection Parameters
Response
Send Message
Send a message in an active chat session.
WebSocket Message
Response
Stream Response
Get streaming responses from agents.
WebSocket Stream
End Chat Session
End an active chat session.
WebSocket Message
Response
List Chat Sessions
Retrieve a list of chat sessions.
HTTP Request
GET /v1/chat/sessions
Query Parameters
Parameter | Type | Description |
---|---|---|
limit | integer | Maximum number of sessions to return |
offset | integer | Number of sessions to skip |
status | string | Filter by session status |
Response
Get Chat History
Retrieve chat history for a session.
HTTP Request
GET /v1/chat/sessions/{session_id}/history
Query Parameters
Parameter | Type | Description |
---|---|---|
limit | integer | Maximum number of messages to return |
before | string | Return messages before this timestamp |
after | string | Return messages after this timestamp |
Response
Best Practices
1. Message Handling
- Use appropriate message types
- Include necessary metadata
- Implement proper error handling
- Handle message timeouts
2. State Management
- Track chat state properly
- Implement cleanup for inactive chats
- Handle agent disconnections
- Monitor chat metrics
3. Performance
- Use async/await for I/O operations
- Implement message batching
- Use proper indexing for history
- Cache frequently accessed data
4. Security
- Validate all messages
- Implement rate limiting
- Handle sensitive data properly
- Audit message history
Next Steps
- Explore Fleet Patterns
- Learn about Agent Components
- Understand Memory Integration