Langfuse & Semantic Cache Setup Instructions¶
Issues Fixed¶
1. Langfuse Authentication Errors ✅¶
Problem: Invalid credentials errors in Langfuse logs
langfuse-web-1 | Error: Invalid credentials
langfuse-web-1 | No key found for public key
langfuse-web-1 | storing api-key-non-existent in redis
Root Cause: Placeholder API keys in development.env were not actual Langfuse keys.
Solution: Updated configuration to support proper API key generation workflow.
2. Semantic Cache Ollama Connection ✅¶
Problem: Semantic cache failing to connect to Ollama
Root Cause: No Ollama service defined in docker-compose setup.
Solution: Added Ollama service to docker-compose.langfuse.yml.
3. Missing S3 Bucket Configurations ✅¶
Problem: Langfuse v3 requires multiple S3 buckets but only events bucket was configured.
Root Cause: Incomplete S3/MinIO configuration per Langfuse documentation.
Solution: Added configurations for:
- LANGFUSE_S3_MEDIA_UPLOAD_* (required)
- LANGFUSE_S3_BATCH_EXPORT_* (optional)
- Updated MinIO to create all buckets on startup
Changes Made¶
1. development/development.env¶
- ✅ Updated Langfuse API key configuration with instructions
- ✅ Added missing S3 access key credentials
- ✅ Added all required S3 bucket configurations
- ✅ Updated Ollama endpoint configuration
2. development/docker-compose.langfuse.yml¶
- ✅ Added Ollama service for embeddings and semantic cache
- ✅ Updated MinIO to create 3 buckets:
langfuse-events,langfuse-media,langfuse-batch - ✅ Added
ollama_datavolume
3. development/creds.example.env¶
- ✅ Added detailed Langfuse API key setup instructions
- ✅ Added support for headless initialization (optional)
4. network-agent/docker-compose.yml (bonus fix)¶
- ✅ Added missing media and batch export S3 configurations
- ✅ Updated MinIO bucket creation
Next Steps¶
Option A: Manual Setup (Recommended for Development)¶
-
Copy the example creds file (if you haven't already):
-
Leave Langfuse keys empty initially in
creds.env: -
Start the services:
-
Pull Ollama embedding model (after services are up):
To find the Ollama container name:
- Generate Langfuse API Keys:
- Access Langfuse UI: http://localhost:8000
- Create an account or login
- Go to: Settings → API Keys
- Click "Create new key"
-
Copy the keys
-
Update
creds.envwith the generated keys: -
Restart Nautobot to apply the keys:
Option B: Headless Initialization (For Automation/CI)¶
Uncomment and configure these variables in creds.env:
# Langfuse Headless Initialization
LANGFUSE_INIT_ORG_NAME="Nautobot AI Ops"
LANGFUSE_INIT_ORG_ID="nautobot-ai-ops"
LANGFUSE_INIT_PROJECT_NAME="Development"
LANGFUSE_INIT_PROJECT_ID="dev"
LANGFUSE_INIT_PROJECT_PUBLIC_KEY="" # Auto-generated
LANGFUSE_INIT_PROJECT_SECRET_KEY="" # Auto-generated
LANGFUSE_INIT_USER_EMAIL="admin@example.com"
LANGFUSE_INIT_USER_NAME="Admin"
LANGFUSE_INIT_USER_PASSWORD="changeme123!"
Then copy the auto-generated keys from logs to LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY.
Verification¶
1. Check Langfuse Connection¶
Look for this log in Nautobot:
Instead of:
2. Check Semantic Cache¶
Look for this log:
Instead of:
3. Check MinIO Buckets¶
Access MinIO console: http://localhost:9003
- Username: minio
- Password: miniosecret
Verify 3 buckets exist:
- langfuse-events
- langfuse-media
- langfuse-batch
Troubleshooting¶
Issue: Langfuse still shows "Invalid credentials"¶
Solution:
1. Make sure you've generated keys from the UI (Step 5 above)
2. Verify keys are set in creds.env
3. Restart the services that use Langfuse
Issue: Semantic cache still failing¶
Solutions: 1. Check Ollama is running:
-
Pull the embedding model:
-
Check Redis is accessible:
Issue: MinIO buckets not created¶
Solution:
# Recreate MinIO service
docker-compose down minio
docker volume rm <project>_minio_data
docker-compose up -d minio
# Verify buckets
docker exec -it minio-<container> ls -la /data/
Architecture Overview¶
┌─────────────────────────────────────────────────────────┐
│ Nautobot AI Ops │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Deep Agent │────▶│ Langfuse (Port 8000) │ │
│ │ │ │ - Web UI & API │ │
│ │ - LLM calls │ │ - Trace collection │ │
│ │ - Semantic │ └──────────┬───────────────┘ │
│ │ Cache │ │ │
│ └───────┬──────┘ │ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌────────────────────┐ │
│ │ Ollama │ │ MinIO (S3) │ │
│ │ Port: 11434 │ │ Port: 9002/9003 │ │
│ │ │ │ │ │
│ │ - Embeddings │ │ - langfuse-events │ │
│ │ - mxbai- │ │ - langfuse-media │ │
│ │ embed- │ │ - langfuse-batch │ │
│ │ large │ └────────────────────┘ │
│ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌────────────────────┐ │
│ │ Redis │────▶│ PostgreSQL │ │
│ │ Port: 6379 │ │ Port: 5432 │ │
│ │ │ │ │ │
│ │ - Cache │ │ - Nautobot DB │ │
│ │ - Semantic │ │ - Langfuse DB │ │
│ │ Cache │ └────────────────────┘ │
│ └──────────────┘ │
│ ┌────────────────────┐ │
│ │ ClickHouse │ │
│ │ Port: 8123/9000 │ │
│ │ │ │
│ │ - Analytics DB │ │
│ │ - Traces storage │ │
│ └────────────────────┘ │
└─────────────────────────────────────────────────────────┘
References¶
- Langfuse Self-Hosting Configuration
- Langfuse ClickHouse Setup
- Langfuse Headless Initialization
- Ollama Documentation
Summary¶
All configuration issues have been resolved: - ✅ Langfuse authentication properly configured - ✅ Ollama service added for semantic cache - ✅ All required S3/MinIO buckets configured - ✅ Missing access keys added - ✅ Documentation updated
Next: Follow Option A or B above to complete the setup!