CCVec - Common Crawl to Vector Stores
Search, analyze, and index Common Crawl data into vector stores for RAG applications. Three surfaces available:
- CLI
- Python library
- MCP server
Quick Start
Environment variables:
ATHENA_OUTPUT_BUCKET - Required S3 bucket for Athena query results (needed for reliable queries to Common Crawl metadata)
AWS_ACCESS_KEY_ID - Required for Athena/S3 access (needed to run Athena queries)
AWS_SECRET_ACCESS_KEY - Required for Athena/S3 access (needed to run Athena queries)
AWS_SESSION_TOKEN - Optional for Athena/S3 access (needed to run Athena queries). This is required for temporary credentials
OPENAI_API_KEY - Required for vector operations (index, query, list)
OPENAI_BASE_URL - Optional custom OpenAI endpoint (e.g., http://localhost:8321/v1 for Llama Stack)
OPENAI_EMBEDDING_MODEL - Embedding model to use (e.g., text-embedding-3-small, ollama/nomic-embed-text:latest)
OPENAI_EMBEDDING_DIMENSIONS - Embedding dimensions (optional, model-specific)
AWS_DEFAULT_REGION - AWS region (defaults to us-west-2)
LOG_LEVEL - Logging level (defaults to INFO)
Note: Uses SQL wildcards (%) not glob patterns (*) for URL matching.
1. ⌨️ Command Line
# Search Common Crawl index
uv run cc-vec search --url-patterns "%.github.io" --limit 10
# Get statistics
uv run cc-vec stats --url-patterns "%.edu"
# Fetch and process content (returns clean text)
uv run cc-vec fetch --url-patterns "%.example.com" --limit 5
# Advanced filtering - multiple filters can be combined
uv run cc-vec fetch --url-patterns "%.github.io" --status-codes "200,201" --mime-types "text/html" --limit 10
# Filter by hostname instead of pattern
uv run cc-vec search --url-host-names "github.io,github.com" --limit 10
# Filter by TLD for better performance (uses indexed column)
uv run cc-vec search --url-host-tlds "edu,gov" --limit 20
# Filter by registered domain (uses indexed column)
uv run cc-vec search --url-host-registered-domains "github.com,example.com" --limit 15
# Filter by URL path (for specific site sections)
uv run cc-vec search --url-host-names "github.io" --url-paths "/blog/%,/docs/%" --limit 10
# Query across multiple Common Crawl datasets
uv run cc-vec search --url-patterns "%.edu" --crawl-ids "CC-MAIN-2024-33,CC-MAIN-2024-30" --limit 20
# List available Common Crawl datasets
uv run cc-vec list-crawls
# List all available filter columns (no API keys needed)
uv run cc-vec list-filter-columns
uv run cc-vec list-filter-columns --output json
# Vector operations (require OPENAI_API_KEY)
# Create vector store with processed content (OpenAI handles chunking with token limits)
uv run cc-vec index --url-patterns "%.github.io" --vector-store-name "ml-research" --limit 50 --chunk-size 800 --overlap 400
# Vector store name is optional - will auto-generate if not provided
uv run cc-vec index --url-patterns "%.github.io" --limit 50
# List cc-vec vector stores (default - only shows stores created by cc-vec)
uv run cc-vec list --output json
# List ALL vector stores (including non-cc-vec stores)
uv run cc-vec list --all
# Query vector store by ID for RAG
uv run cc-vec query "What is machine learning?" --vector-store-id "vs-123abc" --limit 5
# Query vector store by name
uv run cc-vec query "Explain deep learning" --vector-store-name "ml-research" --limit 3
# Fetch → Index Pipeline (for large datasets or multi-step workflows)
# Step 1: Fetch and save content to files
uv run cc-vec fetch --url-patterns "%.github.io" --output-dir ./fetched_data/ --limit 100
# Step 2: Index from saved files (can be run later or on different machine)
uv run cc-vec index --input-dir ./fetched_data/ --vector-store-name "my-research"
# Use --batch-size to reduce load on embedding service (helps with local models)
uv run cc-vec index --input-dir ./fetched_data/ --batch-size 5 --limit 50
# Use --provider-id to specify vector store backend (Llama Stack only)
uv run cc-vec index --input-dir ./fetched_data/ --provider-id chromadb --vector-store-name "persistent-store"
Pipeline Benefits
The fetch → index pipeline allows you to:
- Fetch data once and index multiple times with different configurations
- Process data on a different machine than where it was fetched
- Resume indexing if the process was interrupted
- Share fetched data with others
Advanced Options
--batch-size N: Upload files in batches of N to reduce load on embedding services (recommended for local models like Ollama)
--provider-id ID: Specify vector store backend for Llama Stack (chromadb for persistent storage, faiss for in-memory)
1.5. Local Llama Stack Setup (Optional)
Run cc-vec with local models using Ollama + Llama Stack. This provides a fully local version.
Step 1: Install and Start Ollama
# Install Ollama (macOS/Linux)
curl -fsSL https://ollama.com/install.sh | sh
# Start Ollama server
ollama serve &
# Pull required models
ollama pull llama3.2:3b # Inference model
ollama pull nomic-embed-text # Embedding model (768 dimensions)
Step 2: Start ChromaDB (Optional - for persistent vector storage)
The starter distribution uses in-memory FAISS by default. For persistent storage, run ChromaDB:
# Install and run ChromaDB
uv run --with chromadb chroma run --host localhost --port 8000 --path ./chroma_data
Step 3: Start Llama Stack
# With explicit Ollama URL (and faiss in-memory vectory store)
uv run --with 'llama-stack>=0.4.0' llama stack run starter --port 8321 \
--env OLLAMA_URL=http://localhost:11434/v1
# With ChromaDB for persistent vector storage (if running ChromaDB from Step 2)
uv run --with 'llama-stack>=0.4.0' llama stack run starter --port 8321 \
--env OLLAMA_URL=http://localhost:11434/v1 \
--env CHROMADB_URL=http://localhost:8000
This starts the Llama Stack server at http://localhost:8321.
Step 4: Use with cc-vec
# Set environment variables
export OPENAI_BASE_URL=http://localhost:8321/v1
export OPENAI_API_KEY=none # Llama Stack doesn't require a real key
export OPENAI_EMBEDDING_MODEL=ollama/nomic-embed-text:latest
export OPENAI_EMBEDDING_DIMENSIONS=768
# Set your Athena credentials
export ATHENA_OUTPUT_BUCKET=s3://your-bucket/
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
# Use cc-vec with local models
uv run cc-vec index --url-patterns "%.edu" --limit 10
# Use ChromaDB for persistent storage (requires ChromaDB running)
uv run cc-vec index --url-patterns "%.edu" --limit 10 --provider-id chromadb
# Use --batch-size to prevent overwhelming Ollama with concurrent requests
uv run cc-vec index --input-dir ./data/ --batch-size 5 --provider-id chromadb
Documentation:
2. 📦 Python Library