> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convocore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Previewing the KB

The Preview KB feature allows you to test your knowledge base, experiment with different chunking options, and try out various AI models directly within your agent's interface.

### Accessing Preview KB

<Steps>
  <Step title="Navigate to Knowledge Tab">
    Open your agent's dashboard and select the 'Knowledge' tab.
  </Step>

  <Step title="Locate Preview KB">
    Look for the `Preview KB` button in the upper right corner of the interface.
  </Step>
</Steps>

<Card title="Preview KB User-Interface" icon="eye">
  <img className="rounded-md" src="https://mintcdn.com/convocore/kNoD7_2-fZetOeo6/images/preview-kb-ui-shots.png?fit=max&auto=format&n=kNoD7_2-fZetOeo6&q=85&s=5973bbc7c2d5eefe49a79b26dde89afc" width="600" alt="Preview KB UI" data-path="images/preview-kb-ui-shots.png" />
</Card>

<Note>
  Experiment with different queries, chunking options, and AI models to optimize your knowledge base.
</Note>

## Using the Debug Screen

The debug screen is a powerful tool for testing how your agent's utlizises its knowledge. Here's the details you can see:

#

<Accordion title="Sample Debug Screen">
  **Starting tool**: Input variable with the users question.    **Query:** The users query sent to the LLM.
  **Parent Document metadata:** The name and description of the document, used for better context to the LLM.

  <img className="rounded-md" src="https://mintcdn.com/convocore/uZzIbBiivXuGDpf1/images/example-kb-retrieved-chunks-shots.png?fit=max&auto=format&n=uZzIbBiivXuGDpf1&q=85&s=55656afb23ce9fdb77975deadd90b5d8" width="600" alt="Example Debug Screen" data-path="images/example-kb-retrieved-chunks-shots.png" />
</Accordion>

<Video src="/images/preview-kb-video.mp4" />

<CardGroup cols={2}>
  <Card title="Returned Chunks" icon="puzzle-piece">
    View all text chunks that match your query, along with their similarity scores.
  </Card>

  <Card title="Document Information" icon="file-lines">
    See the source document name and description for each chunk retrieved.
  </Card>

  <Card title="Token Usage" icon="calculator">
    Monitor both input and output token consumption for each query.
  </Card>

  <Card title="Model Performance" icon="chart-line">
    Evaluate how different [AI models](AImodels) perform with your knowledge base.
  </Card>
</CardGroup>

### Understanding retrieval details

The retrieval details makes for advanced control over your agents usage, with detailed information about each chunk, tokens and LLM. The <Tooltip tip="A similarity score measures how closely a chunk of text matches your query. Higher scores indicate greater relevance.">similarity scores</Tooltip> help you gauge the relevance of returned chunks to your query. This is crucial for retrieving the most useful information and for using the <Tooltip tip="The combined tokens from your query and the relevant chunks retrieved from the knowledge base.">input</Tooltip> and <Tooltip tip="The number of tokens generated by the model in its response. These represent the model's answer based on the input context.">output</Tooltip> tokens efficiently.

In the screenshots below the chunk with the highest similarity score ranked `0.683`, using **1262** input tokens and **220** to output the answer with `claude 3.5 sonnet`

<img className="rounded-md" src="https://mintcdn.com/convocore/YDOB1G28XgxvIwqF/images/kb-retreival-details-shots.png?fit=max&auto=format&n=YDOB1G28XgxvIwqF&q=85&s=627daa214f5c1c3b9f02513cf5a6cf3d" width="600" alt="Example Debug Screen" data-path="images/kb-retreival-details-shots.png" />

> *Screenshot of chunks, similarity score, LLM used and tokens usage.*

#

<Tip>
  Monitoring token usage is especially important for cost-sensitive clients aiming to minimize credit and token consumption.
</Tip>

By leveraging the Preview KB feature and understanding the debug screen, you can fine-tune your agent's knowledge base for enhanced accuracy and cost-effectiveness. This is considered an **advanced** feature, new users and agencies typically do not need to utilize this until they have gained more experience or their use cases become more complex.

### Related docs:

<CardGroup cols={2}>
  <Card title="Adding data" icon="file-circle-plus" href="/agent-creation/knowledgebase/adding-data/direct-text-entry" />

  <Card title="Adjusting KB settings" icon="gear" href="/agent-creation/knowledgebase/adjusting-kb-settings" />

  <Card title="Structuring KB documents" icon="file" href="/agent-creation/knowledgebase/structuring-kb-documents" />

  <Card title="What is the knowledgebase?" icon="brain" href="/agent-creation/knowledgebase/about-the-knowledgebase" />
</CardGroup>
