Brief about the project:
Stage 1 implemented: there is an AI agent (OpenAI) and a Telegram bot for communication.
It is necessary to integrate this logic into working software and a web interface to ensure stable operation, management, and control.
Goal of the stage:
To create a unified system where:
the AI agent operates through the API
there is a web interface for management
the system reliably processes messages and tasks
there are no failures/delays during operation
What needs to be done
1. Integration of the AI agent
Connect the existing AI logic (OpenAI API) to the backend
Ensure centralized AI calls (not through Telegram, but through the server)
Maintain support for long system prompts (~12k characters)
Implement dialogue context transfer
2. Backend (server part)
Create backend (Node.js/Python – to be discussed)
Implement API:
sending messages
receiving responses
session management
Error handling (timeouts, API crashes)
Logging requests and responses
3. Web interface (minimal admin panel)
Authorization (simple, without complications)
List of active dialogues
View correspondence
Ability to manually send a message
Display system status
4. Working with messages
Message processing queue (important)
Exclusion of duplication
Control of sending speed
Correct processing of incoming/outgoing messages
5. Management and stability
Restart processes on errors
Handling crashes
Load limiting (rate limit)
Logic "does not hang – does not lose messages"
What is already available
AI logic (stage 1)
Telegram bot (for testing)
System prompt (~12k characters)
Result of the stage
Working backend
Web interface (admin panel)
Stable operation of the system
Ability to manage dialogues and view them