Graduation Project β Faculty of Computers and Artificial Intelligence, Cairo University
An AI-powered multi-agent system that automatically generates production-ready CI/CD workflow files (GitHub Actions & GitLab CI) for any software project. Point it at a codebase, describe what you need, and the agent analyzes your project, plans a pipeline, generates valid YAML, validates it with real linters, and self-corrects β all streamed in real-time.
- Multi-Agent Architecture β Specialized agents (Planner, Analyzer, Researcher, Generator, Validator, Writer) orchestrated by a deterministic Supervisor hub using LangGraph.
- Project-Aware β The Analyzer agent inspects your actual codebase (build files, test runners, deployment configs) so the generated pipeline is grounded in reality, not guesses.
- Web Research Capability β A dedicated ReAct Researcher agent uses DuckDuckGo to search for external documentation, syntax rules, and the latest CI/CD action versions.
- Self-Correcting Reflexion Loop β Generated YAML is validated with
actionlint(GitHub Actions) or the GitLab CI Lint API. If validation fails, the Generator receives the errors and retries automatically. - Multi-Platform β Supports both GitHub Actions and GitLab CI workflow generation.
- Multi-Provider LLM Support β Powered by a LiteLLM factory supporting Groq, OpenAI, Google Gemini, Anthropic, and any OpenAI-compatible endpoint (vLLM, Ollama, LM Studio, OpenRouter). The provider, model, and key are supplied per-request, with two-layer resilience (silent retry + Tenacity exponential backoff).
- Real-Time Streaming β Progress is streamed as NDJSON events, giving full visibility into what the agent is doing at each step, including live reasoning/thinking tokens.
- Human-in-the-Loop & Two-Phase Write Gate β The agent pauses to ask for clarification, request permission for shell commands, and obtain explicit approval before saving files to disk.
- Intelligent Compaction & Summarization β Long conversations can be compacted on-demand to preserve context limits, and completed runs generate structured markdown summaries of architectural decisions.
- Security Built-In β Shell commands are classified (safe/modify/dangerous) with permission gating, and all streamed payloads are sanitized for secrets using entropy-based detection while preserving public identifiers.
- Multi-Turn Conversations β Supports follow-up requests with full conversation history.
| Layer | Technology |
|---|---|
| Agent Framework | LangGraph + LangChain |
| LLM Interface & Resilience | LiteLLM + Tenacity (Two-Layer Retry Policy) |
| LLM Providers | Groq, OpenAI, Google Gemini, Anthropic |
| API Server | FastAPI + Uvicorn |
| Validation | actionlint (GitHub Actions), GitLab CI Lint API |
| Web Research | DuckDuckGo (DDGS), BeautifulSoup4 |
| Data Models | Pydantic v2 |
| Secret Detection | detect-secrets (Shannon Entropy Analysis) |
| Language | Python β₯ 3.11 |
# 1. Clone and install
git clone <repo-url>
cd agent
pip install -e .
# 2. (Optional) Configure env-only extras
# LLM keys are NOT needed here β the provider/model/key are sent per-request
# in the `llm` object. .env is only for optional GitLab-lint / LangSmith vars.
cp .env-example .env
# 3. Run the server
python -m agent
# Server starts at http://localhost:8000
# Pass your LLM provider + key in each request's `llm` field (see below).curl -N -X POST http://localhost:8000/generate/stream \
-H "Content-Type: application/json" \
-d '{
"project_path": "/path/to/your/project",
"prompt": "Create a CI pipeline for this project",
"target_platform": "github_actions",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"history": [],
"title": "",
"llm": {
"provider": "groq",
"model": "llama-3.3-70b-versatile",
"api_key": "gsk_..."
}
}'Note: The
llmobject is required on every request β the server holds no default provider/model/key. Supported providers:groq,openai,anthropic,gemini, andopenai_compatible(local vLLM/Ollama/LM Studio, etc.).
The system follows a hub-and-spoke pattern where a deterministic Supervisor routes between specialized agents:
ββββββββββββββββββββββββββ
β SUPERVISOR (hub) β
β Pure Python routing β
ββββ¬ββββ¬ββββ¬ββββ¬ββββ¬ββββ¬ββ
β β β β β β
βββββββββββ β β β β βββββββββββ
βΌ βΌ βΌ βΌ βΌ βΌ
Planner Analyzer Researcher Generator HITL Writer
(LLM) (ReAct) (ReAct) ββββββββ Gateway (file)
βGen β
β β β
βValid β
ββββββββ
- Supervisor β Deterministic router (zero LLM calls). Reads state flags and picks the next agent.
- Planner β Creates a high-level pipeline plan based on project analysis and web research.
- Analyzer β ReAct agent that inspects the local codebase using tools (bash, glob, grep, read, list).
- Researcher β ReAct agent dedicated to external web research using DuckDuckGo (
websearch,webfetch). - Generator β Produces YAML from the plan, with a reflexion loop for self-correction.
- Validator β Lints generated YAML with real tools (actionlint / GitLab API).
- Human Interaction β Centralized gateway for clarifications, command permissions, and write approvals.
- Writer β Saves the validated YAML to disk upon explicit user approval, then triggers an automated run summary.
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Service health + version |
POST |
/generate/stream |
Start a new CI/CD generation (NDJSON stream) |
POST |
/generate/{thread_id}/resume/permission |
Resume after a command or write permission pause |
POST |
/generate/{thread_id}/resume/clarification |
Resume after a clarification pause |
POST |
/compact |
Compress conversation history on-demand |
POST |
/generate/runs/{run_id}/cancel |
Cancel an active generation |
For comprehensive technical documentation covering architecture deep-dives, package breakdowns, design decisions, security details, and complete API reference, see:
π Full Documentation
# All tests
pytest
# Unit tests only (no LLM keys needed)
pytest tests/unit/
# Integration tests (requires LLM keys)
pytest tests/integration/MIT