Standalone Vespa deployment for Xyne projects. This repository contains all Vespa-related schemas, deployment scripts, and configuration that can be run independently from the main Xyne application.
This is a standalone Vespa deployment running in isolation. Applications connect to Vespa via HTTP endpoints for document indexing and search operations.
vespa-core/
├── vespa/
│ ├── schemas/ # 14 Vespa schema definitions
│ │ ├── file.sd
│ │ ├── user.sd
│ │ ├── mail.sd
│ │ └── ...
│ ├── services.xml # Vespa service configuration
│ ├── deploy.sh # Deployment script (local)
│ ├── deploy-docker.sh # Deployment script (Docker)
│ ├── deploy-pod.sh # Deployment script (Kubernetes)
│ ├── reindex.sh # Reindexing script
│ ├── replaceDIMS.ts # Replace embedding dimensions
│ └── models/ # Embedding models (downloaded)
├── deployment/
│ ├── Dockerfile-vespa-gpu # GPU-enabled Vespa image
│ └── vespa-deploy/ # Deployment container
├── monitoring/
│ ├── prometheus.yml # Prometheus configuration
│ └── vespa-detailed-monitoring.json # Grafana dashboard
├── docker-compose.yml # Standalone Vespa deployment
├── init-vespa.sh # Initialize Vespa data directories
└── README.md
This instance includes 14 schemas:
- file - Drive files with embeddings
- user - User profiles
- mail - Email documents
- mail_attachment - Email attachments
- event - Calendar events
- chat_message - Slack/Teams messages
- chat_container - Slack channels/Teams
- chat_user - Chat platform users
- chat_team - Slack workspaces/Teams
- chat_attachment - Chat attachments
- datasource - Custom data sources
- datasource_file - Data source files
- kb_items - Knowledge base items
- user_query - User search history
# Start Vespa
docker-compose up -d
# Wait for Vespa to be ready (30-60 seconds)
docker logs vespa -f
# Deploy schemas
cd vespa
./deploy-docker.sh
# Verify deployment
curl http://localhost:8080/status.html
curl http://localhost:8081/status.html# On your VPC server (e.g., 10.0.2.50)
git clone <vespa-core-repo>
cd vespa-core
# Set embedding model
export EMBEDDING_MODEL=bge-base-en-v1.5
# Start Vespa
docker-compose up -d
# Deploy schemas
cd vespa
./deploy-docker.shApplications connect via:
const client = new VespaClient({
feedEndpoint: 'http://localhost:8080',
queryEndpoint: 'http://localhost:8081'
})# Start with Prometheus & Grafana
docker-compose --profile monitoring up -d
# Access Grafana: http://localhost:3002
# Import dashboard from monitoring/vespa-detailed-monitoring.json# Required
EMBEDDING_MODEL=bge-base-en-v1.5 # or bge-small-en-v1.5, bge-large-en-v1.5
# Optional
VESPA_FEED_PORT=8080
VESPA_QUERY_PORT=8081Choose one based on your needs:
| Model | Dimensions | Memory | Speed | Quality |
|---|---|---|---|---|
| bge-small-en-v1.5 | 384 | Low | Fast | Good |
| bge-base-en-v1.5 | 768 | Medium | Medium | Better |
| bge-large-en-v1.5 | 1024 | High | Slow | Best |
cd vespa
# 1. Set your embedding model
export EMBEDDING_MODEL=bge-base-en-v1.5
# 2. Deploy schemas
./deploy-docker.sh
# This will:
# - Download embedding models from HuggingFace
# - Replace DIMS placeholder with correct dimensions
# - Deploy all schemas to Vespa
# - Validate deploymentcd vespa
# Deploy updated schemas
./deploy-docker.sh
# Note: Vespa will automatically restart and reload schemasConnect to Vespa from your application:
import { VespaClient } from '@xyne/vespa-ts'
const client = new VespaClient({
feedEndpoint: 'http://localhost:8080',
queryEndpoint: 'http://localhost:8081'
})
// Index documents
await client.feed({
schema: 'file',
id: 'doc-1',
fields: {
title: 'My Document',
content: 'Document content here'
}
})
// Search documents
const results = await client.search({
schema: 'file',
query: 'document content'
})| Endpoint | Port | Purpose | Used By |
|---|---|---|---|
| Feed | 8080 | Document ingestion | Applications |
| Query | 8081 | Search queries | Applications |
| Admin | 19071 | Schema deployment | Deployment scripts |
| Metrics | 19092 | Prometheus metrics | Monitoring |
Data is stored in Docker volumes:
# List volumes
docker volume ls | grep vespa
# Backup data
docker run --rm -v vespa-core_vespa-data:/data -v $(pwd):/backup \
alpine tar czf /backup/vespa-backup.tar.gz -C /data .
# Restore data
docker run --rm -v vespa-core_vespa-data:/data -v $(pwd):/backup \
alpine tar xzf /backup/vespa-backup.tar.gz -C /data# Check Vespa status
curl http://localhost:19071/state/v1/health
# Check containers
curl http://localhost:8080/status.html # Feed
curl http://localhost:8081/status.html # Query# View Vespa logs
docker logs vespa -f
# View specific component logs
docker exec vespa tail -f /opt/vespa/logs/vespa/vespa.logIf you change schema field types or need to rebuild indexes:
cd vespa
./reindex.shVespa runs on the xyne bridge network. To allow other Docker containers to access it:
# In your application's docker-compose.yml
networks:
xyne:
external: trueFor production deployment:
- Deploy this stack on a dedicated server
- Ensure firewall rules allow inbound traffic on ports 8080 (feed) and 8081 (query)
- Applications connect via the server's IP address
- Use TLS/SSL for production traffic (configure reverse proxy)
# Check container status
docker ps -a | grep vespa
# Check logs for errors
docker logs vespa | grep -i error
# Verify health
curl http://localhost:19071/state/v1/health# Increase memory limit in docker-compose.yml
deploy:
resources:
limits:
memory: 12G # Increase from 6G# Increase wait time in deploy-docker.sh
vespa deploy --wait 1800 # 30 minutes instead of 960 seconds# Check network connectivity
docker exec -it xyne-app ping vespa
# Check firewall rules (VPC)
telnet 10.0.2.50 8081
# Verify endpoints in application config
echo $VESPA_QUERY_URLEdit docker-compose.yml:
environment:
- VESPA_CONFIGSERVER_JVMARGS=-Xms2g -Xmx32g -XX:+UseG1GC
- VESPA_CONFIGPROXY_JVMARGS=-Xms1g -Xmx16g -XX:+UseG1GCEdit vespa/services.xml:
<config name="container.handler.threadpool">
<maxthreads>16</maxthreads> <!-- Increase based on CPU cores -->
</config># Start Vespa container
docker compose -f docker-compose.dev.yml up -d
# Wait for Vespa to be ready
docker logs vespa -f
# Deploy schemas
cd vespa && ./deploy-docker.sh# Edit schemas in vespa/schemas/
vim vespa/schemas/file.sd
# Redeploy
cd vespa && ./deploy-docker.shdocker compose -f docker-compose.dev.yml downWhen adding new schemas:
- Add
.sdfile tovespa/schemas/ - Update
vespa/services.xmlto include new schema - Update this README's schema list
- Redeploy:
cd vespa && ./deploy-docker.sh