This project demonstrates a multi-agent system using Semantic Kernel and A2A for a restaurant food ordering scenario. The system consists of a backend agent server and a customer-facing client, both communicating via HTTP APIs.
- Order food from a restaurant menu using natural language
- Multi-turn conversation support
- Modular agent design using Semantic Kernel and A2A
- Easily extensible for more restaurant or menu features
- AgentServer: Hosts the
SemanticKernelFoodOrderingAgent
and exposes an A2A-compatible API for food ordering. - CustomerAgent: FastAPI app with a
/chat
endpoint and a sample UI for customers to place food orders.
pip install -r requirements.txt
Create a .env
file in both AgentServer
and CustomerAgent
folders with the following content:
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
AZURE_OPENAI_ENDPOINT=https://your-azure-endpoint.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=your-deployment-name
AZURE_OPENAI_API_VERSION=2025-01-01-preview
cd AgentServer
python -m __main__
The agent server will start on port 9999.
cd CustomerAgent
python customer-agent.py
The customer API/UI will start on port 8000.
- Open your browser to
http://localhost:8000
to use the sample food ordering UI. - Or, POST to
http://localhost:8000/chat
withuser_input
to interact programmatically.
You can create a custom user interface using your preferred frontend framework. Here's an example of a modern React.js implementation of the food ordering system:
Watch the demo video: Food Ordering System Demo
The food ordering agent UI source code can be found here: GitHub Repository
The React.js implementationprovides a more sophisticated user interface while still communicating with the same /chat
endpoint on port 8000. Key features of this UI include:
- Modern, responsive design
- Interactive menu selection
- Real-time order updates
- Enhanced user experience
To implement your own React.js frontend:
- Create a new React application
- Configure the API endpoint to communicate with the Customer Agent
- Design your UI components
- Handle the chat interactions with the backend
- "Order a Margherita pizza and a Coke."
- "I would like two cheeseburgers and fries."
- "Can I get a vegan salad and sparkling water?"
- To add more menu items or logic, update the agent code in
AgentServer/agent.py
. - To build a custom UI, connect your frontend to the
/chat
endpoint on port 8000.
- CORS is enabled for development. Restrict origins in production.
- All secrets are loaded from
.env
files usingpython-dotenv
.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the food ordering agent or add new features.
Built with Semantic Kernel and A2A.