Quickstart
Quickstart
Prerequisites
- Python 3.11+
- Redis 7.0+ (for state management and message passing)
- OpenAI API key or Anthropic API key (for LLM-powered agents)
Installation
Option 1: Docker (Recommended)
# Clone the repository
git clone https://github.com/nasirquant/fractal-neural-engine
cd fractal-neural-engine
# Start all services
docker-compose up -d
# Verify the API is running
curl http://localhost:8000/healthOption 2: Local Development
# Clone the repository
git clone https://github.com/nasirquant/fractal-neural-engine
cd fractal-neural-engine
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy and configure environment
cp .env.example .env
# Edit .env with your API keys
# Start Redis
docker run -d -p 6379:6379 redis:7-alpine
# Run the API server
python main.pyYour First Epoch
An epoch is a complete simulation run with a defined objective, agent count, and tick limit.
curl -X POST http://localhost:8000/epochs \
-H "Content-Type: application/json" \
-d '{
"num_agents": 10,
"max_ticks": 100,
"global_objective": "minimize_loss",
"convergence_threshold": 0.01
}'Response:
{
"epoch_id": "ep_abc123",
"status": "running",
"num_agents": 10,
"max_ticks": 100,
"global_objective": "minimize_loss",
"created_at": "2024-01-15T10:30:00Z"
}Monitor Progress
WebSocket Streaming (Real-time)
# Install websocat for testing
# Then connect to the epoch stream
websocat ws://localhost:8000/epochs/ep_abc123/streamREST Polling
# Check epoch status
curl http://localhost:8000/epochs/ep_abc123
# Get agent states
curl http://localhost:8000/epochs/ep_abc123/agents
# Get loss history
curl http://localhost:8000/epochs/ep_abc123/loss-historyEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY | Yes* | - | OpenAI API key for GPT models |
ANTHROPIC_API_KEY | Yes* | - | Anthropic API key for Claude models |
REDIS_URL | No | redis://localhost:6379 | Redis connection string |
FNSE_LOG_LEVEL | No | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
FNSE_MAX_CONCURRENT_EPOCHS | No | 5 | Maximum parallel epochs |
FNSE_DEFAULT_MODEL | No | gpt-4-turbo | Default LLM model for agents |
*At least one LLM API key is required.
Next Steps
- Architecture Overview — Understand the system design
- API Reference — Complete API documentation
- MacroSwarm Guide — Agent roles and orchestration
- GraphRAG Guide — Knowledge retrieval and memory