Elffuss BraidHub

kikocis/GraphRAG-SDK public

Update README.md
Changeset13be18c47915c3aaf8bb45da34ac07316f8190154faca126485186ad1d255fc7
AuthorGuy Korland <gkorland@gmail.com> · 2024-09-17 14:26 +03:00
CommitterGitHub <noreply@github.com> · 2024-09-17 14:26 +03:00
Parents9151e40c40ed

Browse the files at this changeset

1 file changed

modified README.md +21 −4
@@ -1,8 +1,8 @@
11 # GraphRAG-SDK
2+
23 [![Try Free](https://img.shields.io/badge/Try%20Free-FalkorDB%20Cloud-FF8101?labelColor=FDE900&style=for-the-badge&link=https://app.falkordb.cloud)](https://app.falkordb.cloud)
34 [![Dockerhub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/)
45 [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/6M4QwDXn2w)
5-V2
66
77 GraphRAG-SDK is a comprehensive solution for building Graph Retrieval-Augmented Generation (GraphRAG) applications, leveraging [FalkorDB](https://www.falkordb.com/) for optimal performance.
88
@@ -24,6 +24,7 @@
2424 ### Prerequisites
2525
2626 #### Graph Database
27+
2728 GraphRAG-SDK relies on [FalkorDB](http://falkordb.com) as its graph engine and works with OpenAI/Gemini.
2829
2930 Use [FalkorDB Cloud](https://app.falkordb.cloud/) to get credentials or start FalkorDB locally:
@@ -31,7 +32,9 @@
3132 ```sh
3233 docker run -p 6379:6379 -p 3000:3000 -it --rm -v ./data:/data falkordb/falkordb:latest
3334 ```
35+
3436 #### LLM Models
37+
3538 Currently, this SDK supports the following LLMs API:
3639
3740 * [OpenAI](https://openai.com/index/openai-api) Recommended model:`gpt-4o`
@@ -45,15 +48,16 @@
4548 ```
4649 OPENAI_API_KEY="OPENAI_API_KEY"
4750 GOOGLE_API_KEY="GOOGLE_API_KEY"
48-
4951 ```
5052
5153 </details>
5254
5355 ## Basic Usage
56+
5457 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FalkorDB/GraphRAG-SDK/blob/main/examples/movies/demo-movies.ipynb)
5558
5659 The following example demonstrates the basic usage of this SDK to create a GraphRAG using URLs with auto-detected ontology.
60+
5761 ```python
5862 from dotenv import load_dotenv
5963
@@ -98,10 +102,13 @@
98102 print(chat.send_message("How this director connected to Keanu Reeves?"))
99103
100104 ```
105+
101106 ## Tools
107+
102108 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FalkorDB/GraphRAG-SDK/blob/main/examples/ufc/demo-ufc.ipynb)
103109
104110 ### Import source data
111+
105112 The SDK supports the following file formats:
106113
107114 * PDF
@@ -110,7 +117,7 @@
110117 * URL
111118 * HTML
112119 * CSV
113-V2
120+
114121 ```python
115122 import os
116123 from graphrag_sdk.classes.source import Source
@@ -122,7 +129,9 @@
122129 for file in os.listdir(src_files):
123130 sources.append(Source(os.path.join(src_files, file)))
124131 ```
132+
125133 ### Ontology
134+
126135 You can either auto-detect the ontology from your data or define it manually. Additionally, you can set `Boundaries` for ontology auto-detection.
127136
128137 Once the ontology is created, you can review, modify, and update it as needed before using it to build the Knowledge Graph (KG).
@@ -157,11 +166,13 @@
157166 with open("ontology.json", "w", encoding="utf-8") as file:
158167 file.write(json.dumps(ontology.to_json(), indent=2))
159168 ```
169+
160170 After generating the initial ontology, you can review it and make any necessary modifications to better fit your data and requirements. This might include refining entity types or adjusting relationships.
161171
162172 Once you are satisfied with the ontology, you can proceed to use it for creating and managing your Knowledge Graph (KG).
163173
164174 ### Knowledge Graph
175+
165176 Now, you can use the SDK to create a Knowledge Graph (KG) from your sources and ontology.
166177
167178 ```python
@@ -178,9 +189,11 @@
178189
179190 kg.process_sources(sources)
180191 ```
192+
181193 You can update the KG at any time by processing more sources with the `process_sources` method.
182194
183195 ### Graph RAG
196+
184197 At this point, you have a Knowledge Graph that can be queried using this SDK. You can use the `ask` method for single questions or `chat_session` for conversations.
185198
186199 ```python
@@ -197,10 +210,13 @@
197210 ```
198211
199212 ## Multi Agent - Orchestrator
213+
200214 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FalkorDB/GraphRAG-SDK/blob/main/examples/trip/demo_orchestrator_trip.ipynb)
201215
202216 The GraphRAG-SDK supports KG agents. Each agent is an expert in the data it has learned, and the orchestrator orchestrates the agents.
217+
203218 ### Agents
219+
204220 See the [Basic Usage](#basic-usage) section to understand how to create KG objects for the agents.
205221
206222 ```python
@@ -234,10 +250,10 @@
234250 kg=attractions_kg,
235251 introduction="I'm an attractions agent, specialized in finding the best tourist attractions for you.",
236252 )
237-
238253 ```
239254
240255 ### Orchestrator - Multi-Agent System
256+
241257 The orchestrator manages the usage of agents and handles questioning.
242258
243259 ```python
@@ -257,6 +273,7 @@
257273 ```
258274
259275 ## Support
276+
260277 Connect with our community for support and discussions. If you have any questions, don’t hesitate to contact us through one of the methods below:
261278
262279 * [Discord](https://discord.com/invite/6M4QwDXn2w)