Each agent expects the model endpoint to be OpenAI-compatible (e.g., llama.cpp, llama-cpp-python, OpenAI API, or similar). The endpoint should support POST requests to /v1/chat/completions with the following JSON body:
{
"model": "llama-2-13b",
"messages": [
{"role": "system", "content": "...instructions..."},
{"role": "user", "content": "...code or prompt..."}
],
"temperature": 0.2
}
The model should return a response with a JSON-formatted answer in the first assistant message. See each agent's code for the expected system prompt and output format.
This project implements a fully agentic AI chain for C# codebases. Each stage (analyzer, optimizer, tester, reviewer) is a self-contained, persistent agent running in its own container, communicating via gRPC. The orchestrator coordinates the workflow and supports partial runs.
- protos/agent.proto: gRPC protocol definition for all agents
- agents/*_agent/: Each agent is a containerized gRPC service with persistent state
- orchestrator/: Orchestrator container, manages agent workflow
- docker-compose.yml: Multi-container orchestration
- Each agent exposes a gRPC server implementing the shared protocol
- The orchestrator connects to agents, sends tasks, and passes context/results
- Agents persist their own state (e.g., SQLite, files)
- Supports partial runs and robust error handling
- Build all containers:
docker-compose build
- Start the system:
docker-compose up
- The orchestrator will connect to agents and run the chain
Each agent uses a specialized AI model for its domain. By default, agents use a recommended local/containerized model (e.g., CodeLlama, StarCoder). You can override the model provider and endpoint via environment variables:
MODEL_PROVIDER: The model provider to use (e.g.,local_llama,openai,starcoder).MODEL_ENDPOINT: The endpoint for the model (e.g.,http://localhost:8001or a cloud API endpoint).
To override, set these variables in the agent's Dockerfile or via docker-compose.yml:
environment:
- MODEL_PROVIDER=openai
- MODEL_ENDPOINT=https://api.openai.com/v1/...- Implement agent logic in each agent's Python service
- Update
agent.protofor protocol changes - Add new agents by creating a new service and updating the orchestrator
- Add new model providers by extending the
ModelClientabstraction in each agent
- This is a skeleton implementation. Fill in agent logic and persistent state as needed.
- Designed for C# but extensible to other languages.