CONVOPRO is a fully functional ChatGPT-style conversational AI application built with:
- Ollama for running LLMs locally
- Python for backend logic
- Streamlit for the UI
- MongoDB for storing conversations
Users can choose from multiple models , start new chats, continue previous chats from the sidebar, and store complete conversation history—just like the real ChatGPT interface.
CONVOPRO is my first AI Agent system , created to replicate the essential features of ChatGPT using locally hosted LLMs through Ollama . It supports:
✔️ Switching between different LLM models ✔️ Real-time streaming responses ✔️ Automatic chat title generation using an LLM ✔️ Storing message history in MongoDB ✔️ Sidebar displaying previous chats ✔️ Clean and lightweight Streamlit UI
This project demonstrates how to build a full-stack AI chatbot that manages interactions, memory, chat titles, and multiple model selections.
| Layer | Technologies |
|---|---|
| LLM Engine | Ollama (LLaMA 3, Mistral, Phi, etc.) |
| Backend | Python |
| Database | MongoDB |
| Frontend | Streamlit |
| Environment Handling | Python-dotenv |
| Utilities & Helpers | Custom-built Python modules |
Ollama is a local LLM hosting engine that allows you to run models like:
- LLaMA3
- Mistral
- Gemma
- Phi
- Many others
Using Ollama enables:
- Offline LLM inference
- Faster response times
- Data privacy
- Customizable models
CONVOPRO uses Ollama through a helper function (get_llm.py) to load and stream responses from selected models.
MongoDB is used to store:
- Each conversation
- User messages
- Assistant messages
- Chat titles
- Timestamps
The file conversations.py handles all MongoDB operations:
- Create a new chat
- Fetch conversation by ID
- Add messages
- View all chats in sidebar
This ensures persistent and structured conversation history, just like ChatGPT.
The model list is dynamically fetched from Ollama using:
services/get_models_list.py
A new chat ID is created and stored in MongoDB:
db/conversations.py
Message is stored in MongoDB and sent to the LLM:
services/chat_utilities.py
Response is generated by Ollama using:
llm_factory/get_llm.py
Then saved in MongoDB.
After the first message, the title is created using:
services/get_title.py
All stored chat titles are fetched via MongoDB.
In:
main.py
CONVOPRO
│── config/
│ ├── settings.py # Manage environment variables
│
│── db/
│ ├── conversations.py # All MongoDB operations
│ ├── mongo.py # MongoDB connection
│
│── llm_factory/
│ ├── get_llm.py # Initialize & configure Ollama models
│
│── services/
│ ├── chat_utilities.py # LLM response generation logic
│ ├── get_models_list.py # Fetch available models from Ollama
│ ├── get_title.py # Auto-generate chat titles
│
│── main.py # Streamlit UI (chat interface)
│── requirements.txt # Project dependencies
│── env_template.txt # Env variable template
│── .gitignore
│── README.md
│── venv/ (ignored)
pip install -r requirements.txt
Make sure you have Ollama installed:
Start your desired model, e.g.:
ollama pull llama3
Create .env based on env_template.txt
MONGO_URI=your_mongo_connection_string
DB_NAME=convopro
streamlit run main.py
🔹 User authentication 🔹 Model settings (temperature, max tokens) 🔹 Voice input / audio responses 🔹 Export chat history 🔹 Add image model support (LLaVA, Florence, etc.)
Pull requests are welcome! Feel free to suggest improvements, new features, or create issues.