Skip to content

Commit 4f906ae

Browse files
author
Ismail Sajid
committed
feat: Professional FAANG-spec Agent Orchestrator with DeepSeek support
0 parents  commit 4f906ae

19 files changed

Lines changed: 2047 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- run: pip install -e ".[dev]"
20+
- run: ruff check src/ tests/
21+
- run: pytest tests/ -v --tb=short

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
__pycache__/
2+
*.py[cod]
3+
*.egg-info/
4+
dist/
5+
build/
6+
.eggs/
7+
.env
8+
.venv
9+
.pytest_cache/
10+
.mypy_cache/
11+
.ruff_cache/
12+
htmlcov/
13+
.coverage
14+
outputs/
15+
*.db

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing to agent-compose
2+
3+
## Setup
4+
```bash
5+
git clone https://github.com/daniellopez882/agent-compose.git
6+
cd agent-compose
7+
pip install -e ".[dev]"
8+
pytest tests/ -v
9+
```
10+
11+
## High-Impact Contributions
12+
13+
### Framework Engines (most wanted)
14+
- **LangGraph engine** — full ReAct agent with tool support
15+
- **CrewAI engine** — role-based crews from YAML
16+
- **OpenAI Agents SDK engine** — handoff patterns
17+
18+
### Built-in Tools
19+
- `web_search` — Tavily/SerpAPI integration
20+
- `code_exec` — sandboxed Python execution
21+
- `file_read` / `file_write` — local file operations
22+
23+
### Features
24+
- **MCP integration** — connect to MCP servers from YAML
25+
- **Graph visualization**`agent-compose graph` as Mermaid
26+
- **Streaming** — stream agent outputs in real-time
27+
- **Shared memory** — cross-agent state
28+
29+
### Examples
30+
Share your `agent-compose.yaml` pipelines!
31+
32+
## Code Style
33+
- Python 3.10+ with type hints
34+
- Lint: `ruff check src/ tests/`
35+
- Tests required for new features
36+
- Conventional commits: `feat:`, `fix:`, `docs:`
37+
38+
## Pull Requests
39+
1. Fork → feature branch → tests → PR
40+
2. One feature per PR
41+
3. Include a YAML example if adding a new capability

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Daniel López Orta
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<div align="center">
2+
3+
# 🌌 agent-compose
4+
5+
**The Orchestrator for the Agentic Era.**
6+
7+
🚀 *One YAML. Any Framework. Infinite Scale.*
8+
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
10+
[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org)
11+
[![DeepSeek Enabled](https://img.shields.io/badge/DeepSeek-Native-blueviolet?style=for-the-badge)](https://deepseek.com)
12+
[![LangGraph + CrewAI](https://img.shields.io/badge/Frameworks-Mixed-success?style=for-the-badge)]()
13+
14+
---
15+
16+
**Build multi-agent AI systems like you build infrastructure with Docker Compose.**
17+
Stop writing brittle orchestration glue code. Define your topology in YAML and ship.
18+
19+
[Quick Start](#-quick-start)[Why agent-compose?](#-the-philosophy)[DeepSeek Mastery](#-deepseek-integration)[Architecture](#-core-architecture)
20+
21+
</div>
22+
23+
---
24+
25+
## 💎 The Philosophy
26+
27+
Multi-agent development is currently in its "Manual Era." Teams spend 70% of their time writing orchestration logic—handling state, resolving dependencies, and tracking costs.
28+
29+
**agent-compose** brings order to the chaos. It is the first framework-agnostic orchestrator that allows you to mix **LangGraph**, **CrewAI**, and **OpenAI SDK** agents in a single, declarative pipeline.
30+
31+
### **The "Killer Feature": Framework Mixing**
32+
Prototype an agent in CrewAI, refine another in LangGraph, and keep a simple generating agent as a raw LLM call. **agent-compose** handles the data flow, dependency resolution, and parallel execution.
33+
34+
---
35+
36+
## ⚡ Quick Start
37+
38+
### **1. Install**
39+
```bash
40+
pip install agent-compose[all]
41+
```
42+
43+
### **2. Define `agent-compose.yaml`**
44+
```yaml
45+
name: executive-research-pipeline
46+
description: "LangGraph (Research) → CrewAI (Analysis) → DeepSeek (Writing)"
47+
48+
agents:
49+
researcher:
50+
framework: langgraph
51+
model: deepseek-chat
52+
system_prompt: "Thoroughly research the given topic and extract data points."
53+
tools: [web_search]
54+
connects_to: [analyst]
55+
56+
analyst:
57+
framework: crewai
58+
role: "Senior Strategic Analyst"
59+
goal: "Extract competitive insights and second-order effects."
60+
model: deepseek-chat
61+
connects_to: [writer]
62+
63+
writer:
64+
framework: raw
65+
model: deepseek-chat
66+
system_prompt: "Transform findings into a C-Suite executive brief."
67+
output: report.md
68+
```
69+
70+
### **3. Launch**
71+
```bash
72+
# Set your key
73+
export DEEPSEEK_API_KEY="your_api_key"
74+
75+
# Run the pipeline
76+
agent-compose up --input "The state of AI orchestration in 2026"
77+
```
78+
79+
---
80+
81+
## 🥷 DeepSeek Native Integration
82+
83+
In 2026, **cost-efficiency is the differentiator.** agent-compose is optimized for DeepSeek's high-performance, low-cost reasoning.
84+
85+
- **Unified Billing**: Track per-agent token costs even when mixing providers.
86+
- **BaseURL Auto-Routing**: Automatically routes to `api.deepseek.com` when a `deepseek-*` model is detected.
87+
- **Failover Support**: Gracefully fallback from expensive flagship models to DeepSeek if budgets are exceeded.
88+
89+
---
90+
91+
## 🏗️ Core Architecture (FAANG-Spec)
92+
93+
```mermaid
94+
graph TD
95+
CLI["agent-compose CLI"] --> Loader["YAML Loader & Spec Validator"]
96+
Loader --> DAG["DAG Constructor & Topo-Sort"]
97+
DAG --> Engine["Async Execution Engine"]
98+
99+
subgraph "Execution Layer (Parallel Dispatch)"
100+
Engine --> LGraph["LangGraph Engine"]
101+
Engine --> Crew["CrewAI Engine"]
102+
Engine --> Direct["Direct/DeepSeek Engine"]
103+
end
104+
105+
subgraph "Model Providers"
106+
LGraph --> Providers["OpenAI / Anthropic / DeepSeek"]
107+
Crew --> Providers
108+
Direct --> Providers
109+
end
110+
111+
Providers --> Metrics["Cost & Latency Tracking"]
112+
Metrics --> Final["Final Output (MD / JSON)"]
113+
```
114+
115+
---
116+
117+
## 🛠️ CLI Reference
118+
119+
| Command | Description |
120+
| :--- | :--- |
121+
| `up` | Spin up the entire pipeline (Parallel by default). |
122+
| `validate` | Perform strict schema validation and cycle detection. |
123+
| `graph` | Visualize the agent topology in ASCII or Mermaid. |
124+
| `run <agent>` | Debug a single agent in isolation with custom input. |
125+
| `costs` | View full token and USD breakdown of the last run. |
126+
127+
---
128+
129+
## 🤝 Contributing
130+
131+
We welcome senior-level contributions to the core engine. Check [CONTRIBUTING.md](CONTRIBUTING.md) for our engineering standards (Type hints, Pytest coverage, and Architectural clean-code).
132+
133+
---
134+
135+
<div align="center">
136+
137+
**[agent-compose](https://github.com/Ismail-2001/agent-compose)** by **Ismail Sajid**
138+
139+
*Write YAML. Ship Agents.*
140+
141+
</div>

examples/code-review.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Code Review Pipeline — parallel reviewers + synthesizer
2+
# Usage:
3+
# agent-compose up -f examples/code-review.yaml --input-file my_code.py
4+
5+
name: code-review
6+
description: "Parallel security, performance, and style reviews"
7+
8+
agents:
9+
security:
10+
model: gpt-4o
11+
system_prompt: "You are a security expert. Find vulnerabilities, injection risks, and auth issues."
12+
connects_to: [synthesizer]
13+
14+
performance:
15+
model: gpt-4o
16+
system_prompt: "You are a performance engineer. Find bottlenecks, memory leaks, and inefficiencies."
17+
connects_to: [synthesizer]
18+
19+
style:
20+
model: gpt-4o-mini
21+
system_prompt: "Review code style, readability, naming conventions, and documentation quality."
22+
connects_to: [synthesizer]
23+
24+
synthesizer:
25+
model: claude-sonnet-4-20250514
26+
prompt: >
27+
Combine these reviews into one prioritized report.
28+
29+
Security: {{security.output}}
30+
Performance: {{performance.output}}
31+
Style: {{style.output}}
32+
output: review.md

examples/debate.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Adversarial Debate Pattern
2+
# Two advocates argue opposing positions using different models for genuine diversity.
3+
# A judge evaluates the arguments impartially.
4+
#
5+
# Usage:
6+
# agent-compose up -f examples/debate.yaml --input "Should companies adopt MCP or traditional APIs?"
7+
8+
name: ai-debate
9+
description: "Adversarial debate with judge — reduces hallucination through opposition"
10+
11+
agents:
12+
advocate_for:
13+
model: gpt-4o
14+
system_prompt: >
15+
You are a debate advocate. Argue passionately IN FAVOR of the
16+
given position. Provide specific evidence, data, and logical
17+
reasoning. Be thorough but concise (400 words max).
18+
temperature: 0.3
19+
connects_to: [judge]
20+
21+
advocate_against:
22+
model: claude-sonnet-4-20250514
23+
system_prompt: >
24+
You are a debate advocate. Argue passionately AGAINST the
25+
given position. Provide specific evidence, data, and logical
26+
reasoning. Be thorough but concise (400 words max).
27+
temperature: 0.3
28+
connects_to: [judge]
29+
30+
judge:
31+
model: gpt-4o
32+
temperature: 0
33+
prompt: >
34+
You are an impartial judge. Evaluate these arguments purely on
35+
evidence quality and logical coherence — not which position you
36+
personally agree with.
37+
38+
Rate each advocate on:
39+
1. Evidence quality (specific data vs vague claims)
40+
2. Logical coherence
41+
3. Addressing the strongest counter-argument
42+
43+
ARGUMENT FOR:
44+
{{advocate_for.output}}
45+
46+
ARGUMENT AGAINST:
47+
{{advocate_against.output}}
48+
49+
Deliver a reasoned verdict with confidence level (high/medium/low).
50+
output: verdict.md

examples/research-pipeline.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Research Pipeline Example
2+
# Mixed frameworks: LangGraph researcher → Direct fact-checker → CrewAI analyst → LangGraph writer
3+
#
4+
# Usage:
5+
# agent-compose up -f examples/research-pipeline.yaml --input "AI agent frameworks in 2026"
6+
7+
name: research-pipeline
8+
description: "Multi-framework research pipeline with fact-checking"
9+
10+
settings:
11+
default_model: gpt-4o-mini
12+
parallel: true
13+
output_dir: ./outputs
14+
15+
agents:
16+
researcher:
17+
framework: langgraph
18+
model: gpt-4o
19+
system_prompt: >
20+
You are an expert researcher. Given a topic, produce a thorough
21+
research brief covering key facts, recent developments, market data,
22+
and notable players. Include specific numbers and dates where possible.
23+
max_tokens: 4000
24+
connects_to: [fact_checker, analyst]
25+
26+
fact_checker:
27+
framework: direct
28+
model: claude-sonnet-4-20250514
29+
prompt: >
30+
Verify the following research brief. Flag any claims that appear
31+
inaccurate, outdated, or unsupported. For each flagged claim,
32+
explain why it may be wrong and suggest a correction.
33+
34+
Research to verify:
35+
{{researcher.output}}
36+
max_tokens: 2000
37+
connects_to: [writer]
38+
39+
analyst:
40+
framework: crewai
41+
role: "Senior Technology Analyst"
42+
goal: "Identify the top 3 trends and create a comparison framework"
43+
backstory: >
44+
You have 15 years of experience analyzing technology markets.
45+
You specialize in identifying patterns that others miss and
46+
creating frameworks that help executives make decisions.
47+
model: gpt-4o
48+
max_tokens: 3000
49+
connects_to: [writer]
50+
51+
writer:
52+
framework: direct
53+
model: gpt-4o-mini
54+
prompt: >
55+
Write a professional executive summary (600-800 words) using the
56+
verified research and analysis below. Use only fact-checked claims.
57+
Include the analyst's trend framework as a structured section.
58+
59+
Fact-checked research:
60+
{{fact_checker.output}}
61+
62+
Analysis and trends:
63+
{{analyst.output}}
64+
max_tokens: 3000
65+
output: report.md

0 commit comments

Comments
 (0)