{"id":21389981,"url":"https://github.com/phospho-app/ai-chat-bubble","last_synced_at":"2025-08-10T12:16:57.813Z","repository":{"id":262683558,"uuid":"887153441","full_name":"phospho-app/ai-chat-bubble","owner":"phospho-app","description":"Simple AI chat bubble for your website: Wordpress, React, HTML, Shopify. Answer questions about a website's content using RAG, streaming, and Mistral LLM.","archived":false,"fork":false,"pushed_at":"2025-03-24T16:27:00.000Z","size":2245,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-24T17:30:37.689Z","etag":null,"topics":["chatbot","genai","llm","rag"],"latest_commit_sha":null,"homepage":"https://phospho.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phospho-app.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2024-11-12T09:03:11.000Z","updated_at":"2025-03-24T16:26:32.000Z","dependencies_parsed_at":"2025-03-24T17:36:32.072Z","dependency_job_id":null,"html_url":"https://github.com/phospho-app/ai-chat-bubble","commit_stats":null,"previous_names":["phospho-app/ai-bubble-chat"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fai-chat-bubble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fai-chat-bubble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fai-chat-bubble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fai-chat-bubble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phospho-app","download_url":"https://codeload.github.com/phospho-app/ai-chat-bubble/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249154904,"owners_count":21221496,"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":["chatbot","genai","llm","rag"],"created_at":"2024-11-22T13:14:57.396Z","updated_at":"2025-04-15T21:22:47.123Z","avatar_url":"https://github.com/phospho-app.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI chat bubble - custom AI assistant connected to your knowledge\n\n**Simple and fast AI chat bubble for your HTML website.** The AI assistant can answer questions about a website's content using RAG, streaming, and the Mistral model. Compatible with **React** and **Wordpress**!\n\n**How does it work ?**\n\n1. Run the backend to create an assistant with knowledge about your website's content\n2. Add a code snippet to your HTML frontend\n3. Your users can now chat with an assistant in an AI chat bubble!\n\n**Production-ready**\n\nYou can host the AI chat bubble on your own machine with a simple `docker-compose up --build`.\nSee what users are asking thanks to [phospho analytics](https://phospho.ai) already integrated.\n\n![ai chat bubble](https://github.com/user-attachments/assets/32a5172a-017e-41ac-a59b-c9940e541380)\n\n## Quickstart\n\n### 1. Setup .env\n\nClone this repository.\n\n```bash\n# clone using the web url\ngit clone https://github.com/phospho-app/ai-chat-bubble.git\n```\n\nThen, create a `.env` file at the root with this content:\n\n```bash\nURL=https://www.example.com # Your assistant will know everything about this URL\n\n# To add:\nMISTRAL_API_KEY=...\nPHOSPHO_API_KEY=...\nPHOSPHO_PROJECT_ID=...\n```\n\nIn `URL`, put the website with the relevant content you want the AI assistant to know about.\nThe assistant will crawl domains with a depth of 3 (this is customizable).\n\n#### External services\n\n- **LLM:** We use the Mistral AI model - _mistral-large-latest_. Get your `MISTRAL_API_KEY` [here](https://mistral.ai).\n- **Analytics:** Messages are logged to phospho. Get your `PHOSPHO_API_KEY` and your `PHOSPHO_PROJECT_ID` [here](https://platform.phospho.ai).\n\n### 2. Run the assistant backend\n\nTo deploy the backend of the AI chat bubble, this repository uses [docker compose](https://docs.docker.com/compose/). [Follow this guide to install docker compose](https://docs.docker.com/compose/install/), then run the assistant's backend:\n\n```bash\ncd ai-chat-bubble # the name of the clone repo\ndocker-compose up --build\n```\n\nQuestions are sent to the assistant using the POST API endpoint `/question_on_url`. This returns a streamable response. Go to [localhost:8080/docs](localhost:8080/docs) for more details.\n\n### 3. Add the chat bubble to your website\n\nAdd the chat bubble to your website with this snippet in a HTML component:\n\n```html\n\u003cscript src=\"http://localhost:8080/component/chat-bubble.js\" async\u003e\u003c/script\u003e\n```\n\nIf you just wan to test your assistant, you simply need to open the `demo.html` file in your browser.\n\nLook into advanced configuration to change its style.\n\n## Advanced configuration\n\n### Change the chat bubble UI\n\nThe file `component/chat-bubble.js` contains the AI chat bubble style. It is served as a static file and is the compiled version of `interface/chat-bubble.js`.\n\nTo change the AI chat bubble, edit the `interface/chat-bubble.js` and then run `npx webpack` in the folder _app_ of the repo.\n\n### CORS policy\n\nIn production, it's best to setup a restrictive CORS policy to allow only your frontend to call your AI assistant backend. To do this, add an `ORIGINS` list in your `.env`.\n\n```\nORIGINS = [\"http://localhost:3000\", \"http://localhost:3001\"]\n```\n\n_Only urls in `ORIGINS` can access the `/question_on_url` endpoint._\n\n### Edit ports\n\nThe docker runs the main app on port _8080_. To change it, add a `SERVER_URL` field in your `.env`.\n\n```\nSERVER_URL=your_new_port\n```\n\nThen change the source of the interface script: `\u003cscript src=\"your_new_port/component/chat-bubble.js\" async /\u003e`\n\n### Prompts, AI, vector databases\n\nThe AI assistant of the AI chat bubble uses [Llama Index](https://docs.llamaindex.ai/en/stable/), [Qdrant](https://qdrant.tech/documentation/), and [Mistral](https://docs.mistral.ai). This behaviour is implemented in `models.py`.\n\n- Edit `ChatMistral` to change the prompts or models\n- Edit the `EmbeddingsVS` client to use another Vector store than Qdrant\n\n## About\n\nMade by juniors for juniors in PARIS - phospho team 🥖🇫🇷\n\nSpecial thanks to @flamschou, @fred3105, and @oulianov 🧪💚\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphospho-app%2Fai-chat-bubble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphospho-app%2Fai-chat-bubble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphospho-app%2Fai-chat-bubble/lists"}