Context-Aware AI Chat System with Long-Term Memory
BrainStack-AI is a full-stack AI chat application that remembers conversations using vector memory and generates context-aware responses. It simulates a persistent intelligent assistant similar to modern AI platforms.
This project is actively under development.
Completed:
- Authentication system
- Real-time chat
- Vector memory integration
- Context-aware AI responses
- React frontend with theme toggle
In progress:
- UI polish
- Deployment
- Advanced features
- AI-powered chat assistant
- Long-term memory using vector embeddings
- Context-aware responses
- Real-time messaging with Socket.io
- Secure JWT authentication
- React-based modern UI
- Dark/Light theme toggle
- Scalable backend architecture
- React
- Vite
- Axios
- Socket.io Client
- Custom CSS
- Node.js
- Express.js
- MongoDB
- JWT Authentication
- Socket.io
- Gemini embeddings
- Pinecone vector database
- Context retrieval system
User
↓
React Frontend
↓
Socket.io / REST API
↓
Node.js + Express Backend
↓
Message Processing
↓
Gemini Embeddings
↓
Pinecone Vector Storage
↓
Context Retrieval
↓
AI Response
↓
User
BrainStack-AI/
│
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ │ ├── auth.controller.js
│ │ │ └── chat.controller.js
│ │ │
│ │ ├── db/
│ │ │ └── db.js
│ │ │
│ │ ├── middlewares/
│ │ │ └── auth.middleware.js
│ │ │
│ │ ├── models/
│ │ │ ├── user.model.js
│ │ │ ├── chat.model.js
│ │ │ └── message.model.js
│ │ │
│ │ ├── routes/
│ │ │ ├── auth.routes.js
│ │ │ └── chat.routes.js
│ │ │
│ │ ├── services/
│ │ │ ├── ai.service.js
│ │ │ └── vector.service.js
│ │ │
│ │ ├── sockets/
│ │ │ └── socket.server.js
│ │ │
│ │ └── app.js
│ │
│ ├── .env
│ ├── server.js
│ ├── package.json
│ └── package-lock.json
│
├── frontend/
│ ├── public/
│ │
│ ├── src/
│ │ ├── assets/
│ │ │
│ │ ├── components/
│ │ │ └── chat/
│ │ │ ├── ChatComposer.jsx
│ │ │ ├── ChatMessages.jsx
│ │ │ ├── ChatSidebar.jsx
│ │ │ ├── ChatMobileBar.jsx
│ │ │ ├── ThemeToggle.jsx
│ │ │ ├── ChatComposer.css
│ │ │ ├── ChatLayout.css
│ │ │ ├── ChatMessages.css
│ │ │ ├── ChatSidebar.css
│ │ │ └── ChatMobileBar.css
│ │ │
│ │ ├── pages/
│ │ │ ├── Home.jsx
│ │ │ ├── Login.jsx
│ │ │ └── Register.jsx
│ │ │
│ │ ├── store/
│ │ │
│ │ ├── styles/
│ │ │ └── theme.css
│ │ │
│ │ ├── App.jsx
│ │ ├── AppRoutes.jsx
│ │ ├── main.jsx
│ │ ├── App.css
│ │ └── index.css
│ │
│ ├── package.json
│ ├── package-lock.json
│ ├── vite.config.js
│ ├── eslint.config.js
│ └── index.html
│
├── .gitignore
├── README.md
├── package.json
└── package-lock.json
git clone https://github.com/thakare18/BrainStack-AI.git
cd BrainStack-AIcd backend
npm installCreate .env file inside backend:
PORT=5000
MONGO_URI=your_mongodb_connection
JWT_SECRET=your_secret
GEMINI_API_KEY=your_api_key
PINECONE_API_KEY=your_api_key
Start backend:
npm startcd frontend
npm install
npm run devFrontend runs on:
http://localhost:5173
- User sends a message.
- Message stored in MongoDB.
- Converted into vector embeddings.
- Stored in Pinecone.
- Relevant memories retrieved on new queries.
- AI generates context-aware response.
Postman collection available in:
.postman/
Endpoints include:
- Register
- Login
- Create Chat
- Send Message
- Get Messages
Prathamesh Thakare