Knowledge Service
The Kubiya Knowledge service provides a simple interface for querying the central knowledge base. It enables you to send search queries and receive responses, with optional streaming support.Features
- Knowledge Base Queries: Send search prompts to the central knowledge base
- Real-time Streaming: Optional streaming responses for real-time updates
- User Context: Optional user and organization context for queries
- Error Handling: Basic error handling with timeout detection
Core Components
KnowledgeService
The main service class provides knowledge base querying:query()
: Send a query to the knowledge base
Quick Start
Basic Usage
Non-Streaming Query
Query with Context
Streaming Query
Error Handling
The Knowledge service provides basic error handling for different failure scenarios:KnowledgeError
Thrown when knowledge base queries fail:Configuration
Environment Variables
The Knowledge service respects several environment variables for configuration:KUBIYA_ORCHESTRATOR_URL
: Custom orchestrator endpoint URLKUBIYA_USE_SAME_API
: Use the same base URL as the main API (boolean)
Best Practices
1. Use Descriptive Queries
2. Handle Streaming Gracefully
3. Provide User Context When Available
4. Validate and Process Results
Integration Examples
The Knowledge service integrates seamlessly with other Kubiya services and workflows:Workflow Integration
Agent Integration
Use Cases
1. Documentation Search
Perfect for finding specific documentation, procedures, and guides:2. Troubleshooting Assistance
Get help with problem resolution:3. Best Practices Discovery
Find established patterns and best practices:4. Contextual Learning
Get explanations and learning resources:Next Steps
- Review the API Reference for detailed method documentation
- Explore the examples directory for complete working examples
- Check out integration patterns with other Kubiya services