AgentOS is a polyglot agent framework built on three primitives: Worker, Function, Trigger. The development environment requires Rust, Node.js, and optionally Python for the embedding worker.
Architecture: Rust for hot path (agent core, security, memory), TypeScript for iteration speed (39 workers), Python for ML (embeddings)
# Using CLIcargo run -p agentos-cli -- chat default# Or directly via agent::chat functioncargo run -p agentos-cli -- message default "What can you do?"
For a production-like environment, use the CLI to manage all workers:
# Initialize projectcargo run -p agentos-cli -- init --quick# Configure API keyscargo run -p agentos-cli -- config set-key anthropic $ANTHROPIC_API_KEY# Start all workers (uses process management)cargo run -p agentos-cli -- start# Check statuscargo run -p agentos-cli -- status# Chat with an agentcargo run -p agentos-cli -- chat default# Stop all workerscargo run -p agentos-cli -- stop
# Check if agent-core is registeredcurl http://localhost:3111/functions | jq '.[] | select(.id | startswith("agent::"))'# Expected: agent::chat, agent::create, agent::list, agent::delete, agent::list_tools
# Check if tools are registeredcurl http://localhost:3111/functions | jq '.[] | select(.id | startswith("tool::"))'# Expected: tool::file_read, tool::file_write, tool::web_fetch, tool::web_search, etc.
# Check if embedding worker is registeredcurl http://localhost:3111/functions | jq '.[] | select(.id | startswith("embedding::"))'# Expected: embedding::generate, embedding::similarity
# Run a full agent conversationcurl -X POST http://localhost:3111/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "agentId": "default", "message": "List the files in the current directory", "sessionId": "test-session-1" }'
If iii-engine fails to start with “address already in use”:
# Check what's using the portslsof -i :49134lsof -i :3111lsof -i :3112# Kill processes or change ports in config.yaml
Worker connection refused
Workers fail to connect to ws://localhost:49134:
Ensure iii-engine is running: ps aux | grep iii
Check engine logs for WebSocket module errors
Verify firewall allows localhost connections
Function not found errors
If agent can’t find tools like tool::file_read:
# List all registered functionscurl http://localhost:3111/functions | jq '.[].id'# Ensure tools worker is runningps aux | grep "tsx src/tools.ts"# Restart the worker if missingnpx tsx src/tools.ts
# Install missing dependenciespip install sentence-transformers torch# Or use fallback mode (no ML, hash-based embeddings)# The worker auto-detects and falls back if imports fail
# 1. Make changes to source filesvim crates/agent-core/src/main.rs# 2. Rebuild the changed workercargo build --release -p agentos-core# 3. Restart the workerkill $(pgrep -f "agentos-core")cargo run --release -p agentos-core &# 4. Test changescargo run -p agentos-cli -- message default "Test my changes"# 5. Run testscargo test -p agentos-core
For TypeScript workers:
# Changes are auto-reloaded with tsx in watch modenpx tsx --watch src/tools.ts# Or restart manuallykill $(pgrep -f "tsx src/tools.ts")npx tsx src/tools.ts &# Run testsnpx vitest --run