Second Brain is a modern, high-performance personal knowledge management system. It allows you to connect your notes, documents, and thoughts into a unified, AI-powered interface. Using Retrieval-Augmented Generation (RAG), it provides instant answers to your questions based on your own data, complete with accurate citations.
- Semantic Search: Find information across your entire knowledge base using natural language.
- Instant Retrieval: Get answers in seconds, backed by your local or remote documents.
- Persistence: Chat history is saved to MongoDB, allowing you to pick up where you left off.
- RAG Engine: Powered by LangChain and ChromaDB for efficient document ingestion and retrieval.
- Privacy First: Your data remains yours. Processes are designed for secure, local-first workflows where possible.
- Modern UI: A sleek, reactive interface built with Next.js, Framer Motion, and Tailwind CSS.
- Frontend: Next.js 15+, React 19, Tailwind CSS, Framer Motion
- AI/LLM: LangChain, Google Gemini API, Vercel AI SDK
- Database: MongoDB (Session storage), ChromaDB (Vector store)
- ORM: Prisma
- Deployment: Vercel
- Node.js 20+
- MongoDB instance (local or Atlas)
- ChromaDB instance
- Google Gemini API Key
Create a .env file in the root directory and add the following:
MONGODB_URI=your_mongodb_uri
GOOGLE_GENERAI_API_KEY=your_gemini_api_key
CHROMA_URL=your_chromadb_url-
Clone the repository:
git clone https://github.com/Yuvadi29/Second-Brain.git cd second-brain -
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open the app: Navigate to http://localhost:3000.
- Ingestion: Place your documents (PDF, Markdown, Text) in the
knowledge/directory. - Processing: The system chunks the text, generates embeddings, and stores them in ChromaDB.
- Retrieval: When you ask a question, the system finds the most relevant chunks.
- Generation: The LLM uses the retrieved context to generate a precise answer with citations.
Second Brain includes a GitHub Actions workflow that automatically ingests new documents whenever you push changes to the knowledge/ directory.
The convertToEmbeddings.yml workflow:
- Triggers on any push to the
knowledge/directory - Detects all changed files automatically
- Sends files to the ingestion API endpoint
- Embeds content into ChromaDB for instant searching
-
Add your ingestion API key to GitHub Secrets:
- Go to your repository Settings → Secrets and variables → Actions
- Create a new secret named
INGEST_API_KEY
-
Update the ingestion API URL in
.github/workflows/convertToEmbeddings.yml:INGEST_API_URL: your_api_endpoint_url
-
Ensure your ingestion server is running and accessible
-
Push changes to the
knowledge/directory to trigger the workflow
- Check the Actions tab in your GitHub repository to see workflow execution logs
- Each run shows which files were processed and any ingestion status
For a more detailed guide on setup, architecture, and extension, visit the Documentation Page (available locally).
