Getting Started¶
Get Reflex running in minutes.
📋 Prerequisites¶
- Docker and Docker Compose
- OpenAI API key (for AI agents)
- Optional: Logfire token (for observability)
🚀 Quick Start¶
✅ Verify Installation¶
Once running, your agent is available at:
| Endpoint | URL | Description |
|---|---|---|
| API | http://localhost:8000 | REST API |
| WebSocket | ws://localhost:8000/ws | Real-time events |
| Health | http://localhost:8000/health | Basic health check |
| Detailed Health | http://localhost:8000/health/detailed | Component status |
Test the health endpoint:
Expected response:
⚙️ What's Running¶
When you start Reflex, you get:
- FastAPI Server - Handles HTTP and WebSocket connections
- PostgreSQL - Stores events and provides pub/sub via LISTEN/NOTIFY
- Agent Loop - Background task that processes events
📤 Send Your First Event¶
import asyncio
import websockets
import json
async def send_event():
async with websockets.connect("ws://localhost:8000/ws") as ws:
event = {"type": "websocket", "source": "test", "content": "Hello!"}
await ws.send(json.dumps(event))
response = await ws.recv()
print(response)
asyncio.run(send_event())
🎯 Next Steps¶
- Explore the example agent
- Understand the architecture
- Learn how to extend Reflex with your own events and agents
- Review configuration options