Once you've moved beyond basic Content Storage searches, Liquid variables offer powerful ways to fine-tune exactly how your AI prompts access and use your stored knowledge.
This advanced approach gives you precise control over search parameters, multiple search strategies, and custom formatting—transforming your prompts from simple question-and-answer tools into sophisticated, context-aware AI assistants that adapt to different scenarios and user needs.
Best Practices for Effective Content Searches
📍 Start Specific, Then Gradually Broaden Your Search
The most effective search strategy begins with narrow, targeted searches and expands outward if you need more results. Think of it like looking for a specific tool in your garage—you'd start with the exact drawer where you think it should be, then check nearby areas if you don't find it there.
<!-- First: specific folder and tags -->
{{ query | content_search: "troubleshooting", "error-500" }}
<!-- Then: same folder, all tags -->
{{ query | content_search: "troubleshooting", "" }}
<!-- Finally: all folders, specific tags -->
{{ query | content_search: "", "error-500" }}
This strategy ensures you get the most relevant results first while having fallback options for comprehensive coverage.
📍 Organize Your Content Storage Strategically
Your search effectiveness depends heavily on how well you've organized your content. Meaningful folder and tag organization makes targeted searches much more powerful. Consider organizing by:
Department: sales, engineering, support, marketing
Topic: api-docs, user-guides, policies, templates
Audience: internal, customer-facing, partner-resources
Product: product-a, product-b, legacy-systems
This strategic organization allows you to create highly targeted searches that return exactly the right content for each situation.
📍 Match Content Volume to Your Use Case
Different scenarios require different amounts of context, and choosing the right chunk count significantly impacts both response quality and processing speed:
Quick answers: 1-3 chunks for fast, focused responses
Standard responses: 5-7 chunks (the default setting) for balanced coverage
Comprehensive analysis: 10-20 chunks for thorough, detailed responses
Research and comparison: 20-50 chunks for extensive analysis
📍 Balance Context with Performance
Remember that more content means longer prompts, which can affect processing speed. Monitor your total prompt length and consider using higher similarity thresholds to get fewer but more relevant results when you need to optimize performance.
Real-World Use Cases
💡 FAQ Chatbot Assistant
Create intelligent customer service bots that pull from your actual FAQ database.
**Question:** {{ user_question }}
**Relevant FAQ Entries:**
{{ user_question | content_search: "faq", "", 3, 75 }}
**Answer:** Based on our FAQ above, here's what you need to know...
The system searches your FAQ content, finds the most relevant entries, and provides accurate answers based on your established documentation rather than generic responses.
💡 Code Documentation Helper
Build technical assistants that search through your code examples and documentation based on specific programming languages or frameworks.
{{ code_question | content_search: "code-examples", programming_language, 5, 80, "markdown" }}
Here's how to implement this in {{ programming_language }}:
This ensures developers get guidance that matches your actual codebase and standards.
💡 Product Recommendation Engine
Develop smart recommendation systems that match user needs with your product catalog.
{% assign product_matches = user_needs | content_search: "products", category, 5, 70 %}
Based on your requirements: {{ user_needs }}
**Recommended Products:**
{{ product_matches }}
These products match your needs because...
By searching through product descriptions and specifications, you can provide personalized recommendations based on customer requirements.
💡 Legal and Compliance Assistant
Create compliance helpers that search through policies and regulations based on jurisdiction or topic area.
{{ compliance_query | content_search: "policies;regulations", jurisdiction, 3, 85 }}
According to the relevant policies and regulations above, here's what you need to know...
This ensures responses align with current legal requirements and your organization's established policies.
💡 Internal Knowledge Management
Build comprehensive internal assistants that search both process documentation and policy information, helping employees find relevant procedures and related policies in a single query.
{% assign process_docs = question | content_search: "processes", department, 3 %}
{% assign policy_docs = question | content_search: "policies", department, 2 %}
**Relevant Processes:**
{{ process_docs }}
**Related Policies:**
{{ policy_docs }}
Based on the above, here's how to proceed...
💡 Customer Onboarding Guide
Develop onboarding assistants that pull from getting-started guides and tutorials specific to different products, providing new customers with precisely the right information for their situation.
{{ onboarding_question | content_search: "getting-started;tutorials", product_name, 5, 70, "markdown" }}
Welcome! Here's everything you need to know to get started with {{ product_name }}...
Troubleshooting Common Issues
🔹 When You Get No Results
If your searches return empty results, the most common causes are:
Folder or tag name mismatches: Content Storage names are case-sensitive, so check your exact spelling and capitalization
Similarity threshold too high: Try reducing your threshold to 50-60 for broader matching
Content not fully indexed: Ensure your documents are completely uploaded and processed
Search too narrow: Try using empty quotes to search all folders or all tags
Solution: Start by testing with very broad parameters (search everything) to confirm content exists, then gradually narrow your search.
<!-- If this returns nothing -->
{{ query | content_search: "Documentation", "API" }}
<!-- Try exact capitalization -->
{{ query | content_search: "documentation", "api" }}
<!-- Or search everything -->
{{ query | content_search: "", "" }}
🔹 When You Get Too Many Irrelevant Results
If you're overwhelmed with results that don't match what you need:
Increase similarity threshold: Set it to 70-90 for more precise matching
Use specific folder and tag combinations: Narrow your search scope
Reduce chunk count: Get only the best matches instead of many mediocre ones
Solution: Focus your search parameters and increase quality thresholds rather than casting a wide net.
<!-- Instead of this broad search -->
{{ query | content_search: "", "", 20, 40 }}
<!-- Try this focused search -->
{{ query | content_search: "specific-folder", "relevant-tag", 5, 80 }}
🔹 When Results Are Too Long
If your retrieved content overwhelms your prompt:
Reduce chunk count: Use 2-3 chunks instead of the default 5
Choose simpler formatting: Use plain text instead of markdown
Increase similarity thresholds: Higher thresholds return fewer but more relevant results
Solution: Quality over quantity—fewer, more relevant results often work better than comprehensive but lengthy content.
<!-- Instead of -->
{{ query | content_search: "docs", "", 10, 60, "markdown" }}
<!-- Try -->
{{ query | content_search: "docs", "", 3, 80, "text" }}
🔹 When Wrong Content Gets Retrieved
If the system consistently finds content that doesn't match your intent:
Refine your query language: Use terminology that matches your stored documents
Review content organization: Ensure documents are properly categorized and tagged
Adjust similarity settings: Try both higher and lower thresholds to find the sweet spot
Test different search strategies: Experiment with various folder and tag combinations
Always test your searches with various query types to ensure they return appropriate content. Check that folder and tag names are correct, verify similarity thresholds work as expected, and confirm the right content is being retrieved for different scenarios.
Advanced Tips and Tricks
⭐️ Use Variables for Dynamic Searches
Any search parameter can use a variable instead of fixed text, making your prompts incredibly flexible. This means you can let user inputs determine which folders to search, how many results to return, or what tags to focus on.
{% assign my_folder = "documentation" %}
{% assign my_tags = "api;security" %}
{% assign chunk_count = 10 %}
{% assign threshold = 80 %}
{{ query | content_search: my_folder, my_tags, chunk_count, threshold }}
⭐️ Combine Multiple Search Strategies
You can run separate searches within the same prompt for different purposes—like getting background information from one folder and detailed examples from another. This layered approach provides comprehensive coverage while maintaining organization.
{% assign background = topic | content_search: "basics", "", 2 %}
{% assign details = topic | content_search: "advanced", "", 3 %}
{% assign examples = topic | content_search: "examples", "", 2 %}
**Background:**
{{ background }}
**Details:**
{{ details }}
**Examples:**
{{ examples }}
⭐️ Chain Searches with Other Processing
Your search results can be combined with other text processing like truncating long results, converting text case, or removing formatting tags. This gives you complete control over how the final content appears in your prompt.
Combine content_search with Liquid's built-in filters:
<!-- Truncate long results -->
{{ query | content_search: "docs" | truncate: 500 }}
<!-- Convert to uppercase -->
{{ query | content_search: "announcements" | upcase }}
<!-- Remove HTML tags (if present) -->
{{ query | content_search: "web-content" | strip_html }}
⭐️ Reuse Search Results Efficiently
Store search results in variables to use them multiple times throughout your prompt without repeating the search. This is especially useful for longer prompts where you want to reference the same information at different points.
{% assign context = user_query | content_search: "knowledge-base" %}
First, here's what our documentation says:
{{ context }}
[... middle of prompt ...]
Remember to stay consistent with the information above:
{{ context }}⭐️ Syntaxis: Empty String Means "All" and Skip Trailing Parameters
Use "" to search all folders or all tags:
{{ query | content_search: "", "important" }} <!-- All folders, "important" tag only -->
{{ query | content_search: "docs", "" }} <!-- "docs" folder, all tags -->
{{ query | content_search: "", "" }} <!-- Everything -->
You don't need to specify all parameters - just stop where you want:
{{ query | content_search: "docs" }} <!-- Uses all defaults -->
{{ query | content_search: "docs", "api" }} <!-- Custom tags, other defaults -->
{{ query | content_search: "docs", "api", 10 }} <!-- Custom chunks too -->
{{ query | content_search: "docs", "api", 10, 80 }} <!-- Custom similarity too -->
By mastering these advanced techniques, you'll create more sophisticated, reliable, and effective AI prompts that leverage your Content Storage to its full potential.
✅ Next Steps and Related Articles
Begin your journey with Liquid variables by exploring the foundational aspects and expand your skills with the subsequent help articles:
Understand the core concepts of Liquid variables, including how they function and the basic syntax needed to get started. Learn about the different search parameters and how they affect your content retrieval process.
Enhance your practical knowledge through a variety of examples, showcasing both simple and more sophisticated uses of Liquid variables for customizing content access.
Discover the various output formats available and delve into advanced techniques for integrating Liquid variables in complex workflows to maximize your AI's capabilities.
These articles will lay a strong foundation and progressively build your expertise, enabling you to leverage Liquid variables for precise and dynamic AI interactions.
