AI Memory Assistant is a personal memory-enabled chatbot built using LangChain, FAISS, Hugging Face Embeddings, and Groq LLMs.
Unlike traditional chatbots, this assistant can remember important information shared by users, retrieve relevant memories using semantic search, and generate personalized responses.
The project demonstrates concepts such as:
- AI Agents
- Long-Term Memory
- Vector Databases
- Embeddings
- Retrieval-Augmented Generation (RAG)
- Large Language Models (LLMs)
User
│
▼
Memory Agent
│
├── Memory Retrieval
│ │
│ ▼
│ FAISS Vector Store
│
├── Memory Storage
│ │
│ ▼
│ FAISS Vector Store
│
▼
Prompt Builder
│
▼
Groq LLM (Llama 3.1)
│
▼
Response
The user enters a message.
Example:
My name is Rahul
The query is converted into embeddings and compared against stored memories using FAISS.
Relevant memories are added to the prompt along with the user's current message.
Example:
Relevant Memories:
My name is Rahul
Current User Message:
What is my name?
The prompt is sent to the Groq-hosted Llama 3.1 model.
The model generates a contextual response.
Example:
Your name is Rahul.
Important user information such as:
- Name
- Interests
- Preferences
- Goals
- Skills
is automatically stored for future retrieval.
- Python
- LangChain
- Groq API
- Llama 3.1 8B Instant
- FAISS Vector Database
- Hugging Face Embeddings
- Sentence Transformers
- dotenv
AI-Memory-Assistant/
│
├── app.py
├── agent.py
├── memory_store.py
├── tools.py
├── requirements.txt
├── .env.example
├── .gitignore
└── README.md
Clone the repository:
git clone https://github.com/your-username/AI-Memory-Assistant.git
cd AI-Memory-AssistantInstall dependencies:
pip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_hereGet a free API key from Groq Console.
Start the application:
python app.pyExample:
You: My name is Rahul
Assistant: Nice to meet you Rahul.
You: What is my name?
Assistant: Your name is Rahul.
The Memory Agent coordinates memory retrieval, memory storage, prompt generation, and response generation.
Text is converted into vector representations using Hugging Face sentence-transformer models.
FAISS stores embeddings and performs similarity search.
Relevant memories are retrieved from FAISS and injected into the prompt before sending it to the LLM.
The assistant can find related memories even when exact keywords do not match.
- Streamlit Web Interface
- Multi-user Memory Support
- Memory Categorization
- Memory Importance Scoring
- Conversation History Tracking
- Database Integration (MongoDB/PostgreSQL)
Developed as a mini project to demonstrate AI Agents, Memory Systems, Vector Databases, and Retrieval-Augmented Generation using LangChain.