Getting Started with AMCP

Get up and running with the Agent Mesh Communication Protocol in minutes

📚 5 min read 🚀 Beginner friendly 💻 Cross-platform
## What is AMCP? The **Agent Mesh Communication Protocol (AMCP)** is an enterprise-grade framework for building distributed multi-agent systems. It provides a robust, scalable foundation for agent-to-agent communication, coordination, and collaboration. ### Key Features - 🤖 **Multi-Agent Architecture**: Seamless communication between distributed agents - ⚡ **Event-Driven**: Real-time message passing and event handling - 🧠 **LLM Integration**: Built-in support for Large Language Models - 🌐 **Scalable**: Designed for enterprise-grade deployments - 🔒 **Secure**: End-to-end encryption and authentication - 📊 **Observable**: Comprehensive monitoring and logging ## Quick Installation ### Prerequisites Before installing AMCP, ensure you have: - **Java 17+** (OpenJDK or Oracle JDK) - **Maven 3.8+** for dependency management - **Git** for source code management ### Option 1: Download Release Download the latest release from our GitHub repository: ```bash # Download latest release curl -L https://github.com/agentmeshcommunicationprotocol/amcpcore.github.io/releases/latest/download/amcp-core.jar -o amcp-core.jar # Run AMCP java -jar amcp-core.jar ``` ### Option 2: Build from Source Clone and build the AMCP core framework: ```bash # Clone the repository git clone https://github.com/agentmeshcommunicationprotocol/amcpcore.github.io.git cd amcpcore.github.io # Build the project mvn clean install # Run tests mvn test # Start AMCP mvn exec:java -Dexec.mainClass="io.amcp.core.AMCPApplication" ``` ### Option 3: Maven Dependency Add AMCP to your existing Maven project: ```xml io.amcp amcp-core 1.5.0 ``` ## Your First AMCP Agent Let's create a simple agent to demonstrate AMCP capabilities: ### 1. Create Agent Class ```java package com.example.agents; import io.amcp.core.Agent; import io.amcp.core.Message; import io.amcp.core.annotations.AgentComponent; @AgentComponent("weather-agent") public class WeatherAgent extends Agent { @Override public void initialize() { super.initialize(); log.info("Weather Agent initialized"); } @Override public void handleMessage(Message message) { if ("GET_WEATHER".equals(message.getType())) { String location = message.getPayload("location"); String weather = getWeatherForLocation(location); Message response = Message.builder() .type("WEATHER_RESPONSE") .payload("weather", weather) .payload("location", location) .build(); sendMessage(message.getSender(), response); } } private String getWeatherForLocation(String location) { // Simulate weather API call return "Sunny, 22°C in " + location; } } ``` ### 2. Configure Agent Registry ```java package com.example.config; import io.amcp.core.AgentRegistry; import io.amcp.core.config.AMCPConfiguration; import com.example.agents.WeatherAgent; public class AgentConfiguration { public static void configureAgents(AgentRegistry registry) { // Register weather agent registry.registerAgent("weather-agent", WeatherAgent.class); // Configure agent properties registry.setAgentProperty("weather-agent", "api.key", "your-api-key"); registry.setAgentProperty("weather-agent", "cache.ttl", "300"); } } ``` ### 3. Start AMCP Application ```java package com.example; import io.amcp.core.AMCPApplication; import io.amcp.core.AgentRegistry; import com.example.config.AgentConfiguration; public class WeatherApp { public static void main(String[] args) { // Initialize AMCP AMCPApplication app = new AMCPApplication(); // Configure agents AgentRegistry registry = app.getAgentRegistry(); AgentConfiguration.configureAgents(registry); // Start the application app.start(); System.out.println("AMCP Weather Application started!"); } } ``` ### 4. Test Your Agent ```java package com.example.test; import io.amcp.core.Message; import io.amcp.core.AgentRegistry; public class WeatherTest { public static void testWeatherAgent(AgentRegistry registry) { // Create weather request Message request = Message.builder() .type("GET_WEATHER") .payload("location", "San Francisco") .build(); // Send message to weather agent registry.sendMessage("weather-agent", request); } } ``` ## Configuration AMCP uses a flexible configuration system. Create `amcp.properties`: ```properties # AMCP Core Configuration amcp.cluster.name=my-amcp-cluster amcp.cluster.port=8080 amcp.cluster.discovery=multicast # Agent Configuration amcp.agents.auto-discovery=true amcp.agents.heartbeat.interval=30s amcp.agents.timeout=60s # Messaging Configuration amcp.messaging.protocol=tcp amcp.messaging.compression=true amcp.messaging.encryption=true # Monitoring Configuration amcp.monitoring.enabled=true amcp.monitoring.port=9090 amcp.monitoring.metrics.export=prometheus ``` ## Next Steps Now that you have AMCP running, explore these advanced topics: ### 📚 Learn More - [Architecture Overview](/docs/architecture/) - Understand AMCP's design - [Agent Development](/docs/agents/) - Build sophisticated agents - [API Reference](/docs/api-reference/) - Complete API documentation ### 🎯 Try Examples - [Weather Agent](/examples/weather-agent/) - Complete weather service - [Chat System](/examples/meshchat/) - Multi-agent chat application - [LLM Integration](/examples/orchestration/) - AI-powered agents ### 🛠️ Advanced Topics - [Custom Protocols](/docs/protocols/) - Implement custom communication - [Clustering](/docs/clustering/) - Scale across multiple nodes - [Security](/docs/security/) - Secure your agent network