AI Companion is a context-aware conversational AI system that simulates emotionally intelligent dialogue. The system uses a Retrieval-Augmented Generation (RAG) architecture to remember past conversations and generate more personalized responses over time.
The application combines a Django backend, a vector database for memory storage, and an LLM-powered response system to create a companion-style chatbot capable of multi-turn conversations.
Context-aware conversational AI using Retrieval-Augmented Generation (RAG)
Long-term memory using ChromaDB vector database
Semantic search using Sentence Transformer embeddings
Emotion-aware responses using a transformer-based classifier
Short-term conversation history + long-term semantic memory
Dynamic chat interface with message bubbles, avatars, and typing simulation
Multi-language conversational support (English, Hindi, Hinglish)
User Message
↓
Emotion Detection (Transformer Model)
↓
Semantic Retrieval from Vector Database (ChromaDB)
↓
Conversation History + Retrieved Context
↓
LLM Response Generation (Groq – Llama 3.1)
↓
Memory Storage (Vector + Chat History)
Python
Django
LangChain (LCEL)
Groq API (Llama 3.1)
Vector Database
ChromaDB
Sentence Transformers
HuggingFace Transformers
PyTorch
Scikit-learn
HTML
CSS
JavaScript
python-dotenv
SQLite
Retrieval-Augmented Generation (RAG)
Semantic search using vector embeddings
Conversational memory systems
Emotion-aware dialogue generation
Context retention across multi-turn conversations
User sends a message through the chat interface.
The system detects the user's emotional tone.
The message is converted into embeddings using Sentence Transformers.
Relevant past memories are retrieved from ChromaDB using semantic similarity.
Retrieved context + conversation history are passed to the LLM.
The LLM generates a contextual and emotionally aware response.
The interaction is stored in both short-term and long-term memory.
Streaming responses (token-by-token generation)
User profiles and persistent conversation sessions
Voice interaction support
Mobile-responsive UI
Advanced memory summarization
Sachin Mahajan
