A chatbot for your website. It answers from your own content.
The Opensolr Chat Bot answers your visitors from your Opensolr Index: the pages Opensolr crawled from your site, or what you sent with Data Ingestion. Each answer is written as it comes, with links to the pages, the products and the exact PDF pages it used.
Free and open source under the MIT license. PHP 8.1 or newer, SQLite, no framework, no separate virtual host. It needs an Opensolr account: every answer uses AI requests from the monthly allowance of your plan. Try it on this page: the chat at the bottom right is the Opensolr Chat Bot, answering from the Opensolr Index of opensolr.com.
- 01
Install it on your site
One Composer package and one small PHP file, on one path of your own site.
- 02
Connect your Opensolr Index
In its own admin page: your Opensolr email, a scoped API key, and the index it answers from.
- 03
Add one script tag
The chat button appears at the bottom right of every page that has it.
- 04
Your visitors ask
In their own words and their own language, and get answers from your content, with links.
Your visitors ask. Your site answers.
Every question is searched in your Opensolr Index and answered from what that search finds: word by word, in the visitor’s language, with a link for every page, product and PDF page it uses; the sources at the end of an answer show as small pills. The chat is the same one Opensolr hosts for you, so its answers and commands are explained once: What your visitors see · Chat bot commands.
In the chat window
A button at the bottom right of your pages opens it.
- Your logo, words and colour: title, button text, greeting and one accent colour.
- Commands one keystroke away: typing
/lists them, the ? button explains each one. - A conversation that is kept in the visitor’s browser, across reloads, until New chat.
- Resizable on a computer, full screen on a phone.
Behind it, on your server
Visitors talk only to your site.
- Your Opensolr email and API key stay on your server and never reach a browser.
- A captcha before the first question, if you turn it on.
- Limits you set: message length, questions per conversation and per visitor.
- An admin in seven languages: English, Română, Français, Deutsch, Español, 中文 and 日本語.
Stats, history and seven settings tabs, on your own site.
At /opensolr-chat/admin on your site, behind a password you set on the server and, once you add reCAPTCHA keys, a captcha before it opens. The admin, step by step
| Page or tab | What you find there |
|---|---|
| Stats | Messages, conversations, visitors, answer rates, ratings and what people search for. |
| History | Every conversation of the last 30 days, searchable, readable as the visitor saw it. |
| Account | Your Opensolr email and API key. Test connection lists your indexes; you choose the one the chat answers from. |
| Assistant | Your own instructions for the assistant, and its time zone. |
| Chat window | Title, button text, greeting, placeholder, logo and accent colour. |
| Limits | Characters per message and per text to translate, questions per visitor in a time window, questions per conversation. |
| Captcha | Your reCAPTCHA v2 keys, and how many hours a solved captcha lasts. |
| Language | The language of the admin, one of seven. |
| Add to your pages | The script tag to paste into your pages, and the two attributes that tell the chat who is signed in. |
Your credentials stay home.
On your server
In one SQLite database, in a folder outside your web root.
- Your Opensolr email and API key. Use a scoped key made only for the chat, limited to its index.
- Your settings, your logo and the admin password, the password only as a hash.
- The counters behind the limits: a keyed hash of each visitor’s IP address, never the address itself, deleted as they expire.
In the visitor’s browser
And nowhere else.
- The conversation, its last 100 messages, until New chat.
- The size of the window they chose.
- A solved captcha, in a cookie, for the hours you set.
A PHP site and an Opensolr Index.
A PHP site
PHP 8.1 or newer with pdo_sqlite, curl, json and mbstring, Composer, and Apache or nginx. No MySQL, no framework, no build step.
Your site in an Opensolr Index
Crawled by Opensolr or sent with Data Ingestion. The chat answers from that index and nothing else. Enterprise Site Search explains both.
Six steps, a few minutes.
- Install the packageWith Composer, in your project folder.
- Create a data folderOutside your web root, owned by the user PHP runs as.
- Mount it on one pathCopy the front controller and its
.htaccessfrom the package into a folder of your web root,opensolr-chat. nginx takes twolocationblocks instead. - Set the admin passwordWith one command, run as the user PHP runs as.
- Connect your accountOpen
/opensolr-chat/admin, enter your Opensolr email and API key, click Test connection and choose the index. - Add the script tagBefore
</body>on your pages. Every step in full is on Installing.
Every line is on GitHub.
The Opensolr Chat Bot Client is MIT licensed: read what it sends where, change it, or fork it and make it yours.
Source code
PHP for the server, plain JavaScript for the chat window. github.com/phpcip/opensolr-chat-bot-client
Composer package
composer require opensolr/chat-bot-client, and every version on Packagist.
Documentation
Installing, the admin, every setting, the commands, streaming, updating and troubleshooting. Read the documentation
Open source
The Opensolr Chat Bot Client is free, MIT licensed and maintained in the open. Browse the code, open an issue, or sponsor the work that keeps it current.
Let your visitors talk to your site.
Free, open source, on your own server, answering from your own Opensolr Index with the AI requests of your plan: create an account or see the plans.