This project demonstrates how to build a powerful Retrieval-Augmented Generation (RAG) search application that integrates Google's Agent-to-Agent (A2A) protocol with Spring Boot and MongoDB Atlas. It is deployed live on Hugging Face at:
https://vishalmysore-a2amcpmongo.hf.space/
You can discover active agents via:
https://vishalmysore-a2amcpmongo.hf.space/.well-known/agent.json
a2ajava is a Swiss Army knife for building agentic applications. It is multi-protocol โ works seamlessly with both A2A (Agent-to-Agent) and MCP (Model Context Protocol). It is multi-language โ supports Java, Kotlin, and Groovy. It is multi-platform โ compatible with Gemini, OpenAI, Claude, and Grok. It is multi-client โ includes A2A and MCP clients with connectors in Java, Node, and Python. It offers multi-integration โ out-of-the-box support for Selenium, human-in-the-loop workflows, and multi-LLM voting for consensus-based decision making. Agents built using the A2A protocol with a2ajava run seamlessly on MCP as well, ensuring maximum interoperability across platforms.
@Override
public void preProcessing(String method, Object params) {
vectorService.ragStorage(method, params);
}
public void ragStorage(String method, Object params) {
switch (method) {
case "tasks/send":
addTask(new ObjectMapper().convertValue(params, TaskSendParams.class));
break;
case "tasks/get":
addTask(new ObjectMapper().convertValue(params, TaskQueryParams.class));
break;
}
}
https://vishalmysore-a2amcpmongo.hf.space/swagger-ui/index.html
GET https://vishalmysore-a2amcpmongo.hf.space/taskText?name="cricket"
# List Tool
curl -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {
}
},
"id": 1
}' https://vishalmysore-a2amcpmongo.hf.space/
# Start Washing
curl -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "startWashing",
"arguments": {
"provideAllValuesInPlainEnglish": {}
}
},
"id": 1
}' https://vishalmysore-a2amcpmongo.hf.space/
# Stop Washing
curl -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "stopWashing",
"arguments": {
"provideAllValuesInPlainEnglish": {}
}
},
"id": 2
}' https://vishalmysore-a2amcpmongo.hf.space/
# Set Temperature to 40
curl -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "setTemperature",
"arguments": {
"provideAllValuesInPlainEnglish": {
"arg0": 40
}
}
},
"id": 3
}' https://vishalmysore-a2amcpmongo.hf.space/
# Set Cycle Type to 'delicate'
curl -u user:password -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "setCycleType",
"arguments": {
"provideAllValuesInPlainEnglish": {
"arg0": "delicate"
}
}
},
"id": 4
}' https://vishalmysore-a2amcpmongo.hf.space/
# Get Quote for Laundry
curl -u user:password -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getQuoteForLaundry",
"arguments": {
"provideAllValuesInPlainEnglish": {
"arg0": "cotton",
"arg1": "3kg"
}
}
},
"id": 5
}' https://vishalmysore-a2amcpmongo.hf.space/
# Get Machine Status
curl -u user:password -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getStatus",
"arguments": {
"provideAllValuesInPlainEnglish": {}
}
},
"id": 6
}' https://vishalmysore-a2amcpmongo.hf.space/
application.yml
DB_USER
DB_PASSWORD
OPENAI_API_KEY
mvn spring-boot:run
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.