Simple Chatbot

The simplest possible MUXI formation - a single AI assistant agent with no memory, tools, or knowledge.

Difficulty: Beginner Time to setup: 2 minutes

What It Does

  • Responds to chat messages
  • Uses GPT-4
  • No memory (stateless)
  • No tools
  • Perfect for testing MUXI basics

Prerequisites

  • MUXI Server running
  • OpenAI API key

Setup

# 1. Copy this example
cp -r examples/01-simple-chatbot my-chatbot
cd my-chatbot

# 2. Set your OpenAI API key
muxi secrets setup
# Enter your OpenAI API key when prompted

# 3. Run locally
muxi dev

Test It

# Using curl
curl -X POST http://localhost:8001/v1/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello! What can you help me with?"}'

# Or open browser
open http://localhost:8001/chat

Expected Response

{
  "text": "Hello! I'm an AI assistant. I can help with answering questions, providing information, brainstorming ideas, and having conversations. What would you like to know or discuss?",
  "request_id": "req_abc123"
}

Configuration Explained

formation.afs

schema: "1.0.0"
id: simple-chatbot
description: Simple chatbot

llm:
  api_keys:
    openai: "${{ secrets.OPENAI_API_KEY }}"
  models:
    - text: "openai/gpt-4o"

# Agent auto-discovered from agents/
agents: []

agents/assistant.afs

schema: "1.0.0"
id: assistant
name: Assistant
description: Helpful AI assistant

system_message: You are a helpful AI assistant.

Next Steps

This is the simplest formation. Try:

Common Issues

"Missing API key"

muxi secrets set OPENAI_API_KEY sk-...

"Formation won't start"

# Check MUXI Server is running
muxi server list

# Check logs
muxi logs simple-chatbot

"Connection refused"

Make sure MUXI Server is running:

muxi-server start

Learn More

Agent Reference - Complete agent configuration
LLM Configuration - Model settings
Quickstart Guide - Getting started tutorial