Examples
Generate Content with Prompts
Use prompts and templates to generate structured content from your knowledge base
Learn how to combine prompts and templates to generate new, structured content from your existing knowledge base using the /generate/prompt
endpoint.
Overview
The generate with prompt feature allows you to:
- Use pre-defined prompts for consistent content generation
- Apply templates to format output as JSON or structured text
- Filter content by categories and topics
- Save generated content back to your knowledge base
Prerequisites
Before generating content, you’ll need:
- Content in your knowledge base (see Hello World)
- A prompt created (see Managing Prompts)
- Optional: A template for structured output (see Managing Templates)
Generate Content Example
Advanced Examples
Generate FAQ Content
Generate Summary Reports
Working with Sources
The response includes source information showing which content chunks were used:
Best Practices
- Be specific with content_type: The more specific your content type description, the better the results
- Use filters wisely: Category and topic filters help focus the generation on relevant content
- Adjust max_results: More sources can provide comprehensive content but may increase processing time
- Save strategically: Only save generated content that you’ll reuse or need to reference later
- Monitor sources: Review which content chunks are being used to ensure quality
Error Handling
Next Steps
- Experiment with different prompt variations for better results
- Create multiple templates for different output formats
- Use the saved generated content for further processing
- Combine with the search API for a complete knowledge base solution