{"id":20405543,"url":"https://github.com/astrabert/qdrant-ai-chat","last_synced_at":"2026-05-26T23:04:04.843Z","repository":{"id":242943540,"uuid":"811006304","full_name":"AstraBert/qdrant-ai-chat","owner":"AstraBert","description":"Build amazing AI and RAG-powered applications, plain and simple🪂","archived":false,"fork":false,"pushed_at":"2024-06-05T20:28:36.000Z","size":390,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-25T15:12:47.834Z","etag":null,"topics":["ai","api","awesome-ai","awesome-app","chatbot","cloud","gradio-python-llm","llm","open-source","qdrant-vector-database"],"latest_commit_sha":null,"homepage":"https://astrabert.github.io/qdrant-ai-chat/","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/AstraBert.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-06-05T19:03:16.000Z","updated_at":"2024-06-05T20:28:39.000Z","dependencies_parsed_at":"2024-06-12T01:09:06.751Z","dependency_job_id":null,"html_url":"https://github.com/AstraBert/qdrant-ai-chat","commit_stats":null,"previous_names":["astrabert/qdrant-ai-chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AstraBert/qdrant-ai-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fqdrant-ai-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fqdrant-ai-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fqdrant-ai-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fqdrant-ai-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstraBert","download_url":"https://codeload.github.com/AstraBert/qdrant-ai-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fqdrant-ai-chat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33542350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","api","awesome-ai","awesome-app","chatbot","cloud","gradio-python-llm","llm","open-source","qdrant-vector-database"],"created_at":"2024-11-15T05:11:53.064Z","updated_at":"2026-05-26T23:04:04.829Z","avatar_url":"https://github.com/AstraBert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qdrant-AI-Chat\n\n## Your RAG-based assistant, quick and easy\n\nIn this repository lies the [code](./app.py) to build a RAG-based assistant, exploiting Qdrant and Hugging Face Spaces API.\n\n\u003cdiv align=\"center\"\u003e\n\t\u003ca href=\"https://huggingface.co/spaces/as-cle-bert/tcfd_counselor\"\u003e\u003cimg src=\"./imgs/consulting_robot.jpg\"\u003e\u003c/a\u003e\t\n\t\u003cp\u003e\u003ci\u003eImage by \u003ca href=\"https://pollinations.ai/\"\u003ePollinations AI\u003c/a\u003e\u003c/i\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n## 0. Choose your objective\n\nThe first thing to start building is to actually _know_ what you are going to build. In this repository, we will be using [climatebert's TCFD recommendations dataset](https://huggingface.co/datasets/climatebert/tcfd_recommendations), in order to create a climate financial disclosure counselor that will be able to guide us in the wonders and dangers of climate investments and safety.\n\n## 1. Find a database\n\nTo implement RAG (*Retrieval-Augmented Generation*), we need to first find a database provider that will host our knowledge base.\n\nA possible solution, simple, elegant and fast, which offers up to 1GB of disk space in its free tier, is [Qdrant](https://qdrant.tech).\n\nSo you have to:\n\n1. [Register](https://qdrant.tech/pricing/) to Qdrant Cloud services\n2. Create your first cluster\n3. Retrieve the API key and the URL of the endpoint for your cluster\n\n## 2. Upload your data\n\nThere are various ways to upload your data, one can be found in [this Gist I created for the purpose](https://gist.github.com/AstraBert/ff4bff338d4346718ae6c2d77ea2d71f), where I load data from the above mentioned HF dataset and, exploiting [Jina AI's jina-embeddings-v2-base-en encoder](https://huggingface.co/jinaai/jina-embeddings-v2-base-en), I encode them into 768-dimensional vectors, that are sent to my Qdrant cluster along with the actual Natural Language text.\n\nThe so-created database is then available for vector search, you just need to have the same encoder [loaded in your script](./load_encoder.py) and to define some searching functions (I created a class, `NeuralSearcher`, in [utils.py](./utils.py)).\n\n## 3. Build the application\nPrior to building the application, consider downloading all the needed dependencies with:\n\n```bash\npython3 -m pip install requirements.txt\n```\n\nWe build the application exploiting [Gradio](https://gradio.app), a popular front-end rendering library for python and JS. \n\nAll the code can be found in [app.py](./app.py).\n\nFirst of all, we save all our crucial but sensitive variables in a `.env` file (an example can be found [here](./.env.example)).\n\nWith Gradio, we create a simple ChatBot interface, where the conversation will be displayed. \n\nPrior to that, we define a `reply` function that, taking the message from the user, feeds it first to our retriever (`NeuralSearcher`, in my case), in order to get out from our knowledge base in Qdrant some valuable contextual information. After that, the retrieved context gets inserted in the prompt that will be submittend to our LLM, alongside with some instructions (optional) and the user's query.\n\nThe LLM we are exploiting is Phi-3-mini-128K, queried via HF Spaces API offered by [this Space](https://huggingface.co/spaces/eswardivi/Phi-3-mini-128k-instruct).\n\nEverything is then smoothly rendered with a custom front-end theme, that you can find [here](https://huggingface.co/spaces/JohnSmith9982/small_and_pretty).\n\n## Wanna see a demo?\n\nChat with my space here:\n\n\u003cdiv align=\"center\"\u003e\n\t\u003ciframe\n\t\tsrc=\"https://as-cle-bert-tcfd-counselor.hf.space\"\n\t\tframeborder=\"0\"\n\t\twidth=\"850\"\n\t\theight=\"450\"\n\t\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n\n## And now it's your turn! Ready to build amazing AI-powered apps?🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fqdrant-ai-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrabert%2Fqdrant-ai-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fqdrant-ai-chat/lists"}