{"id":17115082,"url":"https://github.com/plnech/chatbot-with-algolia-answers","last_synced_at":"2026-01-05T20:01:28.911Z","repository":{"id":71322032,"uuid":"381615518","full_name":"PLNech/chatbot-with-algolia-answers","owner":"PLNech","description":"Chatbot with Algolia Answers and Dialogflow","archived":false,"fork":false,"pushed_at":"2021-06-30T07:36:33.000Z","size":22559,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T06:51:17.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ni17w.sse.codesandbox.io/","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PLNech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-30T07:36:00.000Z","updated_at":"2021-10-06T12:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c1ba75c-54a9-4ce0-8de3-346f11ed926f","html_url":"https://github.com/PLNech/chatbot-with-algolia-answers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLNech%2Fchatbot-with-algolia-answers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLNech%2Fchatbot-with-algolia-answers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLNech%2Fchatbot-with-algolia-answers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLNech%2Fchatbot-with-algolia-answers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLNech","download_url":"https://codeload.github.com/PLNech/chatbot-with-algolia-answers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186921,"owners_count":20574554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:21:32.913Z","updated_at":"2026-01-05T20:01:28.906Z","avatar_url":"https://github.com/PLNech.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatbot with Algolia Answers and Google Dialogflow Messenger\n\nThis sample app implements a chatbot that answers your questions about Covid-19 vaccines. With chatbots, you can ask questions using your natural language instead of using artificial search queries. Algolia Answers extracts the users' _intent_ from their questions (semantic understanding) and offers best-matching answers without the need for extra training of the model.\n\n\u003cimg src=\"demo/diagram.png?raw=true\" alt=\"A flowchart of the chatbot with Algolia Answers sample application\" align=\"center\"\u003e\n\n## Features\n\nThe sample app uses the following features:\n\n- 🤖 Chatbot building made easy with [Google Cloud Dialogflow](https://cloud.google.com/dialogflow/)\n\n  The sample app uses [Dialogflow Messenger](https://cloud.google.com/dialogflow/es/docs/integrations/dialogflow-messenger), a visual chatbot interface (**1**). A [webhook service](https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook) sends the question to Algolia Answers, which handles all user intents (questions).\n\n- 🧠 Semantic understanding using [Algolia Answers](https://www.algolia.com/products/answers-for-support/)\n\n  The heavy lifting is performed by Algolia Answers (**3**), Algolia's semantic search API. Answers [combines information from the search index](https://www.algolia.com/doc/guides/algolia-ai/answers/), such as relevance, synonyms, or rules, and applies semantic understanding of small snippets to rank which snippet best answers the question (**4**). You don't have to train anything!\n\n  Conventionally, you have to train Dialogflow by providing [training phrases and their variations](https://cloud.google.com/dialogflow/es/docs/tutorials/build-an-agent/create-customize-agent) together with matching responses.\n\n  You can also integrate Algolia Answers into existing chatbots by directing only a part of user intents to Algolia Answers while other intents are handled elsewhere. Instead of Dialog Messenger, you can also choose other chatbot interfaces, or implement your own.\n\n- 📈 Data from the [World Health Organization's FAQ on Covid-19 vaccines](\u003chttps://www.who.int/news-room/q-a-detail/coronavirus-disease-(covid-19)-vaccines\u003e)\n\n## Demo (Try it yourself!)\n\n\u003cimg src=\"demo/demo.gif?raw=true\" alt=\"A short movie displaying the Algolia COVID-19 Vaccines chatbot\" align=\"center\" width=\"400\"\u003e\n\n[Access the demo](https://ni17w.sse.codesandbox.io/)\n\n## How to run the sample app locally\n\nThe sample app implements two servers in these programming languages:\n\n- [Python](server/python)\n- [Node.js/JavaScript](server/node)\n\nThe [client](client) is a single HTML page with the [Dialogflow Messenger](https://cloud.google.com/dialogflow/es/docs/integrations/dialogflow-messenger).\n\n### 1. Clone this repository\n\n```\ngit clone https://github.com/algolia-samples/chatbot-with-algolia-answers\n```\n\nCopy the file `.env.example` to the directory of the server you want to use and rename it to `.env`. For example, to use the Python implementation:\n\n```bash\ncp .env.example server/python/.env\n```\n\n### 2. Set up Algolia\n\nTo use this sample app, you need an Algolia account. If you don't have one already, [create an account for free](https://www.algolia.com/users/sign-up). Note your [Application ID](https://deploy-preview-5789--algolia-docs.netlify.app/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/importing-with-the-api/#application-id).\n\nIn the `.env` file, set the environment variables `ALGOLIA_APP_ID`:\n\n```bash\nALGOLIA_APP_ID=\u003creplace-with-your-algolia-app-id\u003e\n```\n\n### 3. Create your Algolia index and upload data\n\nAfter you set up your Algolia account and Algolia application, [create and populate an index](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/). Or, you can use the same data as the demo, [The World Health Organization COVID-19 FAQs](sample/who-covid-faq.json).\n\nTo upload your data, you can use the [Algolia dashboard](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/importing-from-the-dashboard/) or use on of Algolia's [API clients](https://www.algolia.com/developers/#integrations).\n\nAfter creating the index and uploading the data, set the environment variable `ALGOLIA_INDEX_NAME` in the `.env` file:\n\n```bash\nALGOLIA_INDEX_NAME=\u003creplace-with-your-algolia-index-name\u003e\n```\n\n### 4. Set up Algolia Answers\n\n[Follow the instructions](https://www.algolia.com/doc/guides/algolia-ai/answers/#authentication) in Algolia's documentation to set up Algolia Answers for your index. After you added Algolia Answers to your account, set the environment variable `ALGOLIA_API_KEY` in the file `.env`.\n\n```bash\nALGOLIA_API_KEY=\u003creplace-with-your-algolia-api-key-with-algolia-answers-acl\u003e\n```\n\n### 5. Create and configure a Dialogflow agent\n\nThis sample app uses Google Cloud's [Dialogflow](https://cloud.google.com/dialogflow) to bootstrap the chatbot\nand the [fulfillment](https://cloud.google.com/dialogflow/es/docs/fulfillment-overview) webhook feature to connect it to Algolia Answers.\n\n1. [Follow the Dialogflow guide](https://cloud.google.com/dialogflow/es/docs/agents-manage) to create an empty agent.\n2. Replace the [default fallback intent](https://cloud.google.com/dialogflow/es/docs/intents-default#fallback) with [the file from the sample](sample/dialogflow-default-fallback-intent.json). The default fallback intent is the answer shown, when the agent couldn't find a matching response.\n3. Populate the `agent-id` variable in the [index file](client/index.html)\n\n### 6. Follow the instructions in the server directory\n\nEach server directory has a file with instructions:\n\n- [Node.js](server/node/README)\n- [Python](server/python/README)\n\nFor example, to run the Python implementation of the server, follow these steps:\n\n```bash\ncd server/python # there's a README in this folder with instructions\npython3 venv env\nsource env/bin/activate\npip3 install -r requirements.txt\nexport FLASK_APP=server.py\npython3 -m flask run --port=4242\n```\n\n1. Expose your development server to the internet. For example, you can use [ngrok](https://ngrok.com/).\n2. [Add the public URL](https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook) of the development server to the Dialogflow webhook so it can use it to answer the queries.\n3. Enter questions in the chatbot!\n\n## Authors\n\n- [@cdenoix](https://twitter.com/cdenoix)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplnech%2Fchatbot-with-algolia-answers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplnech%2Fchatbot-with-algolia-answers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplnech%2Fchatbot-with-algolia-answers/lists"}