A comprehensive AI assistant project with advanced features including Q&A, content generation, translation, autonomous task execution, multi-agent architecture, multi-modal processing, adaptive learning, real-time interaction, conversation sharing and PDF export capabilities.
- Multi-Agent Architecture: Specialized agents for different tasks (General, Translator, Creative Writer, Problem Solver, Task Executor)
- Question Answering: Intelligent responses to user queries
- Content Generation: Creative writing, brainstorming, and idea generation
- Translation: Multi-language translation capabilities
- Autonomous Task Execution: Step-by-step task planning and execution
- Adaptive Learning: Conversation memory and context awareness
- Real-time Chat Interface: Modern, responsive chat UI built with TypeScript
- Conversation Management: Create, save, and manage multiple conversations
- Agent Selection: Choose specific AI agents for different tasks
- Mobile-Friendly: Responsive design for desktop and mobile devices
- Multi-Modal Processing: Image upload and analysis using OpenAI Vision API
- Document Processing: Support for various file formats (PDF, text, images)
- Conversation Export: Export conversations as PDF or text files
- Conversation Sharing: Share conversations with others
- Search and Filter: Find conversations by content or date
rockbot_assistant/
├── backend/ # Flask backend API
│ └── rockbot_api/
│ ├── src/
│ │ ├── models/ # Database models
│ │ │ ├── user.py
│ │ │ └── conversation.py
│ │ ├── routes/ # API endpoints
│ │ │ ├── user.py
│ │ │ ├── chat.py
│ │ │ ├── export.py
│ │ │ └── multimodal.py
│ │ ├── services/ # AI service integration
│ │ │ └── ai_service.py
│ │ ├── static/ # Frontend build files
│ │ └── main.py # Flask application entry point
│ ├── venv/ # Python virtual environment
│ └── requirements.txt # Python dependencies
├── frontend/ # TypeScript frontend
│ └── rockbot-ui/
│ ├── src/
│ │ ├── components/ # TypeScript components
│ │ │ ├── ui/ # UI components (shadcn/ui)
│ │ │ └── ChatInterface.tsx
│ │ ├── App.tsx # Main App component
│ │ └── main.tsx # TypeScript entry point
│ ├── package.json # Node.js dependencies
│ └── dist/ # Production build
├── models/ # AI models directory
├── setup.sh # Setup script
├── run_dev.sh # Development server script
├── run_prod.sh # Production server script
└── README.md # This file
- Python 3.8 or higher
- Node.js 16 or higher
- npm or pnpm package manager
-
Clone or download the project
# If you have the project files, navigate to the directory cd rockbot_assistant
-
Run the setup script
chmod +x setup.sh ./setup.sh
This script will:
- Set up the Python virtual environment
- Install backend dependencies
- Install frontend dependencies
- Build the frontend for production
- Copy frontend files to the Flask static directory
If you prefer to set up manually:
-
Backend Setup
cd backend/rockbot_api python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Frontend Setup
cd frontend/rockbot-ui npm install # or pnpm install npm run build # or pnpm run build
-
Copy Frontend Build
cp -r frontend/rockbot-ui/dist/* backend/rockbot_api/src/static/
Create a .env file in the backend/rockbot_api directory with:
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_API_BASE=https://api.openai.com/v1
FLASK_ENV=development
FLASK_DEBUG=1Note: The OpenAI API key is required for AI functionality. Get your API key from OpenAI Platform.
./run_dev.sh./run_prod.shThe application will be available at http://localhost:5000
POST /api/chat- Send message to AIGET /api/conversations- Get all conversationsPOST /api/conversations- Create new conversationGET /api/conversations/{id}- Get specific conversationDELETE /api/conversations/{id}- Delete conversation
GET /api/agents- Get available AI agentsPOST /api/translate- Translate textPOST /api/task- Execute autonomous task
GET /api/conversations/{id}/export- Export conversation as textGET /api/conversations/{id}/pdf- Export conversation as PDFPOST /api/conversations/{id}/share- Create shareable link
POST /api/upload- Upload and process filesPOST /api/analyze-image- Analyze image with custom promptPOST /api/chat-with-image- Chat about uploaded image
// Send a message to the AI
const response = await fetch('/api/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
message: "Hello, how are you?",
agent_type: "general"
})
});// Translate text
const response = await fetch('/api/translate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: "Hello world",
target_language: "Spanish"
})
});// Execute autonomous task
const response = await fetch('/api/task', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
task_description: "Plan a birthday party for 20 people"
})
});-
General Assistant (
general)- Capabilities: Q&A, explanation, general knowledge
- Best for: General questions and conversations
-
Translator (
translator)- Capabilities: Translation, language detection
- Best for: Multi-language communication
-
Creative Writer (
creative)- Capabilities: Creative writing, brainstorming, storytelling
- Best for: Creative projects and idea generation
-
Problem Solver (
problem_solver)- Capabilities: Problem solving, logical reasoning, step-by-step guidance
- Best for: Complex problem analysis
-
Task Executor (
task_executor)- Capabilities: Task planning, autonomous execution, project management
- Best for: Planning and organizing tasks
- Backend: Add new routes in
src/routes/ - Frontend: Add new components in
src/components/ - AI Services: Extend
src/services/ai_service.py
The application uses SQLite with SQLAlchemy ORM:
Conversation: Stores conversation metadataMessage: Stores individual messages with role and content
Built with TypeScript and modern UI components:
- Tailwind CSS for styling
- shadcn/ui for UI components
- Lucide TypeScript for icons
Use the provided scripts for easy local deployment.
For production deployment:
- Set up a proper WSGI server (e.g., Gunicorn)
- Configure environment variables
- Set up a reverse proxy (e.g., Nginx)
- Use a production database (e.g., PostgreSQL)
-
OpenAI API Key Error
- Ensure your API key is set in environment variables
- Check API key validity and billing status
-
Database Errors
- Delete
src/database/app.dband restart to reset database - Check file permissions
- Delete
-
Frontend Build Issues
- Clear node_modules and reinstall dependencies
- Check Node.js version compatibility
-
Port Already in Use
- Change port in
src/main.pyor kill existing processes
- Change port in
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the Apache License.
For issues and questions:
- Check the troubleshooting section
- Review the API documentation
- Check console logs for error details
Rockbot - Your intelligent AI assistant for every task.