Open a terminal and run:
cd agent-autonomous-engine
# Activate virtual environment (if not already active)
# Windows:
venv\Scripts\Activate.ps1
# Linux/WSL:
source venv/bin/activate
# Install dependencies (if not already installed)
pip install -r requirements.txt
# Start engine with API server
python run_with_api.pyYou should see:
🌐 API Server running on http://0.0.0.0:8000
Endpoints: /api/activities, /api/agents, /api/stats/{agent_id}
╔═══════════════════════════════════════════════════════════╗
║ 🤖 Agent Autonomous Engine - Activating Agents ║
╚═══════════════════════════════════════════════════════════╝
The engine runs agents at their configured intervals. Wait for at least one cycle to complete (check your cycle_interval_minutes in config.yaml).
For testing, you can set a short interval like 0.5 minutes (30 seconds) in your config.
Option A: Use the Test Script (Recommended)
Open a new terminal (keep the engine running in the first terminal):
cd agent-autonomous-engine
# Activate virtual environment
venv\Scripts\Activate.ps1 # Windows
# or
source venv/bin/activate # Linux/WSL
# Run test script
python tests/test_api.pyThis will test all endpoints and show you the results.
Option B: Use Browser
- Open your browser and go to:
http://localhost:8000/health- Health checkhttp://localhost:8000/api/agents- List all agentshttp://localhost:8000/api/activities- Get all activitieshttp://localhost:8000/docs- Interactive API documentation (FastAPI auto-generated)
Option C: Use curl (Command Line)
# Health check
curl http://localhost:8000/health
# Get all agents
curl http://localhost:8000/api/agents
# Get all activities
curl http://localhost:8000/api/activities?limit=5
# Get activities for specific agent (replace with your agent_id)
curl http://localhost:8000/api/activities/agent-29ae4ac5-e281-4c17-99b9-26c38800216e
# Get agent stats
curl http://localhost:8000/api/stats/agent-29ae4ac5-e281-4c17-99b9-26c38800216eOption D: Use FastAPI Interactive Docs (Best for Testing)
- Start the engine with API
- Open browser:
http://localhost:8000/docs - You'll see an interactive Swagger UI where you can:
- See all endpoints
- Test endpoints directly in the browser
- See request/response schemas
- Try different parameters
{
"status": "healthy",
"storage": "initialized"
}[
{
"agent_id": "agent-29ae4ac5-e281-4c17-99b9-26c38800216e",
"agent_name": "Vibe",
"last_activity": "2024-01-15T10:30:00",
"total_cycles": 5
}
][
{
"id": 1,
"agent_id": "agent-29ae4ac5-e281-4c17-99b9-26c38800216e",
"agent_name": "Vibe",
"cycle_number": 1,
"timestamp": "2024-01-15T10:30:00",
"response_text": "I've checked your balances...",
"tool_calls": [{"name": "check_balance", "arguments": {}}],
"status": "success",
...
}
]- Wait for agent cycle: Activities are only created when agents complete a cycle
- Check agent is running: Look at the engine logs to see if agents are activating
- Check database: The database is created in
data/activities.db(SQLite) - you can verify it exists
- Check port 8000 is free: Another app might be using it
- Change port: Use
python run_with_api.py --api-port 8001 - Check dependencies: Run
pip install -r requirements.txt
- SQLite (local): Should work automatically - check
data/folder exists - PostgreSQL (Railway): Make sure
DATABASE_URLenv var is set correctly
- This is normal if no agent cycles have completed yet
- Wait for at least one cycle to finish
- Check engine logs to see when cycles complete
- Engine starts without errors
- API server shows "running on http://0.0.0.0:8000"
-
/healthreturns{"status": "healthy"} -
/api/agentsreturns list (may be empty initially) -
/api/activitiesreturns list (may be empty until first cycle) - After agent cycle completes, activities appear
-
/api/stats/{agent_id}returns statistics
Once you see data in the API responses:
- Test in your frontend: Point your frontend to
http://localhost:8000/api/activities - Deploy to Railway: Set
DATABASE_URLand your API will be available at your Railway URL - Monitor: Use
/api/stats/{agent_id}for performance charts