FlowsBook a callSign inCreate free accountSign up
AI employees and automation

An AI agent that answers from company documents, not from guesswork

Give an AI agent your policies, price lists and site tables to search. It looks up the passage that answers a question, replies from it, and says so when nothing fits.

Part of the guide AI employees

By the xMap team · · 5 min read

An AI agent that answers from company documents searches your own files before it replies: the policy, the price list, the table of opening hours. When a customer asks whether dogs are allowed or what time check-out is, it finds the passage that says so and answers from it, instead of writing what sounds likely. In xMap Flows this is one setting on the AI agent, Look things up in, which points it at your team's reference files and My data tables.

This is for anyone who wants an assistant on a chat page, WhatsApp or an internal channel to give the company's answer rather than a general one: hotels, clinics, schools, distributors, property managers. It covers how the look-up works, how to prepare documents so they are found, a made-up example from a hotel, and how to check what the agent actually read.

Why general knowledge is the wrong answer

A language model knows a great deal about hotels in general. It does not know that your hotel allows small dogs in four rooms only, that late check-out is free for members, or that the car park closes at midnight. Asked anyway, it fills the gap with the most common answer, which is often wrong for you and always sounds sure of itself.

The fix is to give it something to read at the moment of the question, and to tell it to answer only from that. People call this retrieval: find the right passage first, then write. The quality of the answer then depends mostly on your documents, which you control.

How Look things up in works

On the AI agent, the setting Look things up in has three choices:

  • Nothing: the agent works from its instructions and its tools only.
  • All my company files and tables: it may search every reference file your team uploaded and every table in My data.
  • Only the ones I choose: you pick the files and tables, for example the guest policy and the room list, and nothing else is searched.

Files and tables are cut into short passages when they are added. When a question needs them, the agent searches those passages by their words, reads the few that match best and answers from them. It decides for itself when a search is worth doing: a greeting needs none, a question about parking does. Searching your own files is free.

If an admin switches company file search off for the organization, the agent stops searching there and answers without it, so the setting cannot reach further than your admins allow.

Preparing documents so the right passage is found

The search matches words, so documents written the way customers ask are found more often. A few habits help more than anything else:

  • One subject per section, with a plain heading. Pets, Parking, Late check-out. A heading that uses the customer's word helps the passage come up.
  • Say the answer in the first sentence of the section. Dogs under 10 kg are welcome in rooms 101 to 104. Details follow.
  • Use the words people use. If guests say car park and your document says vehicle facilities, add both.
  • Put lists in tables. Branches with their hours, products with their sizes, rooms with their features: a table in My data gives each row its own passage.
  • Remove old versions. Two price lists from different years will both be found. Keep one, and date it.

A hotel's concierge chat (made up)

Take a boutique hotel group with three properties in Lisbon. It has a guest policy as a PDF, a table of its rooms and their features, and a table of the restaurants it recommends with their hours. Its website has a chat page.

  1. Chat starts the flow when a guest writes.
  2. The AI agent's instructions: You are the concierge of our three Lisbon hotels. Answer questions about our hotels from our documents only. If the documents do not answer, say you will pass the question to the front desk. Look things up in is set to Only the ones I choose: the guest policy and the two tables.
  3. A tool linked to the agent, Nearby places, lets it find pharmacies, cash machines or a late supermarket near the hotel the guest names.
  4. Reply sends the answer back in the chat.

A guest asks: Can I bring my dog to the Alfama hotel? The agent searches, finds the pets section of the policy and the Alfama rows of the room table, and answers that small dogs are welcome in two named rooms and suggests asking for one when booking. The next guest asks where the nearest pharmacy is; the agent skips the documents and uses Nearby places. A third asks about a spa that the hotel does not have; the search finds nothing that says so, and the agent says it will pass the question on rather than inventing one.

Seeing what it read

Every run keeps how the agent answered: each search, the passages that came back, any tool it called and the answer it wrote. In the run, press See how it answered. When an answer is wrong, this tells you whether the document was missing, out of date, or found and misread, which are three different fixes.

For answers that must meet rules every time, such as never promising a discount or always answering in Portuguese when the guest wrote in Portuguese, add Check the work between the agent and Reply.

Mistakes to avoid

  • Searching everything when a few files would do. All my company files and tables can surface an internal note in a customer chat. For a public page, choose the files.
  • Instructions that allow guessing. Tell the agent plainly to answer from the documents and to say when they do not cover a question.
  • Long, mixed documents. A forty-page handbook with no headings gives weak passages. Split it by subject.
  • Forgetting to update. The agent answers from what it finds. When a policy changes, replace the file the same day.

Document look-ups pair well with an agent's other skills: tools for live data, and memory of each person. The glossary entry on the AI agent explains how those parts fit together.

Questions

What kinds of documents can it search?

The reference files your team uploaded and your tables in My data. Tables work best for lists such as branches, products or rooms.

Will it make up an answer when the documents are silent?

Tell it not to in its instructions, and say what to do instead, such as offering to pass the question on. See how it answered shows whether it searched and what it found.

Can a customer see our other files?

Only through the agent's answers, and only from the files it may search. Choose Only the ones I choose for public chat pages so internal files are never searched.

Does it cost more to search documents?

No. Searching your company files and tables is free; the agent's thinking steps and any paid tools it calls cost as usual.

Is this the same as giving reference files to xMap LLM?

They are related. xMap LLM reads the reference files you attach in full for every item, while the agent searches passages only when a question needs them.

Templates that do this

Read next

More on ai employees and automation · Every article · Templates

Put it to work

An AI employee in xMap Flows does this on live data, on its own timetable. Start from a template or describe it in plain words.