A fully local, privacy-first AI assistant with long-term memory, semantic retrieval, conversation history, and personalized reasoning.
Second Brain is an AI-powered personal assistant that learns about you over time, remembers important facts, retrieves relevant conversations, summarizes long-term interactions, and answers questions using your personal context.
Unlike cloud-based AI assistants, all data stays on your machine.
No OpenAI API.
No external databases.
No cloud storage.
Everything runs locally using open-source models.
Most AI assistants are statelessβthey forget everything after a conversation.
Second Brain is designed to become your personal AI Chief of Staff, capable of:
- Remembering who you are
- Tracking long-term goals
- Recalling past conversations
- Understanding relationships
- Building a persistent profile
- Providing personalized recommendations
- Running completely offline
Extracts and stores important facts about the user.
Example:
User:
I am a backend engineer.
Stored:
profession β backend engineer
Stores every user and assistant interaction.
Later:
What did I tell you about Germany?
The assistant retrieves the relevant conversation instead of guessing.
Uses sentence embeddings and ChromaDB to retrieve only the most relevant memories instead of sending everything to the LLM.
Technology:
- Sentence Transformers
- ChromaDB
- Vector Search
Automatically summarizes conversations after a configurable number of chats.
Instead of searching hundreds of messages, the assistant searches concise summaries.
Example summary:
Career:
Preparing for Google interviews
Fitness:
Started muscle gain plan
Personal:
Visited Germany for work
Goals:
1Cr salary
Builds a persistent profile of the user.
Example:
{
"profession": "Backend Engineer",
"company": "Siemens",
"diet": "Vegetarian",
"goals": [
"1Cr Salary"
]
}Supports updating user attributes such as:
- Profession
- Company
- Diet
- Location
instead of storing duplicate memories.
Everything runs locally.
No user data leaves your computer.
No API keys required.
- Next.js
- React
- TypeScript
- FastAPI
- SQLAlchemy
- SQLite
- Ollama
- Phi-3 / Qwen2.5
- Sentence Transformers
- ChromaDB
+----------------------+
| Next.js UI |
+----------+-----------+
|
|
FastAPI REST API
|
+----------------------+----------------------+
| |
| |
Fact Extraction Conversation Storage
| |
| |
SQLite Database SQLite Database
| |
+----------------------+----------------------+
|
Embedding Generation
|
Sentence Transformers
|
ChromaDB Vector DB
|
+-----------------+-----------------+
| | |
Facts Search Conversation Search Summary Search
| | |
+-----------------+-----------------+
|
Context Construction
|
Ollama (Phi3/Qwen)
|
Personalized Response
second-brain/
βββ backend/
β βββ app.py
β βββ database.py
β βββ memory_service.py
β βββ vector_store.py
β βββ models.py
β βββ schemas.py
β βββ memory.db
β
βββ frontend/
β βββ app/
β βββ components/
β βββ package.json
β
βββ README.md
Second Brain stores three different kinds of memory.
Structured information.
Examples:
Profession
Company
Goals
Diet
Friends
Complete chat history.
Example:
User:
I visited Germany in March.
Assistant:
That's great! How was your trip?
Compressed long-term memory.
Example:
June Summary
Career:
Google Interview Preparation
Travel:
Germany
Fitness:
Bulking Journey
POST /chat
GET /memories
Returns all structured memories.
GET /conversations
Returns conversation history.
GET /summaries
Returns generated conversation summaries.
GET /profile
Returns the current user profile.
GET /debug-context
Displays the context being sent to the LLM.
GET /reindex
Rebuilds the vector database from stored memories.
brew install ollamaStart Ollama
ollama servePull a model
ollama pull phi3or
ollama pull qwen2.5:7bcd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reloadcd frontend
npm install
npm run dev- β Local LLM
- β Persistent Memory
- β Fact Extraction
- β Conversation Storage
- β Conversation Retrieval
- β Semantic Search
- β Vector Embeddings
- β Long-Term Summaries
- β Dynamic User Profile
- β Personalized Responses
- β Fully Offline
- Memory conflict detection
- Memory confidence scores
- Memory importance ranking
- Relationship extraction
- Entity recognition
- Dynamic knowledge graph
- Neo4j integration
- Relationship reasoning
- Document ingestion (PDF, Notes, Resume)
- Local RAG pipeline
-
Personal AI Agents
- Career Agent
- Health Agent
- Finance Agent
- Relationship Agent
- Daily Briefings
- Weekly Summaries
- Proactive Suggestions
- Goal Tracking
Second Brain is more than a chatbot.
It aims to become a local AI operating system that understands your life, remembers your experiences, and assists you in making better decisions while ensuring complete privacy.
MIT License