AI Agent Workflow
Create an intelligent AI agent that remembers conversation history and can use tools.What You’ll Build
A chatbot that:- Maintains conversation context across messages
- Uses an AI model (OpenAI, Claude, Gemini, and more)
- Responds via webhook
Prerequisites
- MachinaOs running locally
- An AI provider API key (OpenAI, Anthropic, Google, or any of the 11 supported providers)
Step 1: Add the AI Agent
- Drag AI Agent from the AI Agents category
- This is the core of your intelligent assistant
- Main Input (
input-main, left) - Receives the user prompt - Memory (
input-memory, left diamond) - Connects to a Simple Memory node - Skill (
input-skill, bottom diamond) - Connects skill nodes - Tools (
input-tools, bottom diamond) - Connects tool nodes - Output (
output-main, right) - The agent’s response
Step 2: Choose the Provider and Model
The AI Agent picks its own provider and model directly in its parameters. There is no separate model handle to wire up.- Click the AI Agent to open its parameter panel
- Set the Provider and Model:
gpt-5.5, Anthropic offers claude-opus-4-8 / claude-sonnet-4-6, Gemini offers gemini-3.5-flash).
Step 3: Add Conversation Memory
- Drag Simple Memory from the AI Tools category
- Connect its output to the AI Agent’s Memory input (
input-memory, the left diamond handle) - Configure:
Enable Long-Term Memory on the Simple Memory node to archive older messages into a vector store for semantic recall beyond the recent window.
Step 4: Add a Webhook Trigger
- Drag Webhook Trigger from the Triggers category
- Connect its output to the AI Agent’s main input (
input-main) - Configure:
Step 5: Add a Webhook Response
- Drag Webhook Response from Utilities
- Connect the AI Agent’s output to Webhook Response
- Configure:
Complete Workflow
Step 6: Configure the Agent Prompt
Click on the AI Agent and set the System Message field:Step 7: Deploy and Test
- Click Deploy
- Test with curl:
Advanced: Multiple Sessions
Use different session IDs for different conversations:Advanced: Window Size
For long conversations, adjust Window Size to control how much history the agent sees:Troubleshooting
Agent doesn't remember previous messages
Agent doesn't remember previous messages
- Ensure Simple Memory is connected to the memory input (diamond handle)
- Check that Session ID is consistent between requests
- Memory is saved after each exchange automatically
API key not found
API key not found
- Click the key icon in the toolbar
- Add your API key for the provider you’re using
- Keys are stored securely and encrypted
Next Steps
WhatsApp Automation
Connect your agent to WhatsApp
AI Models Reference
Compare AI providers