Quickwit Integration Guide
Overview
Terraphim AI supports Quickwit as a haystack for searching log and observability data. This integration enables unified search across code, documentation, and operational logs.
Features
- Hybrid Index Discovery: Choose explicit configuration (fast) or auto-discovery (convenient)
- Dual Authentication: Supports both Bearer tokens and Basic Authentication
- Glob Pattern Filtering: Filter auto-discovered indexes with patterns like
logs-* - Graceful Error Handling: Network failures return empty results without crashing
- Concurrent Search: Multiple indexes searched efficiently
- Compatible: Works with Quickwit 0.7+ REST API
Quick Start
Prerequisites
- Running Quickwit instance (local or remote)
- Available indexes with data
- Optional: Authentication credentials
Basic Configuration (Explicit Index)
Create or modify your role configuration:
Run search:
# In REPL:
Configuration Modes
Mode 1: Explicit Index (Recommended for Production)
Fast, predictable, single index search.
Pros:
- Fastest (single API call)
- Predictable results
- Best for production monitoring
Mode 2: Auto-Discovery (Recommended for Exploration)
Automatically discovers and searches all available indexes.
Pros:
- Zero configuration needed
- Automatically finds new indexes
- Great for exploration
Cons:
- Slower (~300ms additional latency)
- Searches all indexes (may return irrelevant results)
Mode 3: Filtered Auto-Discovery
Best of both worlds - auto-discovery with pattern filtering.
Glob Patterns:
workers-*- matchesworkers-logs,workers-metrics, etc.*-logs- matchesworkers-logs,api-logs, etc.*logs*- matches any index containing "logs"*- matches all indexes (same as auto-discovery)
Authentication
Bearer Token
For API token authentication:
Security: Tokens are redacted in logs (only first 4 characters shown).
Basic Authentication
For username/password authentication (like try_search):
Recommended: Use environment variables or 1Password for passwords:
# Update config with password from environmentConfiguration Parameters
| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| location | Yes | - | Quickwit server base URL |
| service | Yes | - | Must be "Quickwit" |
| default_index | No | Auto-discover | Specific index to search |
| index_filter | No | All indexes | Glob pattern for filtering |
| auth_token | No | None | Bearer token (include "Bearer " prefix) |
| auth_username | No | None | Basic auth username |
| auth_password | No | None | Basic auth password |
| max_hits | No | 100 | Maximum results per index |
| timeout_seconds | No | 10 | HTTP request timeout |
| sort_by | No | -timestamp | Sort order (- for descending) |
Query Syntax
Quickwit supports powerful query syntax:
# Simple text search
# Boolean operators
# Field-specific search
# Time range (if timestamp field exists)
# Combined
Examples
Example 1: Local Development
Example 2: Production with Authentication
Example 3: Multiple Indexes (Multi-Haystack)
Search multiple specific indexes:
Troubleshooting
Connection Refused
Error: "Failed to connect to Quickwit"
Solutions:
- Verify Quickwit is running:
curl http://localhost:7280/health - Check
locationURL is correct - Ensure no firewall blocking connection
Authentication Failed
Error: Status 401 or 403
Solutions:
- Verify credentials are correct
- Check token includes "Bearer " prefix
- Ensure password doesn't have special characters issues
No Results
Possible causes:
- Index is empty - verify with:
curl http://localhost:7280/api/v1/{index}/search?query=* - Query doesn't match any logs
- Auto-discovery found no indexes - check logs for warnings
Auto-Discovery Not Working
Error: "No indexes discovered"
Solutions:
- Verify
/api/v1/indexesendpoint works:curl http://localhost:7280/api/v1/indexes - Check authentication if required
- Try explicit
default_indexinstead
Performance Tuning
For Fast Searches (Production)
- Use explicit
default_indexconfiguration - Reduce
max_hitsto minimum needed (e.g., 20) - Use specific index names, avoid auto-discovery
For Comprehensive Searches (Development)
- Use auto-discovery or
index_filter: "*" - Increase
max_hitsif needed - Search multiple indexes concurrently
Integration with Other Haystacks
Quickwit works alongside other Terraphim haystacks:
Searches return unified results from all configured haystacks.
Docker Setup (Development)
# docker-compose.yml
version: '3.8'
services:
quickwit:
image: quickwit/quickwit:0.7
ports:
- "7280:7280"
command:
volumes:
- ./quickwit-data:/quickwit/qwdataStart:
# Verify: curl http://localhost:7280/healthReference Implementation
This integration is based on the try_search project at /Users/alex/projects/zestic-ai/charm/try_search which demonstrates:
- Quickwit REST API usage
- Multi-index support
- Basic Authentication
- Dynamic table rendering
Supported Quickwit Versions
- Quickwit 0.7+
- REST API v1
Limitations
- Time Range Queries: Not yet supported in v1 (planned for v2)
- Aggregations: Not supported (Quickwit feature not exposed)
- Real-time Streaming: Not supported (search-only, no tail/streaming)
- Custom Timeout: Client timeout fixed at 10s (config parameter not yet wired)
Next Steps
- Set up Quickwit instance (local or cloud)
- Create indexes and ingest log data
- Configure Terraphim role with Quickwit haystack
- Search and explore logs from terraphim-agent CLI
Support
For issues or questions:
- GitHub: https://github.com/terraphim/terraphim-ai/issues
- Documentation: https://terraphim.ai