This guide walks you through setting up OpenAgentFlow from scratch.
| Requirement | Version | Purpose |
|---|---|---|
| Node.js | v18.0.0+ | Runs the OpenAgentFlow compiler (lexer, parser, validator, IR generator) |
| Python | v3.10+ | Executes compiled LangGraph workflows |
| pip | Latest | Installs Python runtime dependencies |
Note: The OpenAgentFlow compiler itself has zero npm dependencies. It runs on pure Node.js with no
node_modulesrequired.
Install OpenAgentFlow globally using npm to make the oaf command available everywhere:
npm install -g openagentflow
To skip manual environment configuration, clone our official starter template (OpenAgentFlow-starter), which includes automated setup scripts (setup.js) for Python venv, dependencies, and .env initialization:
git clone https://github.com/OpenAgentFlow/OpenAgentFlow-starter.git my-agents
cd my-agents && npm run setup
Alternatively, if developing or modifying the compiler itself locally, clone the main repository and link it:
git clone https://github.com/OpenAgentFlow/OpenAgentFlow.git
cd OpenAgentFlow
npm link
node --version
# Expected: v18.x.x or higher
If you don’t have Node.js, install it from nodejs.org.
OpenAgentFlow compiles your DSL using Node.js, then executes it natively in a Python LangGraph environment. To run workflows live against real LLM endpoints (oaf run), set up your Python environment:
# Create the virtual environment
python -m venv venv
# Activate it
# Windows PowerShell:
.\venv\Scripts\Activate.ps1
# macOS / Linux:
source venv/bin/activate
pip install langgraph langchain-google-genai langchain-openai langchain-anthropic pydantic
These packages provide:
| Package | Purpose |
|---|---|
langgraph |
Graph-based workflow execution engine |
langchain-google-genai |
Google Gemini LLM integration |
langchain-openai |
OpenAI GPT integration |
langchain-anthropic |
Anthropic Claude integration |
pydantic |
Data validation (LangGraph dependency) |
OpenAgentFlow supports three LLM providers (Gemini, OpenAI, and Anthropic). You need at least one API key to execute workflows.
oaf auth) — RecommendedThe easiest way to configure your API keys across any machine is using the interactive oaf auth utility, which stores them securely with 0o600 permissions inside ~/.oaf/.env:
oaf auth
Windows PowerShell:
$env:GOOGLE_API_KEY = "your-gemini-api-key"
$env:OPENAI_API_KEY = "your-openai-api-key"
$env:ANTHROPIC_API_KEY = "your-anthropic-api-key"
macOS / Linux:
export GOOGLE_API_KEY="your-gemini-api-key"
export OPENAI_API_KEY="your-openai-api-key"
export ANTHROPIC_API_KEY="your-anthropic-api-key"
env.example & 4-Tier Resolution HierarchyThe project includes an env.example template:
cp env.example .env
OpenAgentFlow automatically loads variables using a 4-tier hierarchy (highest to lowest priority):
OPENAI_API_KEY=... oaf run ...).env (adjacent to .oaf file)~/.oaf/.env)Important: Never commit your
.envfile to version control. It is included in.gitignore.
When executing a workflow, OpenAgentFlow selects the provider for each agent in this exact order:
provider property on the agent (provider: "gemini", "openai", or "anthropic")gemini-*, gemma-* → "gemini"gpt-*, o1, o3 → "openai"claude-* → "anthropic"GOOGLE_API_KEY → OPENAI_API_KEY → ANTHROPIC_API_KEYnpm test
You should see 163 tests passing across 10 test files.
oaf --version
# Expected: 0.1.0
oaf --help
# Shows all available commands
oaf parse examples/hello.oaf
If you see the AST output as JSON, the compiler is working correctly.
oaf run examples/hello.oaf
If this produces LLM output, your full stack is configured and ready.
| Problem | Solution |
|---|---|
node: command not found |
Install Node.js v18+ from nodejs.org |
python: command not found |
Install Python 3.10+ and add it to your PATH |
ModuleNotFoundError: langgraph |
Activate your venv and run pip install langgraph langchain-google-genai langchain-openai pydantic |
No LLM API key configured |
Set GOOGLE_API_KEY or OPENAI_API_KEY environment variable |
No model specified for agent |
Add a model property to your agent or set OAF_DEFAULT_MODEL |
For more detailed troubleshooting, see Troubleshooting.
→ Quick Start — Create and run your first workflow