Skip to main content

Domain Context System

Enhance Qry's AI with your organization's specific knowledge by uploading documentation, business glossaries, and domain expertise that automatically enriches conversations.

Overview

While Qry's AI is powerful for general data analysis, every organization has unique terminology, business rules, and domain knowledge. The Domain Context system allows you to upload this specialized information so the AI can provide more accurate, contextually-aware responses.

What is Domain Context?

Domain context consists of:

  • Business Documentation: Process guides, requirement specs, business rules
  • Data Dictionaries: Column definitions, metric calculations, terminology
  • Industry Knowledge: Sector-specific standards, regulations, best practices
  • Historical Context: Legacy system documentation, migration guides

How It Works

1. Document Upload

Upload PDFs containing your domain knowledge:

Admin → Domain Contexts → Upload Document

Supported: PDF files up to 50MB
Processing: Automatic text extraction and indexing
Embedding: Vector representations for semantic search

2. Processing Strategies

Qry offers multiple processing strategies based on document size and usage:

Full Document (Best for small documents under 50 pages)

  • Entire document included in AI context
  • Maximum accuracy and coherence
  • Higher token usage

RAG - Retrieval Augmented Generation (Best for large documents over 100 pages)

  • Document split into chunks
  • Relevant chunks retrieved based on query
  • Efficient token usage
  • Scales to very large documents

Hybrid (Best for medium documents 50-100 pages)

  • Combines full document overview with chunk-based retrieval
  • Balanced accuracy and efficiency

Smart (Recommended - Automatic selection)

  • AI automatically chooses optimal strategy
  • Adapts based on document characteristics

3. Automatic Injection

When you ask a question, Qry:

  1. Analyzes the query for relevant topics
  2. Searches domain contexts for matching information
  3. Injects relevant context into the AI prompt
  4. Generates response with enriched knowledge

Key Features

Find relevant information even when using different terminology:

Document contains: "Customer Lifetime Value (CLV) = Total Revenue / Customer Count"

User asks: "How do we calculate how much a customer is worth over time?"

System matches: CLV definition and retrieves calculation method

Permission-Based Access

Domain contexts respect RBAC:

  • Only visible to users with appropriate permissions
  • Can be scoped to specific user groups
  • Sensitive documentation remains protected

Version Control

Manage document updates:

  • Upload new versions of existing documents
  • System automatically reprocesses and re-indexes
  • Historical versions retained for audit

Usage Analytics

Track context effectiveness:

  • See which contexts are most frequently used
  • Identify gaps in documentation
  • Measure impact on query accuracy

Use Cases

Financial Services

Challenge: Complex metric definitions across departments

Solution: Upload finance glossary with:

  • EBITDA calculation specifics
  • Revenue recognition rules
  • Custom KPI definitions

Result:

User: "Show me adjusted EBITDA by division"
AI: [Applies your organization's specific EBITDA adjustments]

Healthcare

Challenge: Medical terminology and compliance requirements

Solution: Upload:

  • HIPAA compliance guidelines
  • Medical coding standards
  • Treatment protocols

Result: AI understands medical terms and ensures compliant queries

E-Commerce

Challenge: Custom business logic and customer segmentation

Solution: Upload:

  • Customer tier definitions
  • Promotional rules
  • Fulfillment workflows

Result:

User: "Show me platinum customers"
AI: [Applies your specific platinum tier criteria: LTV >$10K, 5+ orders, etc.]

Best Practices

Document Preparation

DO:

  • Use clear headings and structure
  • Include definitions and examples
  • Keep documents focused on specific topics
  • Update regularly as processes change

DON'T:

  • Upload raw data dumps
  • Include outdated information
  • Mix unrelated topics in one document
  • Use inconsistent terminology

Effective Contexts

High-Value Documents:

  • Data dictionaries and glossaries
  • Business rule specifications
  • Calculation methodologies
  • Process workflows
  • Industry regulations

Lower-Value Documents:

  • Meeting notes
  • Personal correspondence
  • Highly specific one-time analyses
  • Unstructured brainstorming docs

Organization

Naming Convention:

Good: "Customer_Segmentation_Rules_v2.pdf"
Good: "Finance_Metrics_Glossary_2025.pdf"

Avoid: "Document1.pdf"
Avoid: "untitled.pdf"

Categorization:

  • Group related documents
  • Use consistent naming
  • Include version numbers
  • Add descriptive metadata

Configuration

Upload Settings

Document Name: Customer Segmentation Rules
Description: Definitions for Bronze, Silver, Gold, Platinum tiers
Processing Strategy: Smart (recommended)
Permissions: Marketing Team, Analytics Team
Tags: customer, segmentation, tiers

Advanced Options

Chunk Size (for RAG/Hybrid strategies)

  • Small (256 tokens): Very specific retrieval
  • Medium (512 tokens): Balanced (recommended)
  • Large (1024 tokens): More context per chunk

Retrieval Settings

  • Number of chunks to retrieve: 3-10
  • Similarity threshold: 0.6-0.9
  • Context window allocation: 10-30%

Technical Details

Processing Pipeline

  1. Text Extraction: PDF → Plain text
  2. Cleaning: Remove headers, footers, page numbers
  3. Chunking: Split into semantic units (for RAG/Hybrid)
  4. Embedding: Generate vector representations
  5. Indexing: Store in pgvector for fast retrieval
  6. Metadata: Extract and store document metadata

Storage

  • Documents: Stored encrypted in object storage
  • Embeddings: Stored in PostgreSQL with pgvector
  • Metadata: Relational tables for search and permissions

Performance

  • Retrieval Speed: under 100ms for semantic search
  • Scalability: Supports thousands of documents
  • Concurrency: Handles multiple simultaneous queries
  • Caching: Frequently accessed chunks cached

FAQ

Q: How many documents can I upload? A: No hard limit, but we recommend focusing on high-quality, frequently referenced documents (typically 10-100 per domain).

Q: Can I update a document? A: Yes, upload a new version with the same name or use the "Update" function.

Q: Will large documents slow down queries? A: No, RAG and Hybrid strategies ensure only relevant portions are used, keeping responses fast.

Q: Can I see which context was used for a query? A: Yes, enable "Show Context Sources" in settings to see which documents influenced each response.

Q: Do domain contexts work with all AI models? A: Yes, context injection works with all supported models (Claude 4.5, Gemini 2.5, GPT-5, etc.).

Next Steps


Domain Context bridges the gap between generic AI and your organization's specific knowledge, making every conversation smarter.