Articles in this section

Adding a Knowledge Source

This article explains how to create a knowledge source in Templafy, upload files into it, and connect it to AI Assistant prompt templates and Document Agents so the AI can use company-specific context in its responses.

  Prerequisites

  • Library and AI Assistant or Document Agent modules enabled.
  • Admin/owner access to the Templafy tenant.

Overview

Knowledge sources are containers for files that AI Assistant prompt templates and Document Agents can search to retrieve relevant, company-specific context. When a user triggers a prompt template or a Document Agent runs, Templafy searches the connected knowledge source and passes the most relevant content to the AI.

Files are chunked and indexed for vector search when uploaded, allowing the AI to retrieve semantically relevant content rather than doing a simple keyword match.

  Note

Only text content is processed from uploaded files. Images, charts, and graphs within files cannot be extracted or used.

Creating a knowledge source with uploaded files

  1. In the Admin Center, navigate to the AI Assistant section.
  2. Select the Knowledge tab.
  3. Click Add knowledge source.
  4. Select Upload files.
  5. Enter a Name and Description. These are for administrative reference only and are not used by the AI.
  6. Upload files. You can also skip this step and upload files later.
  7. Optionally, configure the File processing settings.
  8. Click Save.

  Important

Max tokens per chunk and Overlap tokens cannot be changed after a knowledge source has been created. Configure these settings carefully before saving.

File processing settings

The following settings control how files are chunked and indexed when uploaded. Some settings cannot be changed after the knowledge source has been created.

Setting Default Description Editable after creation
Max tokens per chunk 500 tokens The maximum size of each content chunk returned from a search. Approximately 2,000 characters of text per chunk at the default setting. No
Overlap tokens 100 tokens The number of tokens shared between adjacent chunks. Overlap prevents important content from being split across chunk boundaries. No
Split on headlines On When enabled, Word files are split at each headline rather than at a fixed token count, producing more semantically meaningful chunks. Applies to Word files only. No
Limit results for AI responses 3 The number of top-matching chunks returned when a prompt template or Document Agent searches the knowledge source. Yes

  Note

The Limit results for AI responses setting is available after adding a knowledge source.

Uploading files

Once a knowledge source has been created, files can be added at any time. There is no limit on the number of files per knowledge source.

  1. In the Knowledge tab, click on the knowledge source you want to add files to.
  2. Select the Files tab.
  3. Click + Add file and upload the desired file.
  4. Wait for indexing to complete. 

  Note

  • Supported file types: Word (.docx), PowerPoint (.pptx), PDF, and Excel (.xlsx).
  • Maximum file size: 50 MB, including embedded images. If a file exceeds the limit due to images, remove the images (only text is processed) or split the file into smaller parts and upload them separately.

  Important

Some files may fail to be indexed. Removing images and other non-text elements often resolves the issue. If the problem persists, contact Templafy Support and share the file for troubleshooting.

Testing a knowledge source

Use the built-in test tool to verify that a knowledge source returns the expected results before connecting it to a prompt template or Document Agent.

  1. In the Knowledge tab, locate the knowledge source you want to test.
  2. Click the Test button on the knowledge source card.
  3. In the dialog that opens, enter a search query that represents a typical question or piece of context a user might provide.
  4. Review the returned chunks to confirm relevant content is being retrieved.

Using knowledge sources in AI Assistant prompt templates

Knowledge sources can be added as context on any AI Assistant prompt template via the Context tab.

  1. Open the prompt template you want to configure.
  2. Navigate to the Context tab and click Add knowledge source.
  3. Select the knowledge source from the dialog. A reference name is pre-filled automatically.
  4. Insert the knowledge binding into the prompt template message by clicking the Insert button on the knowledge source card, or by typing it manually: {{Knowledge.[ReferenceName]}}.

  Important

Adding a knowledge source to a prompt template does not automatically include its content in AI responses. The binding {{Knowledge.[ReferenceName]}} must be explicitly inserted into the prompt template message.

Customizing the knowledge search query

By default, the search query sent to the knowledge source combines the user's selected text with their answers to any form questions. To customize this, enable the Customize knowledge search settings toggle on the knowledge source card. This reveals the Custom usage instructions field, where you can define exactly what gets sent as the search query.

Using knowledge sources in Document Agents

Knowledge sources can be added to any Document Agent, including the Universal Document Agent, whether new or already configured. The knowledge can then be used as context for relevant presentations.

  1. In the Templafy Admin center, navigate to the AI Agents tab.
  2. Click the three dots menu on the Document Agent you want to configure and select Edit.
  3. Under Settings, click on Knowledge.
  4. Click on + Add knowledge source.
  5. Select the knowledge source from the dropdown.
  6. Enter instructions for how and when the agent should use this knowledge source — for example, "Use this when answering RFP questions" or "Use this for context when writing section 5." The field is pre-filled with the knowledge source description by default.
  7. Click Add knowledge source.
  8. Click Save, and then click Save changes on the agent.

  Tip

Multiple knowledge sources can be added to a single Document Agent. Use clear, distinct instructions for each one to help the agent select the most relevant source. The more knowledge sources are added without clear instructions, the higher the risk of the agent picking the wrong one.

AI ai assistant admin_role Document Agents
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.