> For the complete documentation index, see [llms.txt](https://docs.clickai.vn/clickai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clickai.vn/clickai-docs/clickai-docs-en/database/integrate-knowledge-within-apps.md).

# Integrate Knowledge within Apps

## Table of Contents

·       \[Create an Application with Knowledge]\(#create-an-application-with-knowledge)

·       \[Retrieval Setting]\(#retrieval-setting)

·       \[Metadata Filtering]\(#metadata-filtering)

·       \[Integrate in Chatflow/Workflow]\(#integrate-in-chatflowworkflow)

·       \[Integrate in Chatbot]\(#integrate-in-chatbot)

·       \[View Linked Applications]\(#view-linked-applications)

·       \[FAQ]\(#faq)

&#x20;

## Create an Application with Knowledge

Quick workflow:

1\.     Go to Knowledge — Create Knowledge — Upload file

2\.     Go to Studio — Create Application — Select Chatbot

3\.     Open Context, click Add, select the created Knowledge Base

4\.     Use Metadata Filtering to refine document search

5\.     In Context Settings > Retrieval Setting, configure retrieval method

6\.     Enable Citation and Attribution in Add Features

7\.     Test in Debug and Preview

8\.     Click Publish to launch the application

&#x20;

## Retrieval Setting

Configure how the application retrieves information from Knowledge Base:

### Weight Settings

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Mode</td><td valign="top">Description</td></tr><tr><td valign="top">Semantic = 1</td><td valign="top">Semantic search only. Searches by contextual meaning, supports multilingual</td></tr><tr><td valign="top">Keyword = 1</td><td valign="top">Keyword search only. Exact keyword matching, resource-efficient</td></tr><tr><td valign="top">Custom Weights</td><td valign="top">Combines semantic + keyword at custom ratio</td></tr></tbody></table>

&#x20;

### Retrieval Parameters

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td><td valign="top">Default</td></tr><tr><td valign="top">Top K</td><td valign="top">Maximum chunks to return</td><td valign="top">3</td></tr><tr><td valign="top">Score Threshold</td><td valign="top">Minimum similarity score</td><td valign="top">0.5</td></tr></tbody></table>

&#x20;

&#x20;

## Metadata Filtering

### In Chatflow/Workflow

Use the Knowledge Retrieval node with Metadata Filter:

Select Filter Mode:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Mode</td><td valign="top">Description</td></tr><tr><td valign="top">Disabled (Default)</td><td valign="top">No metadata filtering</td></tr><tr><td valign="top">Automatic</td><td valign="top">Filters auto-configure from query variables</td></tr><tr><td valign="top">Manual</td><td valign="top">Configure filters manually</td></tr></tbody></table>

&#x20;

Manual Mode Configuration:

9\.     Click Conditions to open the configuration panel

10\.  Click +Add Condition — select metadata fields

11\.  Configure filter conditions:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Data Type</td><td valign="top">Supported Operators</td></tr><tr><td valign="top">String</td><td valign="top">is, is not, is empty, is not empty, contains, not contains, starts with, ends with</td></tr><tr><td valign="top">Number</td><td valign="top">=, ≠, >, &#x3C;, ≥, ≤, is empty, is not empty</td></tr><tr><td valign="top">Date</td><td valign="top">is, before, after, is empty, is not empty</td></tr></tbody></table>

&#x20;

12\.  Add filter values:

·       Variable: Select from Chatflow/Workflow variables

·       Constant: Enter fixed values

13\.  Set logic operators: AND (match all) or OR (match any)

📝 NOTE: Automatic Mode requires model selection for document retrieval. When multiple Knowledge Bases are selected, only common metadata fields appear.

&#x20;

## Integrate in Chatflow/Workflow

14\.  Drag the Knowledge Retrieval node onto the canvas

15\.  Select the Knowledge Base to connect

16\.  Configure query variable (usually {{sys.query}})

17\.  (Optional) Configure Metadata Filter

18\.  Connect output to an LLM node as context

&#x20;

## Integrate in Chatbot

19\.  Open the Chatbot application in Studio

20\.  In the Context section, click + Add

21\.  Select the Knowledge Base

22\.  Configure Retrieval Settings

23\.  Enable Citation and Attribution if needed

&#x20;

## View Linked Applications

In any Knowledge Base, you can view a list of all applications currently using it. This helps assess the impact when modifying content.

&#x20;

## FAQ

How should I choose Rerank settings in multi-recall mode?

When using multiple knowledge bases, enable a Rerank model to sort results from all sources.

Can't find the "Weight Score" option?

Weight Score is only available when using the High Quality index method. Check the index method in Knowledge Base Settings.

Error adjusting Weight Score with multiple Knowledge Bases?

When referencing multiple knowledge bases, Weight Score may be restricted. Configure a Rerank model instead.

&#x20;

*📖 Previous: \[Test Retrieval]\(./11-test-retrieval.md)*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clickai.vn/clickai-docs/clickai-docs-en/database/integrate-knowledge-within-apps.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
