Skip to content

Commit 5bdea67

Browse files
authored
Merge pull request #1 from OpenGraph-AI/feat-100234
Feat 100234
2 parents 50633dc + 172425a commit 5bdea67

5 files changed

Lines changed: 369 additions & 30 deletions

File tree

.github/FUNDING.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
2+
#
3+
# Populate one or both fields below, then delete the rest.
4+
# Note: `github:` requires the org to be approved for GitHub Sponsors
5+
# (apply at https://github.com/sponsors). Until approved, use `custom:`.
6+
#
7+
# An unpopulated FUNDING.yml renders no Sponsor button.
8+
9+
github: # e.g. OpenGraph-AI
10+
custom: # e.g. ["https://opengraph.tech/sponsor"]
11+
12+
# Unused providers — delete or populate:
13+
# patreon:
14+
# open_collective:
15+
# ko_fi:
16+
# tidelift:
17+
# liberapay:
18+
# issuehunt:
19+
# otechie:

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing to OpenAgent
2+
3+
Short version: open an issue, open a PR, challenge a design decision. All three are welcome.
4+
5+
## What's worth contributing
6+
7+
- **A new agent stage** (or a variant of an existing one). The pipeline is intentionally modular — if you think there should be a `Critic` or `Verifier` stage between Planner and Executor, prototype it and send the PR.
8+
- **A new provider adapter.** OpenAI-compatible endpoints work out of the box; other SDKs (Anthropic native, Bedrock, etc.) are good fits.
9+
- **A new recipe.** The `Recipes` section of the README is a living document. If you found a pattern that keeps recurring, document it.
10+
- **Better tests on the stage contracts.** Every Pydantic schema in `backend/models/schemas.py` is a test surface.
11+
- **Docs fixes.** Typos, broken links, confusing phrasing — just open the PR.
12+
13+
## How to PR
14+
15+
1. Fork, branch from `main`.
16+
2. Keep the change small. One stage, one feature, one fix.
17+
3. If you change a stage contract, update the schema and the stage it belongs to in the same PR.
18+
4. Run the pipeline end-to-end with `python run.py` before sending — a smoke test counts.
19+
5. Open the PR with a one-paragraph "why" and a before/after if the behavior changed.
20+
21+
## Disagreement is welcome
22+
23+
If you think a design decision in the cookbook is wrong, open an issue titled `design: <thing you disagree with>`. We'd rather be challenged than be wrong in public.
24+
25+
## Code style
26+
27+
- Python: `ruff` defaults, type hints on public functions, Pydantic models for any cross-stage data.
28+
- Commit messages: imperative mood (*"add context gatherer"*, not *"added context gatherer"*).
29+
30+
## Getting stuck
31+
32+
Open an issue labeled `question`. No issue is too small.
33+
34+
Thanks for making this better.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 OpenGraph.tech
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. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 144 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,121 @@
11
<p align="center">
2-
<img src="public/logo.svg" alt="OpenGraph.tech" width="96" />
2+
<img src="public/logo.svg" alt="OpenAgent by OpenGraph.tech" width="72" />
33
</p>
44

5-
<h1 align="center">OpenGraph.tech</h1>
5+
<h1 align="center">OpenAgent</h1>
6+
7+
<p align="center"><sub>by <a href="https://opengraph.tech">OpenGraph.tech</a></sub></p>
68

79
<p align="center">
810
<strong>The open reference pipeline for AI agents that think before they act.</strong>
911
</p>
1012

1113
<p align="center">
12-
A production-grade blueprint — and a cookbook — for splitting an agent's mind into stages you can observe, test, and replace independently.
14+
Intent → Ambiguity → Clarifier → Planner → Executor. Five typed stages. One streaming pipeline. ~4k lines you can read in an afternoon.
1315
</p>
1416

1517
<p align="center">
18+
<a href="https://github.com/OpenGraph-AI/OpenAgent/stargazers"><img src="https://img.shields.io/github/stars/OpenGraph-AI/OpenAgent?style=social" alt="GitHub stars" /></a>
19+
<a href="https://github.com/OpenGraph-AI/OpenAgent/commits/main"><img src="https://img.shields.io/github/last-commit/OpenGraph-AI/OpenAgent?color=324D17&style=flat-square" alt="Last commit" /></a>
20+
<a href="./LICENSE"><img src="https://img.shields.io/github/license/OpenGraph-AI/OpenAgent?color=324D17&style=flat-square" alt="MIT License" /></a>
1621
<img src="https://img.shields.io/badge/python-3.10%2B-324D17?style=flat-square" alt="Python 3.10+" />
1722
<img src="https://img.shields.io/badge/fastapi-async-324D17?style=flat-square" alt="FastAPI" />
1823
<img src="https://img.shields.io/badge/pydantic-typed%20contracts-324D17?style=flat-square" alt="Pydantic" />
1924
<img src="https://img.shields.io/badge/LLM-any%20OpenAI--compatible-324D17?style=flat-square" alt="Model agnostic" />
20-
<img src="https://img.shields.io/badge/PRs-welcome-324D17?style=flat-square" alt="PRs welcome" />
25+
<a href="https://www.linkedin.com/company/opengraph-tech/"><img src="https://img.shields.io/badge/LinkedIn-OpenGraph.tech-0A66C2?style=flat-square&logo=linkedin&logoColor=white" alt="Follow OpenGraph.tech on LinkedIn" /></a>
26+
</p>
27+
28+
<p align="center">
29+
<a href="https://github.com/OpenGraph-AI/OpenAgent"><img src="https://img.shields.io/badge/%E2%AD%90%20Star%20on%20GitHub-324D17?style=for-the-badge&logo=github&logoColor=white" alt="Star on GitHub" /></a>
30+
&nbsp;
31+
<a href="#demo"><img src="https://img.shields.io/badge/%E2%96%B6%20Watch%20the%2090%E2%80%91second%20demo-324D17?style=for-the-badge" alt="Watch the 90-second demo" /></a>
32+
&nbsp;
33+
<a href="#quickstart"><img src="https://img.shields.io/badge/%E2%9A%A1%20Quickstart-324D17?style=for-the-badge" alt="Quickstart" /></a>
34+
</p>
35+
36+
<a id="demo"></a>
37+
38+
<!--
39+
GitHub-native video embed.
40+
HOW TO POPULATE:
41+
1. Open a new issue or draft PR in this repo.
42+
2. Drag-and-drop your MP4 (<= 100 MB) into the comment box. GitHub auto-uploads
43+
and pastes a URL like: https://github.com/user-attachments/assets/<uuid>
44+
(older uploads use https://user-images.githubusercontent.com/...)
45+
3. Replace YOUR_VIDEO_URL_HERE below with that URL.
46+
-->
47+
<p align="center">
48+
<video src="YOUR_VIDEO_URL_HERE"
49+
width="720" autoplay loop muted playsinline controls>
50+
</video>
2151
</p>
2252

2353
<p align="center">
24-
<a href="#quickstart"><strong>Quickstart</strong></a> ·
25-
<a href="#the-five-stages"><strong>The Cookbook</strong></a> ·
26-
<a href="#how-it-compares"><strong>How it compares</strong></a> ·
27-
<a href="https://opengraph.tech"><strong>opengraph.tech ↗</strong></a>
54+
<sub>Not playing? <a href="https://youtu.be/WMqK6OoWpa8">Watch on YouTube ↗</a></sub>
2855
</p>
2956

3057
---
3158

32-
## Why OpenGraph
59+
## The product in one image
3360

34-
Most "AI agent" code you'll read online is one fat prompt wrapped in a loop. It demos well and falls apart the moment a real user types something vague. We built the opposite: a pipeline where every stage of an agent's reasoning is a **first-class, typed, independently testable unit**.
61+
<p align="center">
62+
<img src="public/stages.svg" alt="OpenAgent — the five stages with typed input and output contracts" width="100%" />
63+
</p>
3564

36-
- 🧠 **Five specialist stages, not one monolith.** Intent → Ambiguity → Clarifier → Planner → Executor. Each with one job, each observable and swappable.
37-
- 🕸️ **Auto-resolving clarifier.** The agent searches the web for what the web can answer, and only asks the user for what only the user knows. User attention is the most expensive resource — we spend it last.
38-
- 🔌 **Model-agnostic by default.** Any OpenAI-compatible endpoint works — OpenAI, Azure, Groq, Together, vLLM, Ollama. No SDK lock-in.
39-
- 🧯 **Graceful degradation.** Missing an API key for Exa, Upstash, or PageIndex? The pipeline downgrades, never crashes. Run locally with `LLM_API_KEY` alone.
40-
- 🪢 **Typed contracts between every stage.** Pydantic at every boundary. A bad output gets caught at parse time, not six steps later.
41-
- 🔴 **Streams natively, pauses like a coroutine.** WebSocket-first. Clarification pauses the pipeline mid-flight and resumes cleanly.
65+
<p align="center"><sub>Each stage has a <strong>typed input</strong> and a <strong>typed output</strong>. The Pydantic schema between any two stages is your test surface — and your debug trail.</sub></p>
4266

4367
---
4468

45-
## Who this is for
69+
## What makes this different
70+
71+
> ### *"Most agents fail in one of five places.*
72+
> ### *OpenAgent is built for all five."*
73+
74+
<table>
75+
<tr>
76+
<td width="33%" valign="top">
4677

47-
- **Engineers building their first real agent** who are tired of cargo-culting `while True: llm()` loops and want a mental model that actually scales.
48-
- **Platform teams** evaluating LangGraph / CrewAI / AutoGen who want something smaller, typed end-to-end, and free of framework ideology.
49-
- **Technical founders and researchers** shipping LLM products who need to *debug* and *trace* why an agent produced what it did — not just vibe-check it.
78+
#### 🧠 &nbsp; Five specialists, not one monolith
5079

51-
If you've ever said "the agent is doing something weird and I have no idea what stage broke," this is for you.
80+
`Intent ▸ Ambiguity ▸ Clarifier ▸ Planner ▸ Executor` — each testable in isolation. When something breaks, you know **exactly where**.
81+
82+
</td>
83+
<td width="33%" valign="top">
84+
85+
#### 🕸️ &nbsp; Asks humans last
86+
87+
Clarifier searches the web first, auto-fills what it can, and asks you only what it genuinely couldn't find.
88+
89+
**One question. Not seven.**
90+
91+
</td>
92+
<td width="33%" valign="top">
93+
94+
#### 🧯 &nbsp; Degrades, never dies
95+
96+
No Exa? &nbsp;Skips web.
97+
No Redis? &nbsp;In-memory.
98+
No RAG? &nbsp;No problem.
99+
100+
**Missing keys are features, not errors.**
101+
102+
</td>
103+
</tr>
104+
</table>
52105

53106
---
54107

55108
## Quickstart
56109

57110
```bash
58-
git clone https://github.com/opengraph-tech/agent-auto.git
59-
cd agent-auto
111+
git clone https://github.com/OpenGraph-AI/OpenAgent.git
112+
cd OpenAgent
60113
pip install -r requirements.txt
61114
cp .env.example .env # set LLM_API_KEY at minimum
62115
python run.py
63116
```
64117

65-
Open `http://localhost:8000/static/index.html` and type a fuzzy request. Watch each phase stream into the UI in real time: intent extraction, ambiguity flags, clarifying questions, the plan, and finally the executor producing the answer step-by-step.
118+
Open `http://<your-domain>:8000/static/index.html` and type a fuzzy request. Watch each phase stream into the UI in real time: intent extraction, ambiguity flags, clarifying questions, the plan, and finally the executor producing the answer step-by-step.
66119

67120
**Minimum config** — one variable:
68121

@@ -87,7 +140,7 @@ docker compose up
87140
## The mental model
88141

89142
<p align="center">
90-
<img src="public/mental-model.svg" alt="OpenGraph.tech five-stage agent pipeline: raw text → Intent → Ambiguity → Clarifier → Planner → Executor → final output" width="520" />
143+
<img src="public/mental-model.svg" alt="OpenAgent five-stage agent pipeline: raw text → Intent → Ambiguity → Clarifier → Planner → Executor → final output" width="520" />
91144
</p>
92145

93146
Each stage is a specialist. The output of one is the typed input of the next. If any stage misbehaves, you can swap it, mock it, or inspect it without touching the others.
@@ -102,6 +155,20 @@ Read this like a cookbook. Every stage answers a question you'll eventually have
102155
103156
Five questions. Five agents. That's the whole book.
104157

158+
<div align="center">
159+
160+
| # | Stage | In | Out | Mission |
161+
|:-:|:------|:---|:----|:--------|
162+
| **01** | 🧠 &nbsp;**Intent** | `str` | `IntentSchema` | Turn fuzz into a typed goal |
163+
| **02** |&nbsp;**Ambiguity** | `IntentSchema` | `AmbiguityReport` | Flag the known unknowns |
164+
| **03** | 🕸️ &nbsp;**Clarifier** | `AmbiguityReport` | `ClarifiedIntent` | Auto-resolve, ask only the rest |
165+
| **04** | 🗺️ &nbsp;**Planner** | `ClarifiedIntent` | `ExecutionPlan` | A DAG of verifiable steps |
166+
| **05** |&nbsp;**Executor** | `ExecutionPlan` | `ExecutionResult` | Run, stream, trace to goal |
167+
168+
</div>
169+
170+
&nbsp;
171+
105172
### 1. Intent — "What is the user actually asking?"
106173

107174
**The problem.** Humans don't type goals. They type fragments, moods, half-sentences. *"can you make this better"* is not a specification — it's a vibe. Executing on a vibe gives you a confident-sounding wrong answer.
@@ -302,22 +369,32 @@ Small patterns that keep recurring once you start building real agents.
302369

303370
## How it compares
304371

305-
| | OpenGraph | LangGraph | CrewAI | AutoGen |
372+
| | OpenAgent | LangGraph | CrewAI | AutoGen |
306373
|-------------------------------|-----------------|--------------------|------------------|-------------------|
307374
| Mental model | Typed pipeline | Graph of nodes | Role-playing crew | Multi-agent chat |
308375
| Typed contracts between stages | ✅ Pydantic | ⚠️ Optional | ⚠️ Loose | ⚠️ Loose |
309376
| Auto-resolving clarifier | ✅ Built-in ||||
310377
| Model lock-in | None | None | None | None |
311-
| Framework weight | ~1.5k LOC | Heavy | Heavy | Heavy |
378+
| Framework weight | ~4k LOC, readable| Heavy | Heavy | Heavy |
312379
| "Pause for user" as first-class || ⚠️ Via interrupts || ⚠️ Via prompts |
313-
| Reads like a cookbook | ✅ By design | ❌ It's a library | ||
380+
| Reads like a cookbook | ✅ By design | ⚠️ Reference docs, not narrative |||
314381

315-
**When to pick OpenGraph.** You want to understand every moving part, control each prompt, and own your agent's reasoning end-to-end — not inherit someone else's abstraction.
382+
**When to pick OpenAgent.** You want to understand every moving part, control each prompt, and own your agent's reasoning end-to-end — not inherit someone else's abstraction.
316383

317384
**When to pick a framework instead.** You want to ship fast without thinking about architecture, and the framework's defaults happen to match your domain.
318385

319386
---
320387

388+
## Who this is for
389+
390+
| | |
391+
|---|---|
392+
| 🛠️ **First-agent builders** | Five `while True: llm()` prototypes in a drawer. None ship. **Start here.** |
393+
| 🏗️ **Framework evaluators** | You've read the LangGraph docs twice and still don't trust the abstractions. This is ~4k lines. Read it in an afternoon. |
394+
| 🧪 **Production debuggers** | *"It's doing something weird in prod."* OpenAgent tells you exactly which stage lied — with the transcript. |
395+
396+
---
397+
321398
## Where to start reading the code
322399

323400
If you're here to learn, open files in this order:
@@ -330,15 +407,52 @@ If you're here to learn, open files in this order:
330407

331408
---
332409

410+
## What's next
411+
412+
- [x] Typed contracts between all five stages
413+
- [ ] Anthropic-native tool use (beyond OpenAI-compatible)
414+
- [ ] Step-level retries with plan-edit capability
415+
- [ ] First-class observability (OpenTelemetry spans per stage)
416+
- [ ] Browser extension: capture user intent from any form
417+
418+
*Roadmap subject to change. Open an issue if one of these matters to you and we'll bump it.*
419+
420+
---
421+
333422
## Contributing
334423

335-
Issues, patches, and hard questions are all welcome. If you disagree with a design choice in the cookbook, open an issue — we'd rather get challenged than be wrong in public. Every stage is intentionally small enough that a PR can meaningfully change one thing at a time.
424+
Issues, patches, and hard questions are all welcome. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the short version — fork, keep the change small, smoke-test with `python run.py`, and open the PR with a one-paragraph *why*. Every stage is intentionally small enough that a PR can meaningfully change one thing at a time.
336425

337426
---
338427

339428
## About OpenGraph.tech
340429

341430
OpenGraph.tech builds the infrastructure for agents that reason openly, not opaquely. This repo is our reference pipeline — the thing we run, the thing we ship against, and the thing we learn from. If you're building agents in production and want to compare notes, we'd like to hear from you.
342431

432+
Follow us on <a href="https://www.linkedin.com/company/opengraph-tech/">LinkedIn</a> — that's where we post build notes and what shipped this week.
433+
434+
---
435+
436+
<p align="center">
437+
<a href="https://github.com/OpenGraph-AI/OpenAgent/graphs/contributors">
438+
<img src="https://contrib.rocks/image?repo=OpenGraph-AI/OpenAgent" alt="Contributors to OpenAgent" />
439+
</a>
440+
</p>
441+
442+
## Leave a ⭐ if this saved you a week
443+
444+
This repo is free. The cookbook is free. The walkthrough is [on YouTube](https://youtu.be/WMqK6OoWpa8), free. The only thing we ask back is **a star** — it's the one signal that tells us to write more of these, louder.
445+
446+
<p align="center">
447+
<a href="https://github.com/OpenGraph-AI/OpenAgent">
448+
<img src="https://img.shields.io/badge/%E2%AD%90%20Star%20on%20GitHub-OpenGraph--AI%2FOpenAgent-324D17?style=for-the-badge&logo=github&logoColor=white" alt="Star OpenAgent on GitHub" />
449+
</a>
450+
&nbsp;
451+
<a href="https://youtu.be/WMqK6OoWpa8">
452+
<img src="https://img.shields.io/badge/%E2%96%B6%20Watch%20the%20demo-YouTube-324D17?style=for-the-badge&logo=youtube&logoColor=white" alt="Watch the demo on YouTube" />
453+
</a>
454+
</p>
455+
456+
<p align="center"><sub>One click. No account prompt. It genuinely helps.</sub></p>
343457

344458
<p align="center"><sub>Made with intent, by <a href="https://opengraph.tech">OpenGraph.tech</a>.</sub></p>

0 commit comments

Comments
 (0)