# Multi-Swarm API Documentation

Welcome to the Multi-Swarm API documentation. This guide provides comprehensive information about the framework's components and their usage.

## Core Components

### [Agency](core.md#agency)
The main coordinator for multi-agent systems. Manages agent communication, knowledge sharing, and task coordination.

- Agency initialization and configuration
- Knowledge management methods
- Communication handling
- State persistence
- Error handling

### [Agent](core.md#agent)
Base class for creating specialized agents with specific capabilities.

- Agent initialization
- Task-specific configurations
- Provider selection
- Message processing
- Tool management

### [RAGAgent](core.md#ragagent)
Specialized agent class for knowledge retrieval and coordination.

- Knowledge addition and retrieval
- Coordinated search capabilities
- Document management
- Embedding generation

### [Document](core.md#document)
Represents a document in the RAG system.

- Document creation and management
- Metadata handling
- Embedding storage
- Serialization methods

### [SearchResult](core.md#searchresult)
Represents search results from the RAG system.

- Result scoring
- Metadata association
- Result reflection
- Confidence metrics

### [RAGSystem](core.md#ragsystem)
Advanced retrieval and augmentation capabilities.

- Document indexing
- Semantic search
- Result synthesis
- Knowledge coordination

## Provider Support

### Claude (Anthropic)
- Models: claude-3-5-sonnet-latest, claude-3-5-opus-latest
- Capabilities: Complex reasoning, code generation, research
- Configuration options and best practices

### Gemini (Google)
- Models: gemini-2.0-flash-exp
- Capabilities: Fast processing, real-time operations
- Configuration options and best practices

## Features

### Knowledge Management
- Document storage and retrieval
- Semantic search capabilities
- Knowledge coordination across agents
- Temporal awareness

### Communication
- Inter-agent messaging
- Message broadcasting
- Thread management
- Flow control

### State Management
- State persistence
- State recovery
- Configuration management
- Resource cleanup

### Error Handling
- Comprehensive error types
- Recovery strategies
- Logging and monitoring
- Best practices

## Best Practices

### Agency Configuration
- Feature enablement
- Storage configuration
- Communication flow setup
- Resource management

### Agent Design
- Task-specific configurations
- Provider selection
- Temperature optimization
- Tool integration

### Knowledge Management
- Metadata standards
- Search optimization
- Quality monitoring
- Coordination patterns

### Resource Management
- File cleanup
- Usage monitoring
- Error handling
- Performance optimization

## Examples

Find practical examples of using the Multi-Swarm API in our [examples directory](../examples/).

## Version History

### 1.0.4 (Latest)
- Enhanced knowledge coordination across agents
- Improved temporal awareness in document retrieval
- Better knowledge gap detection and analysis
- Advanced knowledge synthesis capabilities
- Optimized collaborative search functionality
- Improved communication flows
- Enhanced state management
- Better error handling

### 1.0.3
- Enhanced RAG capabilities with temporal awareness
- Improved knowledge gap detection
- Task-specific model configurations
- Advanced provider selection

### 1.0.2
- Added multi-LLM support
- Improved state management
- Enhanced error handling

### 1.0.1
- Initial public release
- Basic agency and agent support
- Simple RAG capabilities 