A Telegram bot that integrates with Fullmetal AI, using MongoDB to store and retrieve agent-specific details including pre-prompts, response metrics, and more.
- Interact with Fullmetal AI agents through Telegram
- Real-time streaming of AI responses with typing indicators ("...")
- Store and use agent-specific pre-prompts and context information from MongoDB
- Track and display agent performance metrics (average response time, prompts served)
- Clean MVC architecture for maintainability
- Fully integrated with the Fullmetal agent data model
├── src
│ ├── config
│ │ └── database.js # Database configuration
│ ├── controllers
│ │ └── messageController.js # Message processing logic
│ ├── models
│ │ └── Agent.js # Mongoose model for agents
│ ├── services
│ │ └── fullmetalService.js # Service for API interactions
│ └── index.js # Main entry point
├── .env # Environment variables (not in repo)
├── .env.example # Example environment variables
├── package.json # Project metadata and dependencies
└── README.md # This file
-
Clone the repository:
git clone <repository-url> cd fullmetal-telegram-bot -
Install dependencies:
npm install -
Copy
.env.exampleto.envand fill in your API keys and tokens:cp .env.example .env # Edit the .env file with your values -
Start the bot:
npm startFor development with auto-reload:
npm run dev
- Start a conversation with your bot on Telegram (
/start) - Send a message directly to chat with the AI
- Use
/chat <message>to send a specific prompt - Use
/setprompt <agentId> <pre-prompt>to configure a pre-prompt for an agent - Use
/agentinfo <agentId>to get information about an agent
| Command | Description |
|---|---|
/start |
Start the bot and get a welcome message |
/chat <message> |
Send a message to the AI |
/setprompt <agentId> <pre-prompt> |
Set a pre-prompt for an agent |
/agentinfo <agentId> |
Get information about an agent |
The bot uses an expanded version of the Fullmetal agent model, including:
- Basic agent information (name, ID, availability status)
- Performance metrics (response time, prompts served)
- Context information (role, description, instructions)
- Pre-prompt configuration for customizing agent behavior
TELEGRAM_BOT_TOKEN: Your Telegram bot token from BotFatherFULLMETAL_API_KEY: Your Fullmetal AI API keyFULLMETAL_AGENT_ID: Default Fullmetal agent ID to useMONGODB_URI: MongoDB connection string
MIT