dodeeric / langchain-ai-assistant-with-hybrid-rag

See here https://github.com/dodeeric/ragai-agent the agentic (agent) version of this assistant.
https://github.com/dodeeric/ragai-agent
GNU General Public License v3.0
12 stars 3 forks source link

add graphRAG as retreiver --> créer une nouvelle branche ou un nouveau repo (keyword/semantic/graph retrievers use neo4j db) #122

Open dodeeric opened 1 month ago

dodeeric commented 1 month ago

from langchain.retrieval import GraphRAG

https://console.neo4j.io/?iss=https%3A%2F%2Flogin.neo4j.com%2F&product=aura-db&tenant=d001e576-b02e-4cd1-b8c7-504358d4daa7#databases

The GraphRAG Manifesto: Adding Knowledge to GenAI https://neo4j.com/blog/graphrag-manifesto/

dodeeric commented 1 month ago

import networkx as nx from langchain.llms import OpenAI from langchain.retrievers import GraphRetriever from langchain.chains import RetrievalQA

dodeeric commented 1 month ago

How to install the Neo4j graph database on Ubuntu Server 22.04 https://www.techrepublic.com/article/how-to-install-neo4j-ubuntu-server/

Constructing knowledge graphs https://python.langchain.com/v0.1/docs/use_cases/graph/constructing/

Enhancing RAG-based application accuracy by constructing and leveraging knowledge graphs https://blog.langchain.dev/enhancing-rag-based-applications-accuracy-by-constructing-and-leveraging-knowledge-graphs/

The diagram illustrates a retrieval process beginning with a user posing a question, which is then directed to an RAG retriever. This retriever employs keyword and vector searches to search through unstructured text data and combines it with the information it collects from the knowledge graph. Since Neo4j features both keyword and vector indexes, you can implement all three retrieval options with a single database system. The collected data from these sources is fed into an LLM to generate and deliver the final answer.