Skip to content

Knowledge base & live database

Connect your product database safely (read-only user) or upload documents and chat history.

The bot answers from your content. You can combine both options below.

Option A: connect your database

Best when prices and stock change often. HiveChat runs read-only queries built from your column mapping — the AI never writes SQL — with TLS required, SSRF protection and at most 20 rows per lookup.

Supported: PostgreSQL (postgresql://) and MySQL (mysql://) databases reachable on the public internet.

Create a read-only user

Never use your admin login. Create a user that can only read the product table:

-- PostgreSQL
CREATE USER hivechat_ro WITH PASSWORD 'a-long-random-password';
GRANT CONNECT ON DATABASE shop TO hivechat_ro;
GRANT USAGE ON SCHEMA public TO hivechat_ro;
GRANT SELECT ON public.products TO hivechat_ro;

-- MySQL
CREATE USER 'hivechat_ro'@'%' IDENTIFIED BY 'a-long-random-password';
GRANT SELECT ON shop.products TO 'hivechat_ro'@'%';

Your connection URL looks like postgresql://hivechat_ro:PASSWORD@db.example.com:5432/shop?sslmode=require.

Map your columns

In Knowledge → Live database, paste the URL and fill in the table and column names for product name and price (required), plus optional stock, SKU, description, schema and currency. Click Save & test connection — you'll see how many sample rows were readable.

The URL is write-only: after saving, only a masked host is shown. Paste it again whenever you change the mapping.

Option B: upload documents

Drag & drop TXT, MD, CSV, JSON or PDF files up to 5 MB each: product catalogs, price lists, FAQs, return policies. Choose Chat history for exported WhatsApp chats so the bot learns your tone and common questions. Or use Paste text for quick FAQs.

Encrypted PDFs and executable files are rejected. Everything you upload is encrypted and can be deleted anytime; Delete all knowledge wipes documents and the database connection.

Test retrieval

Use Test retrieval to type a customer question and see exactly which snippets the bot would use. If nothing relevant shows up, add clearer content.

Was this guide helpful?