1. Template Guidelines
  2. Knowledge Library

Template Guidelines

Knowledge Library

Explains how to organize Knowledge Library content and design retrieval so an AI agent can use large amounts of unstructured text.

The Knowledge Library stores unstructured information for an AI agent to use, such as plain text, PDFs, Word documents and other document-based content. See Using the Knowledge Library for how to add and manage articles.

Getting good answers from it depends on two things:

  1. how the content is organized
  2. how the content is retrieved

Good organization improves search precision, and good retrieval configuration improves answer quality.

Organizing content

Organize content using rooms and shelves:

  • rooms for broad categories
  • shelves for narrower categories within a room

Group content the way the AI agent will need to retrieve it later.

A direct search using only the user's question is often not enough. A stronger pattern is:

  1. use ai_enrich to improve the search query
  2. use a broader initial limit, typically 8 to 16
  3. use rerank to reorder the results by relevance
  4. use ai_summarize to condense the best snippets
  5. pass the result back into the main AI conversation

This improves recall first, then precision.

ai_enrich

Use ai_enrich when the user's wording may not closely match the wording in the stored articles. It can:

  • expand the user's question with keywords and contextual phrasing
  • generate an example of the kind of content likely to contain the answer

This helps most when the user's question is vague, or when the stored content uses different terminology.

rerank

Use rerank after the initial retrieval to improve the order of the returned snippets. It is especially useful when ai_enrich broadens the query and a wider set of candidate snippets comes back.

ai_summarize

Use ai_summarize when a concise result would help the main conversational agent. It:

  • keeps the main conversation focused
  • reduces token usage
  • gives the AI agent a cleaner result to work with

Summarization can lose detail, so use it carefully when nuance matters.

Implementing retrieval in a template

When you add Knowledge Library retrieval to a template:

  • use the search_knowledge_library task
  • filter to the correct room and shelf where possible
  • use ai_enrich to improve recall
  • use a broader initial result limit
  • use rerank to improve relevance ordering
  • use ai_summarize where a concise result is useful
  • return only the data that is useful to the AI agent
  1. Decide what knowledge the AI agent needs.
  2. Organize it into sensible rooms and shelves.
  3. Create and manage the articles in the Knowledge Library.
  4. Store and publish the articles.
  5. Implement retrieval in the template.
  6. Test retrieval quality with realistic user questions.
  7. Refine the article structure or retrieval configuration if needed.

Flowpilot can help you plan rooms and shelves and build the retrieval actions, but you create, upload, edit and publish the articles yourself in the Stubber Platform.