Spaces:
Configuration error
π Antigravity Notebook - Quick Start Guide
Get up and running with Antigravity Notebook in 5 minutes!
Step 1: Prerequisites
Ensure you have:
- β Python 3.9 or higher
- β Docker & Docker Compose
- β CUDA GPU (recommended, 16GB+ VRAM) or CPU (slower)
- β ~20GB free disk space (for model + data)
Step 2: Installation
Clone & Install
# Clone the repository
git clone <your-repo-url>
cd antigravity-notebook
# Install Python dependencies
pip install -r requirements.txt
Configure Environment
# Copy environment template
cp .env.example .env
# (Optional) Edit .env if you want custom settings
# Default settings work out of the box!
Step 3: Start PostgreSQL
# Start PostgreSQL with Docker Compose
docker-compose up -d
# Verify it's running
docker ps
You should see a container named antigravity_postgres running.
Step 4: Initialize Database
# Create database tables
python -m backend.database
You should see: β
Database initialized successfully!
Step 5: Start Backend API
# Start the FastAPI backend
python -m backend.main
Wait for:
β
CLaRa model loaded!
β
Antigravity Notebook is ready!
π API: http://0.0.0.0:8000
π Docs: http://0.0.0.0:8000/docs
Note: First startup takes ~5 minutes to download CLaRa-7B model (14GB).
Step 6: Start Frontend UI
Open a new terminal and run:
# Start Streamlit UI
streamlit run frontend/app_notebook.py
Your browser should automatically open to http://localhost:8501
Step 7: Create Your First Notebook
In the Streamlit UI:
Create a Notebook
- Click "Create New Notebook" in the sidebar
- Name it "My First Notebook"
- Add a description (optional)
- Click "Create Notebook"
Add a Source
- Choose one of:
- PDF: Upload a PDF file
- URL: Paste a webpage URL (e.g., Wikipedia article)
- Text: Paste some text content
Example URL to try:
https://en.wikipedia.org/wiki/Artificial_intelligence- Choose one of:
Wait for Processing
- The source will be compressed into latent tensors
- PDF (50 pages): ~30 seconds
- URL: ~20 seconds
- Text: ~10 seconds
Ask a Question
- Type a query in the chat box
- Example: "What are the main points discussed in this document?"
- Press Enter
- Wait ~10 seconds for response
View Sources
- Click "Sources" under the response to see which sources were cited
- Check the Memory Usage gauge to see context utilization
π You're Done!
You now have a working NotebookLM clone!
π Next Steps
Try These Examples:
Example 1: Research Assistant
- Create a notebook called "AI Research"
- Add these Wikipedia URLs:
- Ask: "Compare and contrast AI, ML, and Deep Learning"
Example 2: Document Analysis
- Create a notebook called "Company Docs"
- Upload 3-5 PDF reports or documents
- Ask: "Summarize the key findings across all documents"
Example 3: Web Research
- Create a notebook called "Topic Research"
- Add 5-10 URLs about a topic you're interested in
- Ask questions that require synthesizing information across sources
π οΈ Common Issues
Issue: "Database connection failed"
Solution: Ensure PostgreSQL is running
docker-compose up -d
docker ps # Check if container is running
Issue: "CUDA out of memory"
Solution: Use CPU mode
# Edit .env
DEVICE=cpu
Issue: "Model download is slow"
Solution: Be patient! CLaRa-7B is 14GB. It only downloads once.
Check progress at: ./model_cache/
Issue: "PDF extraction failed"
Solution: Ensure PDF has extractable text (not scanned images)
Issue: "URL scraping failed"
Solution: Some websites block scraping. Try a different URL.
π§ Configuration Tips
For CPU-Only Systems
Edit .env:
DEVICE=cpu
For Limited Memory
Reduce context window in .env:
MAX_CONTEXT_TOKENS=16384 # Half the default
For Production Use
Change database password:
POSTGRES_PASSWORD=<secure-password>Set secret key:
SECRET_KEY=<random-secure-key>Configure CORS in
backend/main.py:allow_origins=["https://your-frontend-domain.com"]
π Monitoring
Check API Health
curl http://localhost:8000/health
View Storage Stats
curl http://localhost:8000/stats
API Documentation
Open: http://localhost:8000/docs
Try the interactive API explorer!
π§ͺ Testing the API Directly
Create a Notebook
curl -X POST http://localhost:8000/notebooks/ \
-H "Content-Type: application/json" \
-d '{"name": "Test Notebook", "description": "API test"}'
List Notebooks
curl http://localhost:8000/notebooks/
Add Text Source
curl -X POST http://localhost:8000/sources/notebooks/<NOTEBOOK_ID>/sources/text \
-H "Content-Type: application/json" \
-d '{
"title": "Test Document",
"content": "This is a test document with some content to analyze."
}'
Query Notebook
curl -X POST http://localhost:8000/chat/notebooks/<NOTEBOOK_ID>/chat \
-H "Content-Type: application/json" \
-d '{"query": "What is this document about?"}'
π Learning More
- Read the Plan: See
ANTIGRAVITY_PLAN.mdfor architecture details - Explore the Code: Check out:
backend/services/context_manager.py- The "brain"backend/models/clara.py- CLaRa wrapperbackend/services/ingestion.py- Multi-modal processing
π‘ Pro Tips
- Start Small: Begin with 1-2 sources to understand the system
- Check Memory Usage: Watch the gauge to see when you hit limits
- Use Descriptive Titles: Makes it easier to understand citations
- Mix Source Types: PDFs + URLs + Text work great together
- Ask Synthesis Questions: The AI excels at combining information
π Need Help?
- Documentation: See
README.md - API Docs: http://localhost:8000/docs
- Issues: Open a GitHub issue
- Logs: Check terminal output for debugging
Happy NotebookLM-ing! π