A full-stack AI application similar to Google NotebookLM, built with a multi-agent architecture for document ingestion, semantic search, and LLM-powered question-answering with citations.
- Parser Agent - Handles document processing (PDF, DOCX, TXT, URLs)
- Embedding Agent - Converts text chunks to vector embeddings
- Retriever Agent - Performs semantic search over vector database
- RAG Prompting Agent - Generates answers with LLM integration and citations
- Chat History Agent - Manages conversation sessions and context
Backend (FastAPI + Python)
- FastAPI for REST API
- SQLAlchemy for database ORM
- ChromaDB for vector storage
- Sentence Transformers for embeddings
- OpenAI/Anthropic API integration
- JWT authentication
Frontend (React + TypeScript)
- React 18 with TypeScript
- Tailwind CSS for styling
- React Query for state management
- Zustand for auth state
- React Router for navigation
Database & Storage
- SQLite/PostgreSQL for metadata
- ChromaDB for vector embeddings
- Local file storage for documents
- Document Upload: Support for PDF, DOCX, TXT files and web URLs
- Semantic Search: AI-powered search across all documents
- Question Answering: Get answers with source citations
- Chat Sessions: Threaded conversations with context
- Document Management: Upload, view, and organize documents
- User Authentication: Secure login and user management
- Python 3.8+
- Node.js 16+
- npm or yarn
git clone <repository-url>
cd notebooklm-clone# Install root dependencies
npm install
# Install all dependencies (frontend + backend)
npm run install:allCreate environment files:
# Backend environment
cp backend/.env.example backend/.envEdit backend/.env with your configuration:
# Required for LLM integration
OPENAI_API_KEY=your_openai_api_key_here
# Optional - for production
DATABASE_URL=postgresql://username:password@localhost:5432/notebooklm_db
SECRET_KEY=your_secret_key_hereOption 1: Run both frontend and backend together
npm run devOption 2: Run separately
# Terminal 1 - Backend
cd backend
python dev.py
# Terminal 2 - Frontend
cd frontend
npm run devOnce the backend is running, visit:
- API Documentation: http://localhost:8000/docs
- Alternative docs: http://localhost:8000/redoc
- Register/Login: Create an account or sign in
- Upload Documents: Add PDF, DOCX, TXT files or web URLs
- Ask Questions: Use the chat interface to query your documents
- View Citations: See source references for all answers
- Search: Use semantic search to find relevant content
- Manage: Organize documents and chat sessions
Key environment variables in backend/.env:
# Database
DATABASE_URL=sqlite:///./notebooklm.db
# API Keys
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
# Security
SECRET_KEY=your_secret_key
JWT_EXPIRE_MINUTES=30
# Storage
CHROMA_PERSIST_DIRECTORY=./chroma_db
UPLOAD_DIR=./uploads
MAX_FILE_SIZE_MB=50
# CORS
ALLOWED_ORIGINS=http://localhost:3000The frontend automatically proxies API requests to the backend during development.
cd backend
# Install dependencies
pip install -r requirements.txt
# Run with auto-reload
python dev.py
# Run tests (when implemented)
pytestcd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run linting
npm run lintnotebooklm-clone/
โโโ backend/
โ โโโ app/
โ โ โโโ agents/ # Multi-agent system
โ โ โโโ models/ # Database models
โ โ โโโ routers/ # API routes
โ โ โโโ services/ # Business logic
โ โ โโโ utils/ # Utilities
โ โโโ requirements.txt
โ โโโ dev.py
โโโ frontend/
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ pages/ # Page components
โ โ โโโ services/ # API services
โ โ โโโ stores/ # State management
โ โ โโโ types/ # TypeScript types
โ โโโ package.json
โโโ package.json
- Set production environment variables
- Use a production WSGI server like Gunicorn:
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker- Build the frontend:
cd frontend && npm run build- Serve the
distfolder with a web server
Docker configurations can be added for containerized deployment.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Real-time collaborative Q&A sessions
- Advanced document processing (images, tables)
- Integration with more LLM providers
- Document version control
- Advanced analytics and insights
- Mobile app support
- API rate limiting and quotas
- Advanced search filters
- Document annotations and highlights
- Large file uploads may timeout (increase server timeout)
- Vector database rebuilds on restart with SQLite
- Limited file type support (expanding)
For questions or issues:
- Check the documentation
- Search existing issues
- Create a new issue with details
Built with โค๏ธ using modern AI and web technologies