sandbox-notebookllamalm/OLD-readme/README_ENTERPRISE.md

6.3 KiB

NotebookLlaMa 🦙 - Enterprise Edition

An enterprise-ready, open-source alternative to NotebookLM with multi-user support, authentication, and document management.

Features

Core Features

  • 📄 PDF Processing: Upload PDFs and generate comprehensive summaries, Q&A, and mind maps
  • 💬 Document Chat: Have AI-powered conversations with your documents
  • 🎙️ Podcast Generation: Create engaging audio conversations from documents
  • 📊 Observability: Full tracing with Jaeger and OpenTelemetry

🆕 Enterprise Features

  • 🔐 User Authentication: Secure login and registration system
  • 👥 Multi-user Support: Complete data isolation per user
  • 📚 Document Library: Persistent storage of all processed documents
  • 💾 Chat History: Save and resume conversations
  • 🤝 Document Sharing: Share documents with other users with granular permissions
  • 🔒 Access Control: Role-based permissions (Read/Write/Admin)
  • 📊 User Dashboard: Centralized view of all documents and activities

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/run-llama/notebookllama
    cd notebookllama
    
  2. Install dependencies

    uv sync
    
  3. Configure environment variables

    cp .env.example .env
    # Edit .env with your API keys
    

    Required API keys:

  4. Run setup scripts

    uv run tools/create_llama_extract_agent.py
    uv run tools/create_llama_cloud_index.py
    
  5. Start the application

    ./start.sh
    

    Or manually:

    # Terminal 1: Start infrastructure
    docker compose up -d
    
    # Terminal 2: Start MCP server
    uv run src/notebookllama/server.py
    
    # Terminal 3: Start Streamlit app
    streamlit run src/notebookllama/App.py
    
  6. Access the application

📖 Usage

Processing Documents

  1. Click "Process Document" in the navigation
  2. Upload a PDF file
  3. Click "Process Document" button
  4. Wait 2-3 minutes for processing
  5. View generated summary, highlights, Q&A, and mind map

Chatting with Documents

  1. Go to "Document Chat"
  2. Select a document from the dropdown
  3. Ask questions about your document
  4. Previous conversations are automatically saved

Managing Documents

  1. Go to "My Documents" to see all your processed documents
  2. Click on a document to view details
  3. Use the "Share" button to share with other users
  4. View shared documents in "Shared With Me"

Generating Podcasts

  1. After processing a document
  2. Click "Generate In-Depth Conversation"
  3. Wait for audio generation
  4. Listen to the AI-generated podcast discussion

🏗️ Architecture

Technology Stack

  • Frontend: Streamlit
  • Backend: FastMCP, LlamaIndex
  • Database: PostgreSQL
  • LLM: OpenAI GPT-4
  • Parsing: LlamaParse
  • Audio: ElevenLabs
  • Observability: Jaeger, OpenTelemetry
  • Authentication: bcrypt, session-based

Database Schema

  • users: User accounts and authentication
  • documents: Uploaded PDF documents
  • notebooks: Processed summaries and Q&A
  • chat_sessions: Chat conversation sessions
  • chat_messages: Individual messages
  • document_shares: Sharing permissions

🔧 Configuration

Environment Variables

# API Keys
OPENAI_API_KEY="your-openai-key"
LLAMACLOUD_API_KEY="your-llamacloud-key"
ELEVENLABS_API_KEY="your-elevenlabs-key"

# LlamaCloud Configuration
EXTRACT_AGENT_ID="your-agent-id"
LLAMACLOUD_PIPELINE_ID="your-pipeline-id"

# Database Configuration
pgql_db=postgres
pgql_user=postgres
pgql_psw=admin

Docker Services

The application uses Docker Compose for:

  • PostgreSQL (port 5432): Database
  • Jaeger (port 16686): Distributed tracing UI
  • Adminer (port 8080): Database administration

🐛 Troubleshooting

PostgreSQL Connection Issues

If you see "role does not exist" errors:

# Stop local PostgreSQL
brew services stop postgresql@14
killall postgres

# Recreate Docker containers
docker compose down -v
docker compose up -d

# Reinitialize database
uv run src/notebookllama/init_database.py

MCP Server Not Responding

# Check if server is running
lsof -i :8000

# Restart server
killall python
uv run src/notebookllama/server.py

Missing Environment Variables

If services fail to start, ensure all required environment variables are set in .env:

  • OPENAI_API_KEY
  • LLAMACLOUD_API_KEY
  • ELEVENLABS_API_KEY
  • EXTRACT_AGENT_ID
  • LLAMACLOUD_PIPELINE_ID

📚 Documentation

🔒 Security

  • Passwords are hashed using bcrypt
  • SQL injection protection via SQLAlchemy ORM
  • Session-based authentication
  • Per-user data isolation
  • Document access controls

🚀 Deployment

For production deployment, consider:

  • Using managed PostgreSQL (AWS RDS, Google Cloud SQL)
  • Setting up HTTPS/TLS
  • Implementing rate limiting
  • Adding Redis for caching
  • Using a reverse proxy (nginx)
  • Setting up monitoring and alerting
  • Regular backups

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

📝 License

This project is licensed under the MIT License - see LICENSE for details.

🙏 Acknowledgments

📞 Support


Made with ❤️ by the LlamaIndex team and contributors