RAG Project with Ollama and LangChain via Gradio Interface
https://github.com/fanqingsong/rag-ollama-langchain
This repository hosts the implementation of a Retrieval-Augmented Generation (RAG) project leveraging the capabilities of Ollama to run open-source large language models (LLMs) locally, alongside LangChain for robust integration of language models with data retrieval functionalities. A Gradio interface is provided for easy and interactive user engagement.
Project Overview
Retrieval-Augmented Generation (RAG) combines the generative strengths of large language models with advanced information retrieval techniques to produce contextually rich and accurate outputs. This project showcases the power of RAG in various domains such as question answering, content creation, and data synthesis, by harnessing the latest in language modeling and retrieval technologies through Ollama and LangChain.
Features
Ollama Integration: Uses Ollama to locally run various open-source large language models, including Llama 2 and Code Llama, offering state-of-the-art language understanding and generation.
LangChain for Efficient Retrieval: Implements LangChain for effective retrieval of pertinent information from diverse data sources, enhancing the models' output with real-time data.
Interactive Gradio Interface: Provides a Gradio-based web interface for real-time user interaction, making it straightforward for both technical and non-technical users to input queries and receive responses.
Flexible Framework: Designed for easy extension across different use cases and data sets, facilitating broad applicability.
demo
使用 docker-compose up 运行3个services (rag application / ollama / ollama webui)
在ollama webui上下载 千问模型 qwen:0.5b
访问 rag application web 界面,
输入 url 和 问题
url 为 https://zhuanlan.zhihu.com/p/675924232
点击运行, 等待数分钟后, 右侧outputs给出响应。
https://api.python.langchain.com/en/latest/chains/langchain.chains.retrieval_qa.base.RetrievalQA.html#langchain.chains.retrieval_qa.base.RetrievalQA
https://api.python.langchain.com/en/stable/community_api_reference.html#module-langchain_community.embeddings
https://zhuanlan.zhihu.com/p/668082024
标签:RAG,via,language,Gradio,langchain,LangChain,Ollama From: https://www.cnblogs.com/lightsong/p/18196970