Skip to main content

Prerequisites

  • Python 3.11+
  • PostgreSQL 15+ with the pgvector extension (optional — defaults to in-memory)
  • An OpenAI or Anthropic API key

1. Install Dependencies

git clone https://github.com/syncly/agentflow.git
cd agentflow
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt

2. Configure Environment

Create a .env file at the project root:
ENVIRONMENT=development
OPENAI_API_KEY=sk-...
DATABASE_URL=postgresql://user:pass@localhost:5432/agentflow
CORS_ALLOWED_ORIGINS=http://localhost:3000
LOG_LEVEL=INFO

3. Run Migrations

alembic upgrade head

4. Start the Server

python main.py
The API is now available at http://localhost:8000. Visit /docs for the interactive Swagger UI.

5. Send Your First Message

curl -N -X POST http://localhost:8000/agent/MainAgent/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello, what can you do?"}'
The -N flag enables streaming so you see Server-Sent Events as they arrive.

Using Docker

For a full stack with PostgreSQL, Redis, and Datadog:
docker-compose up -d

Using the Python SDK

import agentflow as af

client = af.Client(endpoint="http://localhost:8000")
response = await af.chat("Hello!", agent="MainAgent")
print(response)

Next Steps