# DocuMente & NotebookLM Agent [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![FastAPI](https://img.shields.io/badge/FastAPI-0.100+-009688.svg)](https://fastapi.tiangolo.com/) [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff) [![Tests](https://img.shields.io/badge/tests-pytest-blue.svg)](https://docs.pytest.org/) > **Due Sistemi AI - Usali Separatamente o Insieme** Questo repository contiene **due sistemi AI indipendenti** che puoi usare separatamente o insieme: --- ## πŸ€– NotebookLM Agent API REST per gestire **Google NotebookLM** programmaticamente. ### Cosa fa - Crea e gestisci notebook NotebookLM - Aggiungi fonti (URL, PDF, YouTube, Drive) - Chat con le fonti - Genera contenuti (podcast, video, quiz, flashcard) - Ricevi notifiche via webhook ### Requisiti - Python 3.10+ - Account Google NotebookLM ### Installazione ```bash # Clona e installa git clone cd documente uv venv --python 3.10 source .venv/bin/activate uv sync # Autenticazione NotebookLM (prima volta) notebooklm login ``` ### Avvio ```bash uv run fastapi dev src/notebooklm_agent/api/main.py ``` API disponibile su: http://localhost:8000 ### Esempio ```bash # Crea notebook curl -X POST http://localhost:8000/api/v1/notebooks \ -H "Content-Type: application/json" \ -d '{"title": "Ricerca AI"}' # Aggiungi fonte curl -X POST http://localhost:8000/api/v1/notebooks/{id}/sources \ -d '{"type": "url", "url": "https://example.com"}' ``` πŸ“š **Documentazione**: [SKILL.md](./SKILL.md) --- ## 🧠 DocuMente (RAG con NotebookLM) Sistema **RAG** (Retrieval-Augmented Generation) che permette di: - Caricare documenti (PDF, DOCX, TXT, MD) - Sincronizzare notebook da NotebookLM - Fare ricerche semantiche su entrambi - Chat con LLM multi-provider ### Cosa fa - **Ricerca su documenti**: Carica file e fai domande - **Ricerca su notebook**: Sincronizza notebook NotebookLM e interrogali - **Ricerca combinata**: Cerca sia nei documenti che nei notebook ### Requisiti - Python 3.10+ - **Qdrant** (vector database) - Node.js 18+ (per frontend opzionale) ### Installazione ```bash # Dipendenze giΓ  installate con uv sync sopra # Avvia Qdrant (richiesto) docker run -p 6333:6333 qdrant/qdrant ``` ### Avvio ```bash # Backend uv run fastapi dev src/agentic_rag/api/main.py # Frontend (opzionale) cd frontend && npm install && npm run dev ``` Servizi: - API: http://localhost:8000/api - Web UI: http://localhost:3000 ### Esempi ```bash # Carica documento curl -X POST http://localhost:8000/api/v1/documents \ -F "file=@documento.pdf" # Sincronizza notebook da NotebookLM curl -X POST http://localhost:8000/api/v1/notebooklm/sync/{notebook_id} # Fai una domanda (cerca in documenti + notebook) curl -X POST http://localhost:8000/api/v1/query \ -H "Content-Type: application/json" \ -d '{ "question": "Trova informazioni su...", "notebook_ids": ["uuid-notebook"], "include_documents": true }' ``` πŸ“š **Documentazione Integrazione**: [docs/integration.md](./docs/integration.md) --- ## πŸ”§ Configurazione Crea un file `.env` nella root: ```env # Per NotebookLM Agent NOTEBOOKLM_HOME=~/.notebooklm # Per DocuMente (almeno un provider LLM) OPENAI_API_KEY=sk-... # o altro provider # Per ricerche su notebook (opzionale) OLLAMA_BASE_URL=http://localhost:11434 # se usi Ollama LMSTUDIO_BASE_URL=http://localhost:1234 # se usi LM Studio # Qdrant (solo per DocuMente) QDRANT_HOST=localhost QDRANT_PORT=6333 ``` --- ## πŸ“ Struttura Progetto ``` documente/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ notebooklm_agent/ # πŸ€– Solo NotebookLM β”‚ β”‚ β”œβ”€β”€ api/ β”‚ β”‚ └── services/ β”‚ β”‚ β”‚ └── agentic_rag/ # 🧠 RAG + NotebookLM β”‚ β”œβ”€β”€ api/ β”‚ β”œβ”€β”€ services/ β”‚ └── ... β”‚ β”œβ”€β”€ frontend/ # 🎨 Web UI (solo per RAG) β”œβ”€β”€ docs/ β”‚ └── integration.md # Guida integrazione β”‚ └── tests/ ``` --- ## πŸ“š Documentazione | File | Descrizione | |------|-------------| | **[SKILL.md](./SKILL.md)** | Guida completa NotebookLM Agent | | **[docs/integration.md](./docs/integration.md)** | Come integrare NotebookLM con RAG | | **[CONTRIBUTING.md](./CONTRIBUTING.md)** | Come contribuire | --- ## ❓ FAQ **Q: Devo usare entrambi i sistemi?** A: No! Puoi usare solo NotebookLM Agent, solo DocuMente, o entrambi. **Q: NotebookLM Agent richiede Qdrant?** A: No, funziona standalone senza database. **Q: Posso cercare solo nei notebook senza caricare documenti?** A: SΓ¬, usa DocuMente e sincronizza solo i notebook. **Q: Quali provider LLM supporta DocuMente?** A: OpenAI, Anthropic, Google, Mistral, Azure, Ollama (locale), LM Studio (locale). --- ## Licenza ProprietΓ  di Luca Sacchi Ricciardi. Tutti i diritti riservati. **Contatto**: luca@lucasacchi.net