Getting Started with MAIAR
Welcome to MAIAR. This guide will help you set up and run your own AI agent using the MAIAR framework.
Prerequisites​
Before you begin, make sure you have the following installed:
nvm install 22.13.1
nvm use 22.13.1
Quick Start​
- Initialize the project with your package manager:
- npm
- yarn
- pnpm
npm create maiar@latest
yarn create maiar
pnpm create maiar
OpenAI API Setup
The CLI defaults to the OpenAI model provider. To use it, you'll need to:
- Create an OpenAI account at platform.openai.com
- Generate an API key in your account settings.
- Add funds to your account to use the API
- Add your API key when the CLI prompts you for it
- Build and start your agent:
- npm
- yarn
- pnpm
npm run build
npm start
yarn build
yarn start
pnpm build
pnpm start
- Test your agent with a simple prompt:
curl -X POST http://localhost:3000/chat -H "Content-Type: application/json" -d '{"user": "Bob", "message": "Hello, how are you?"}'
You should recieve a response from the agent.
Configuration​
The basic configuration above includes:
- OpenAI's GPT-4.1 as the language model, and DALL-E 3 for image generation.
- SQLite-based conversation memory
- Text and image generation capabilities
- Rich console logging
- Logging over WebSocket for remote monitoring
You can customize the configuration by:
- Changing the OpenAI models used for text and image generation
- Configuring memory storage options (e.g. SQLite, Postgres, etc.)
- Adding more plugins and adjusting their settings
Adding Plugins​
You can extend your agent's capabilities by installing additional plugins:
- npm
- yarn
- pnpm
npm install @maiar-ai/plugin-discord
yarn add @maiar-ai/plugin-discord
pnpm add @maiar-ai/plugin-discord
Then add them to your runtime configuration:
import { PluginDiscord } from "@maiar-ai/plugin-discord";
// ... other imports
const agent = await Runtime.init({
// ... other config
plugins: [
new PluginDiscord({
/* Configuration options go here */
})
// ... other plugins
]
});
Check out some of our plugins to get started.
Troubleshooting
If you encounter any issues:
- Make sure your OpenAI API key is properly set in the
.env
file - Check that all dependencies are installed with your package manager
- Ensure the
data
directory exists for SQLite storage - Check the TypeScript compilation output for any errors
For more help, please open an issue on our GitHub repository.
Next Steps
- Explore the API Reference to learn about available methods and configurations
- Check out the Plugins Guide to learn how to extend your agent's capabilities
- Join our Discord to get help and share your experiences