Configuration Approaches
- AI Knowledge - No-Code UI
- AI Builder - YAML Tools
- AI Builder - Webhooks
For basic configurations, you can use the built-in UI settings:
- Instructions
- Keep clear and precise instructions with Titles and Sections.
- Specify language (Reply in the user language, reply in English only, …)
- Tone (Friendly, empathic, formal, …)
- Output instructions (concise, detailled, …)
- Documents and tools results placed in the $ keyword
- Date placed in the $ keyword. Specify your users timezone.
- Keep clear and precise instructions with Titles and Sections.
- Text Splitter Configuration
- Chunk Size
- Chunk Overlap
- Enable override by document
- Embeddings Settings
- Number of chunks to retrieve
- Self-Query
- Enable filtering on tags set on your documents
- Configure from AI Store input
- Used:
- Automatically, in AI > Self Query > Enabled, so the AI dynamically chooses which tags to use for a query
- Set by the user, In AI > Self Query > Enabled by the user. Users will see a ”+” button in the AI Store to add tags.
- Set mandatory tags for user or groups, in the User sharing page.
- Query Enhancement
- Select model
- Add instructions and definitions
- Post-Processing
- Show suggested questions
- Filter displayed sources
RAG Pipeline Components
The RAG pipeline in Prisme.ai consists of several stages, each of which can be customized using YAML tools or webhooks:1
Query Processing
Transform and enhance the user’s question before retrieval
2
Retrieval
Find relevant documents in your knowledge base
3
Context Assembly
Organize retrieved documents into a coherent context
4
Prompt Generation
Create the prompt that will be sent to the LLM
5
Response Generation
Generate the final answer using the LLM
6
Post-Processing
Enhance the response with additional information or formatting
Documents Tags
Documents can have tags assigned to them. These tags can be used to reduce the load on the embedding model when retrieving documents by narrowing the search scope. They can also help avoid conflicts when multiple documents express opposing statements depending on the context. You have three ways to use tags:- Automatic:
- Enabled in AI > Self Query > Enabled. The AI automatically determines which tags to use for each query.
- User-defined:
- Enabled in AI > Self Query > Enabled by the user. Users can manually add tags using the “+” button available in the AI Store.
- Mandatory (by user or group):
- Configured in the User sharing page, where you can assign required tags to specific users or groups.
- Automatic
- Set by the user
- Mandatory for a user or group
Enable the
The system will then filter documents dynamically based on the inferred tags.
self-query option in AI > Self Query > Enabled to let the LLM automatically determine the relevant tags for each question.The system will then filter documents dynamically based on the inferred tags.
- All tags defined in the User panel are combined with OR logic.
- All tags selected in the AI Store (chat interface) are also combined with OR logic.
- Then, both resulting sets are combined using AND logic.
[A, B] and selected tags [C, D] will retrieve documents that contain at least one tag from each set, resulting in the following combinations: [A, C], [A, D], [B, C], [B, D].
YAML Tool Examples
Query Reformulation
Query Reformulation
This tool enhances user queries by generating alternative phrasings:Usage scenario: Improve retrieval quality for ambiguous or tersely worded queries.
Web Search Tool
Web Search Tool
This tool augments the knowledge base with real-time web search results:Usage scenario: Supplement your knowledge base with up-to-date information from the web.
Semantic Chunking
Semantic Chunking
This tool implements intelligent document chunking based on semantic boundaries:Usage scenario: Improve retrieval quality for documents with complex structure or mixed topics.
Dynamic RAG Parameters
Dynamic RAG Parameters
This tool dynamically adjusts retrieval parameters based on query complexity:Usage scenario: Automatically optimize retrieval for different query types (simple vs. complex, factual vs. exploratory).
Context Fusion
Context Fusion
This tool combines information from multiple retrieved chunks into a coherent context:Usage scenario: Create more coherent context for complex queries that require information from multiple documents.
Webhook Integration
Webhooks provide an alternative approach to customizing the RAG pipeline by intercepting key events and modifying the behavior via external HTTP endpoints.Webhook Configuration
Webhook Configuration
To configure a webhook for your AI Knowledge agent:
- Go to your agent’s settings
- Navigate to the “Webhooks” section
- Enter your HTTPS webhook URL
- Select which events to subscribe to
Document Events
Document Events
Webhooks can intercept document creation, update, and deletion events:Request Example (Document Creation):Response Example (Modify Document):This allows you to:
- Preprocess documents before indexing
- Add or modify metadata
- Override chunking settings per document
- Reject documents that don’t meet criteria
Query Interception
Query Interception
Webhooks can intercept user queries and modify various aspects of the RAG process:Request Example:Response Options:
- Override Retrieved Context:
- Override Prompt Generation:
- Override Answer Generation:
- Override AI Parameters:
- Override Search Results:
Test Results Webhook
Test Results Webhook
Webhooks can also intercept test results for analysis and evaluation:Request Example:Response Example:This allows you to:
- Implement custom evaluation metrics
- Track test results in external systems
- Apply domain-specific scoring criteria
Combining YAML Tools and Webhooks
For the most sophisticated RAG configurations, you can combine YAML tools and webhooks:Sequential Pipeline
Chain multiple YAML tools to create a sequential processing pipeline, with webhooks for external integration at key points.Example: YAML tool for query reformulation → webhook for sensitive query detection → YAML tool for retrieval customization
Fallback Mechanisms
Configure webhooks as fallbacks when YAML tools don’t produce satisfactory results.Example: Try native retrieval first, but if no good matches are found, call webhook to query external knowledge bases
A/B Testing
Use different YAML tools or webhooks based on query characteristics or for experimentation.Example: Route technical questions through one pipeline and customer support questions through another
Hybrid Processing
Let webhooks handle some RAG components while YAML tools handle others.Example: Webhook handles retrieval from proprietary databases, YAML tool handles context optimization
Best Practices
YAML Tool Development
YAML Tool Development
- Start with simple tools and incrementally add complexity
- Use a consistent naming convention for tools
- Thoroughly test tools with varied inputs
- Document each tool’s purpose and expected inputs/outputs
- Consider performance implications for complex processing
Webhook Implementation
Webhook Implementation
- Ensure webhooks are hosted on reliable, low-latency infrastructure
- Implement proper error handling and fallbacks
- Cache results when appropriate to improve response times
- Use secure authentication to protect sensitive data
- Monitor webhook performance and error rates
RAG Pipeline Design
RAG Pipeline Design
- Clearly define which components require customization
- Choose the appropriate approach (UI, YAML, webhook) based on complexity
- Test changes incrementally to isolate effects
- Monitor key metrics before and after changes
- Document your RAG pipeline configuration for maintainability