Building your Second Brain

Everything you need to know to build, configure, and extend your AI-powered knowledge management system. Designed for thinkers, builders, and everyone in between.

Project Overview

The Second Brain project is born out of the need to organize the vast amount of information we consume daily. Traditional note-taking is static; Second Brain makes it dynamic.

Multi-Format

Support for Markdown files out of the box.

AI-Core

Driven by Gemini 2.5 flash for deep reasoning and synthesis.

Vector Store

ChromaDB ensures lightning fast retrieval of relevant context.

Setup Guide

Terminal

# Step 1: Star and Fork the Repository

Repo Link

# Step 2: Clone and install

git clone https://github.com/Yuvadi29/Second-Brain.git

cd second-brain && npm install

# Step 3: Configure environment

cp .env.example .env

# Step 4: Start development

npm run dev

Environment Variables

  • MONGODB_URI: Your connection string for persistent chat history.
  • GOOGLE_GENERATIVE_API_KEY: Used for both embeddings and response generation.
  • CHROMA_URL: The URL of your ChromaDB instance (local or hosted).

How it Works

1
Data Ingestion

Documents in knowledge/ are loaded and split into semantic chunks.

2
Vectorization

Gemini generates high-dimensional embeddings for each chunk, stored in ChromaDB.

3
Retrieval & Chat

Natural language queries trigger a similarity search, fetching context for the LLM.

Automated Knowledge Ingestion

Second Brain uses GitHub Actions to automatically ingest and index any new documents you add to the knowledge/ directory. When you push changes to your repository, the workflow detects modified files and sends them to the ingestion pipeline.

⚙️How It Works

  • • Detects changes in knowledge/** directory
  • • Identifies all modified files automatically
  • • Sends files to the ingestion API endpoint
  • • Files are chunked and embedded into ChromaDB
  • • Instantly available for semantic search

🔧Setup Required

  • • Add your API key to GitHub Secrets as INGEST_API_KEY
  • • Update the INGEST_API_URL in workflow
  • • Ensure your ingestion server is running
  • • Commit changes to knowledge/ to trigger
  • • Monitor Actions tab for execution logs
Workflow Example: convertToEmbeddings.yml

name: Ingest Knowledge Base

on:

push:

paths:

- "knowledge/**"

jobs:

ingest:

runs-on: ubuntu-latest

steps:

- name: Ingest changed files

curl -X POST to API with file content

Ready to expand your mind?

Start by adding your first document to the knowledge base and see the magic happen in the chat interface.