Skip to content

Managing AI Agents

Web App Under Development

The web interface for managing agents is currently under development. Use the CLI or SDK to deploy and manage AI agents.

Deploy and manage AI agents on decentralized infrastructure using the CLI or SDK.

Agent Types

Eliza

Autonomous AI agents with personality and memory:

  • Conversational AI with persistent memory
  • Multi-platform support (Discord, Twitter, Telegram)
  • Custom personality configuration via characterfile
  • Plugin ecosystem for extended capabilities

ComfyUI

AI image and video generation workflows:

  • Stable Diffusion image generation
  • Custom workflow support
  • GPU-accelerated processing
  • API access for programmatic generation

Custom

Build your own AI agents:

  • Deploy custom LangChain/LangGraph agents
  • Full control over agent logic
  • Connect to external APIs and services
  • Custom runtime environments

Creating an Agent

bash
# Create an Eliza agent
af agents create --name "My Agent" --type eliza --character ./character.json

# List agents
af agents list

# Get agent status
af agents status <agent-id>
typescript
import { AlternateFutures } from '@alternatefutures/sdk';

const af = new AlternateFutures({ apiKey: process.env.AF_API_KEY });

// Create an agent
const agent = await af.agents.create({
  name: 'My Agent',
  type: 'eliza',
  config: {
    // Agent configuration
  }
});

Managing Agents

bash
# Start an agent
af agents start <agent-id>

# Stop an agent
af agents stop <agent-id>

# View logs
af agents logs <agent-id>

# Delete an agent
af agents delete <agent-id>
typescript
// Start an agent
await af.agents.start(agentId);

// Stop an agent
await af.agents.stop(agentId);

// Get logs
const logs = await af.agents.logs(agentId);

// Delete an agent
await af.agents.delete(agentId);

Agent Configuration

Environment Variables

Environment variables allow you to configure your agents with API keys, model settings, and other sensitive information without hardcoding them.

Using .env Files

Create a .env file in your project directory:

bash
# API Keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...

# Model Configuration
MODEL=gpt-4
TEMPERATURE=0.7
MAX_TOKENS=2000

# Platform Credentials
DISCORD_BOT_TOKEN=...
TWITTER_API_KEY=...

Using CLI Flags

Pass environment variables directly when creating or updating agents:

bash
# Set variables during agent creation
af agents create \
  --name "My Agent" \
  --type eliza \
  --env OPENAI_API_KEY=sk-... \
  --env MODEL=gpt-4

# Update existing agent variables
af agents update <agent-id> \
  --env TEMPERATURE=0.8
typescript
// Set variables during agent creation
const agent = await af.agents.create({
  name: 'My Agent',
  type: 'eliza',
  env: {
    OPENAI_API_KEY: process.env.OPENAI_API_KEY,
    MODEL: 'gpt-4',
    TEMPERATURE: '0.7'
  }
});

// Update existing agent variables
await af.agents.update(agentId, {
  env: {
    TEMPERATURE: '0.8'
  }
});

Using Character Files

For Eliza agents, include environment variables in your character.json:

json
{
  "name": "My Agent",
  "modelProvider": "openai",
  "settings": {
    "env": {
      "OPENAI_API_KEY": "sk-...",
      "MODEL": "gpt-4"
    }
  }
}

Best Practices

Security

  • Never commit .env files or API keys to version control
  • Add .env to your .gitignore file
  • Use separate keys for development and production
  • Rotate keys regularly

WARNING

Environment variables are stored securely and encrypted at rest. However, they will be accessible to your running agent, so only use trusted code.

Platform Integrations

Connect agents to:

  • Discord - Bot token and permissions
  • Twitter - OAuth credentials
  • Telegram - Bot token
  • Slack - Webhook URL

Memory Settings

Configure agent memory:

  • Short-term - Conversation context
  • Long-term - Persistent knowledge
  • Vector DB - Embeddings storage

Next Steps

Released under the MIT License.