# nice-coding-ai **Repository Path**: mmmm96_admin/nice-coding-ai ## Basic Information - **Project Name**: nice-coding-ai - **Description**: 分别基于LlamaIndex和LangChain结合Qdrant实现RAG(Retrieval-Augmented Generation,检索增强生成) - **Primary Language**: Python - **License**: GPL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-04-15 - **Last Updated**: 2025-04-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## How to config it ### Use poetry Installation Poetry: guide ### Create .venv ```bash python3.11 -m venv .venv ``` ### Start venv ```bash poetry shell ``` ### Exit ```bash deactivate ``` ### Install package ```bash poetry install ``` ### Config openai key ```bash export OPENAI_API_KEY="your_api_key_here" ``` ## What is langchain ![](assert/readme/q-and-a-flow.png) ## What is Llamaindex ![](assert/readme/llamaindex.png) ## Use Qdrant 进入docker目录 ```bash docker-compose up -d ``` Document: ![](assert/readme/qdrant.png) 粗略的理解成: - collection -> table - point -> row - payload -> column start with docker-compose - REST API: localhost:6333 - Web UI: - GRPC API: localhost:6334 ## Start up ```bash uvicorn src.main:app --reload --port 5000 ``` swagger: 如果要使用离线的llm,需要安装ollama以及模型 ```bash ollama run llama2-chinese:7b-chat-q2_K ``` rest接口分别对应LangChain、LlamaIndex录入Qdrant以及问答 ![](assert/readme/fastapi.png) LangChain: + /langchain-qdrant/openai-load-data (使用openai模型入qdrant) + /langchain-qdrant/huggingface-load-data (使用huggingface中的模型入qdrant) + /langchain/llm-openai/embedding-openai/ask-question (以openai模型做Embedding,使用openai llm问答) + /langchain/llm-openai/embedding-huggingface/ask-question (以huggingface模型做Embedding,使用openai llm问答) + /langchain/llm-ollama/embedding-huggingface/ask-question (以huggingface模型做Embedding,使用ollama llm问答) LlamaIndex: + /llamaindex-qdrant/openai-load-data (使用openai模型入qdrant) + /llamaindex-qdrant/huggingface-load-data (使用huggingface中的模型入qdrant) + /llamaindex/llm-openai/embedding-openai/ask-question (以openai模型做Embedding,使用openai llm问答) + /llamaindex/llm-openai/embedding-huggingface/ask-question (以huggingface模型做Embedding,使用openai llm问答) + /llamaindex/llm-ollama/embedding-huggingface/ask-question (以huggingface模型做Embedding,使用ollama llm问答) 欲知后事如何,可关注公众号保持联络😘​ ![](assert/readme/qrcode_for_nice_coding.jpg)