Scalable AI Chatbot API built with Flask, OpenAI, and vector memory — designed for modular full-stack integration.
ChatForge is an intelligent conversational backend built for developers who want to integrate AI chat capabilities into any application.
It supports hybrid LLMs, contextual memory, modular API routes, and can be easily containerized for scalable deployment.
🧩 Originally inspired by @legendarystar143590's chatbot architecture.
Re-engineered and extended by @bughuntr7.
- Modular Flask API for chat endpoints
- Contextual memory layer (FAISS or Chroma)
- Switch between local and cloud LLMs
- Logging and analytics middleware
- Dockerized for scalable deployment
- CI/CD ready with GitHub Actions
Make sure you're using Python 3.10+, run:
pip install -r requirements.txtCreate a .env file in the project root and set your API keys:
OPENAI_API_KEY=
UPLOAD_FOLDER=
SERPER_API_KEY=
STORM_GLASS_API_KEY=💡 You can also use
.env.exampleas a template — included in the repo.
After setting up your environment variables, run this:
python app.pyYour ChatForge backend will be available at: ➡️ http://localhost:5000
For a production-grade deployment with multiple workers:
pm2 start "gunicorn -w 8 -t 16 -b 0.0.0.0:5000 --timeout 600 app:app"This runs Gunicorn with 8 workers and a 600-second timeout, managed by PM2 for reliability and monitoring.
POST /api/chat
Content-Type: application/json
{
"session_id": "user_1234",
"message": "Tell me a joke about engineers."
}Interactive API documentation is available at: ➡️ http://localhost:5000/api/docs/
The Swagger UI provides:
- Complete API endpoint documentation
- Request/response schemas
- Try-it-out functionality
- Authentication support
- Backend: Flask (Python 3.10+)
- AI: OpenAI API, LangChain, FAISS
- Infra: Docker, GitHub Actions, .env config
- Vector memory integration
- Async WebSocket streaming
- Custom LLM fine-tuning support
- Frontend demo with React
Built to forge conversations — intelligent, scalable, and yours.