Import and query a RustClaw RAG knowledge base

Import product manuals, FAQs, and procedures in Memory → Knowledge base. Retrieval-augmented generation (RAG) lets the agent find relevant passages and cite them in replies. Long-term memory, also on the Memory page, stores details from conversations such as preferences and facts.

Download a sample or prepare your own files

The sample Returns Handbook includes instructions for requesting a return and a rule about who pays return shipping for defective items.

You can also import text, Markdown, PDFs with selectable text, and Office documents such as DOCX, XLSX, and PPTX. For a scanned PDF, run OCR first and import the searchable copy.

Put the file where the agent service can read it. For a remote deployment, copy it to that device or to a folder mounted there that the service is allowed to read. Relative paths are resolved from the agent’s workspace.

Import the file and search for a passage

  1. Open Memory → Knowledge base → Add material. Enter Returns Handbook as the library name. If you saved the sample in the workspace’s docs folder, enter docs/returns-handbook.md as the path. Enter one file or folder path per line when adding multiple sources.
  2. Select Start adding and wait for processing. If Continue unfinished work appears, use it to process the next batch before refreshing the library list.
  3. Select Refresh libraries, choose the library, and use View document status to check that the file is listed. Under Search material, search for return shipping and check that the excerpt mentions the seller covering it.
The Knowledge base panel shows the Returns Handbook, its file, and a search result for return shipping.
Import and search for the original passage in Memory → Knowledge base (demo data).

Ask in Agent chat and verify the source

Name the library in your first question and ask for a citation. When the library is clear from the current conversation, you can ask a follow-up directly. If several libraries could contain the answer, name the one you want the agent to search.

Agent cites a section of the sample Returns Handbook in a return shipping answer.
The Agent reply cites section 3.2 of the sample Returns Handbook.

A citation may include a section, page, or worksheet, depending on the document. Use that location or find the passage in Search material to verify both the rule and the conditions under which it applies.

Try three questions with the sample handbook

  1. Find a stated rule
    “In the Returns Handbook, who pays return shipping for a defective item? Cite the policy.”

    The reply should say the seller pays once customer support confirms the defect and cite section 3.2.

  2. Ask the same thing in different words
    “Support has confirmed the item is defective. Do I need to pay the courier to send it back? Please cite the Returns Handbook.”

    The reply should find the same section and preserve the condition that support has confirmed the defect.

  3. Ask for a detail the handbook does not cover
    “How many days after the warehouse receives a return must the refund be issued? Answer using only the Returns Handbook.”

    The reply should say the handbook does not specify a refund deadline.

Seven RAG examples, from product questions to order tracking

Download and extract the eight Chinese Markdown files. Copy the folder to a location the agent service can read, then add the folder under Memory → Knowledge base. Enter RAG 场景示例 as the library name and use Refresh libraries to check that all eight files appear.

Use a fresh chat for each case. Ask the agent to search RAG 场景示例 and cite its sources. Set up the sample order MCP server for the seventh case. Products, promotions, warehouse procedures, and orders use demo data. The prompts below are English translations. 查看测试用的中文提问

The summaries below come from local tests in Chinese. We checked retrieval records and cited documents for all seven replies, and also checked the order response from MCP.

  1. Product advice · Compare two headset models

    How do Qingzhou Models A and B differ? Which can connect to a phone and a computer at the same time?

    Model B connects to two Bluetooth devices and lasts about 8 hours per charge or 32 hours with the case. Model A connects to one device and lasts about 6 hours per charge or 24 hours with the case.

  2. Promotions · Check which discounts stack

    Can I combine the Summer Weekend sale discount and the store coupon? Which items are excluded?

    Apply the store coupon first, then check whether the remaining eligible subtotal meets the platform discount threshold. Preorder deposits, digital gift cards, and clearance items are excluded.

  3. Warehouse shipping · Turn packing instructions into a checklist

    Find the glassware packing procedure in RAG 场景示例. Turn the documented inspection and packing steps into a checklist and give the source filename.

    Check the order and inspect each glass. Wrap each in two layers of bubble wrap, separate the glasses with dividers, and leave at least 3 cm for cushioning in a double-wall carton. H-tape the box, mark it fragile, and verify the order and tracking numbers before dispatch.

  4. Onboarding · Publish a first product listing

    I’m new to store operations. What do I need for my first product listing? Put the steps in order.

    Gather the product details, SKU, prices, inventory, and images. Draft the listing and set shipping terms, have a supervisor review it, then publish and test the buyer-facing listing and cart.

  5. Troubleshooting · Open the Raspberry Pi console

    Use kb.search to look up what to check when the Raspberry Pi web console won’t open. Search RAG 场景示例. List the first three steps in order, including the commands, local address, LAN checks, and source filename.

    Check service status and health on the Pi, then try the local default port, 8788. If that works on the Pi, check its LAN address, listen settings, and firewall.

  6. Document revisions · Compare two shipping procedures

    What changed between Qinghe warehouse shipping procedures v1.0 and v2.0 for cutoff times, order checks, and exceptions? Cite both documents.

    The cutoff moved from 16:00 to 15:30. Barcode scans replaced paper checklists. Staff now open an exception ticket immediately and hold the affected order, replacing the end-of-shift email.

  7. MCP and RAG · Track an order and check its packing slip

    Use the MCP tool get_order_status to check the status and tracking number for order 3. Then search its packing slip in RAG 场景示例 and tell me whether it needs fragile packing. Cite the document.

    The local MCP demo returned order 3 in transit with tracking number 7898047967. The indexed packing slip calls for F2 fragile handling for two ceramic mugs, with individual wrapping, cushioning around the handles, and a divider.

    With the MCP server available on this site, use lookup_order in the prompt. Both demos use the same sample status and tracking number for order 3.

When an import stalls or a passage is missing

The task is queued or processing
Queued means the task is waiting to start. Working means the current batch is running. If it takes longer than expected, use the task ID shown in the panel to check its status in Tasks. If the panel offers Continue unfinished work, finish the remaining batches before refreshing libraries.
The library is missing from the list
Check that you’re signed in to the same account and deployment used for the import, then select Refresh libraries. Each deployment stores its own imported documents.
The search finds no matching passage
Check View document status and search for words from the original. Open Diagnostics for skipped-file or parsing details. Check the path and permissions on the service host, or use a searchable copy of a scanned PDF.
The source file has changed
Run Add material again with the same library name and file path to update that file. To process all recorded sources again, select Rebuild library index. Check the document status and repeat your search afterward.