Skip to main content

Create an agent powered by your documents

At a glance

This tutorial walks you through creating an AI agent capable of answering your users' questions based on your internal documents (PDF, Word, web pages). The agent searches for relevant information in your knowledge base and provides sourced answers.

Modules used: Knowledge Base, Agent Studio.

Estimated time: 15 minutes.

What you'll do

  • Import documents into the knowledge base
  • Wait for indexing to complete
  • Create a specialized agent
  • Configure the document search tools
  • Test the agent with questions

Prerequisites

  • An active Ontologie workspace
  • Documents to import (PDF, DOCX, or URLs)

Step 1: Import documents

  1. Go to Knowledge Base from the sidebar.
  2. Click + Import.
  3. Select the import mode:
    • Files: drag and drop your PDFs or Word documents
    • URL: enter the address of a web page to index
  4. Click Import.

Indexing starts automatically. Each document goes through several stages:

  • Text extraction
  • Segmentation into chunks
  • Embedding generation (vector representations)
  • Indexing for search

Wait until the status of each document changes to Indexed before continuing.

For more details: Import documents.

Step 2: Create a specialized agent

  1. Go to Agent Studio.
  2. Click + Create an agent.
  3. Fill in the configuration:
    • Name: Documentation Assistant (or a name of your choice)
    • System instructions: describe the agent's role, for example:
You are a specialized assistant that answers questions based on
the company's internal documentation. Always cite your sources.
If you cannot find the information in the documents, say so
clearly rather than making up an answer.
  1. Click Create.

Step 3: Configure the tools

  1. In the agent configuration, go to the Tools tab.
  2. Enable the following tools:
ToolDescription
searchDocumentationSearches the knowledge base by semantic relevance
hybridSearchCombined search (semantic + keywords + graph)
  1. Disable unnecessary tools to avoid distractions (e.g. spreadsheet tools if the agent should not access them).

Step 4: Test the agent

  1. Open the agent's chat.

  2. Ask questions based on the content of your documents:

    • What is the refund policy?
    • How do I configure module X?
    • What are the steps for process Y?
  3. Verify that the agent:

    • Responds based on the imported documents
    • Cites the sources (document name, section)
    • Clearly indicates when it cannot find the information

Using the Visualizer

To understand the agent's reasoning:

  1. Click Visualizer in the toolbar.
  2. Observe the OODA loop: the agent observes the question, orients toward the right tools, decides on a search strategy, and acts by querying the knowledge base.

For more details: Visualizer.

Step 5: Refine

If the answers are not satisfactory:

ProblemSolution
The agent can't find the informationVerify that the documents are properly indexed (status "Indexed")
Answers are too genericImprove the system instructions with concrete examples
The agent makes up informationAdd to the instructions: "Only answer if you find the information in the documents"
Answers in the wrong languageSpecify in the instructions: "Always answer in English"

Expected outcome

Your AI agent answers questions based on your internal documents. The answers are sourced and reliable. You can enrich the knowledge base at any time by importing new documents.

Going further

Need help?

Contact us: Support and contact.