{"id":19320959,"url":"https://github.com/defanglabs/docs-chatbot","last_synced_at":"2026-07-05T01:30:24.153Z","repository":{"id":254476693,"uuid":"846629135","full_name":"DefangLabs/docs-chatbot","owner":"DefangLabs","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-07T18:44:41.000Z","size":166,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-15T10:11:28.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DefangLabs.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":"2024-08-23T16:00:21.000Z","updated_at":"2025-02-06T17:10:30.000Z","dependencies_parsed_at":"2025-01-02T19:30:18.129Z","dependency_job_id":"641e67eb-669b-4d6e-8b13-45b400118143","html_url":"https://github.com/DefangLabs/docs-chatbot","commit_stats":null,"previous_names":["defanglabs/docs-chatbot"],"tags_count":0,"template":false,"template_full_name":"DefangSamples/sample-RAG-chatbot-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdocs-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdocs-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdocs-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdocs-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DefangLabs","download_url":"https://codeload.github.com/DefangLabs/docs-chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240422304,"owners_count":19798729,"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-11-10T01:34:10.623Z","updated_at":"2026-07-05T01:30:24.051Z","avatar_url":"https://github.com/DefangLabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scikit RAG + OpenAI\n\nThis sample demonstrates how to deploy a Flask-based Retrieval-Augmented Generation (RAG) chatbot using OpenAI's GPT model. The chatbot retrieves relevant documents from a knowledge base using scikit-learn and Sentence Transformers and then generates responses using OpenAI's GPT model.\n\n## Prerequisites\n\n1. Download [Defang CLI](https://github.com/DefangLabs/defang)\n2. (Optional) If you are using [Defang BYOC](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) authenticated with your AWS account\n3. (Optional - for local development) [Docker CLI](https://docs.docker.com/engine/install/)\n\n## Deploying\n\n1. Open the terminal and type `defang login`\n2. Type `defang compose up` in the CLI.\n3. Your app will be running within a few minutes.\n\n## Local Development\n\n1. Clone the repository.\n2. Create a `.env` file in the root directory and set your OpenAI API key or add the OPENAI_API_KEY into your .zshrc or .bashrc file:\n3. Run the command `docker compose -f compose.dev.yaml up --build` to spin up a docker container for this RAG chatbot\n\n## Configuration\n\n- The knowledge base is the all the markdown files in the defang docs [website](https://docs.defang.io/docs/intro). The logic for parsing can be found in './app/get_knowledge_base.py'.\n- The file `get_knowledge_base.py` parses every webpage as specified into paragraphs and writes to `knowledge_base.json` for the RAG retrieval.\n- To obtain your own knowledge base, please feel free to implement your own parsing scheme.\n- for local development, please use the compose.dev.yaml file where as for production, please use the compose.yaml.\n\n---\n\nTitle: Scikit RAG + OpenAI\n\nDescription: An application demonstrating a GPT-4-based chatbot enhanced with a Retrieval-Augmented Generation (RAG) framework, leveraging scikit-learn for efficient contextual embeddings and dynamic knowledge retrieval.\n\nTags: Flask, Scikit, Python, RAG, OpenAI, GPT, Machine Learning\n\nLanguages: python\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefanglabs%2Fdocs-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefanglabs%2Fdocs-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefanglabs%2Fdocs-chatbot/lists"}