Skip to content

Commit 13a35b1

Browse files
authored
Merge branch 'main' into deps
2 parents 9076cbb + 46d4693 commit 13a35b1

File tree

7 files changed

+1872
-25
lines changed

7 files changed

+1872
-25
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FALKORDB_PORT=<port>
33
FALKORDB_USERNAME=<username>
44
FALKORDB_PASSWORD=<password>
55
OPENAI_API_KEY=<openai_api_key>
6-
GOOGLE_API_KEY=<google_api_key>
6+
GEMINI_API_KEY=<gemini_api_key>
77
SECRET_TOKEN=<secret_token>
88

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@
33
[![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.com/invite/6M4QwDXn2w)
44

55
## Getting Started
6+
67
[Live Demo](https://code-graph.falkordb.com/)
78

89
## Running locally
910

1011
### Run FalkorDB
12+
1113
Free cloud instance: https://app.falkordb.cloud/signup
1214

1315
Or by running locally with docker:
16+
1417
```bash
1518
docker run -p 6379:6379 -p 3000:3000 -it --rm falkordb/falkordb:latest
1619
```
1720

1821
### Config
22+
1923
Create your own `.env` file from the `.env.template` file
2024

2125
Start the server:
@@ -24,16 +28,21 @@ flask --app api/index.py run --debug
2428
```
2529

2630
### Creating a graph
31+
2732
Process a local source folder:
33+
2834
```bash
2935
curl -X POST http://127.0.0.1:5000/analyze_folder -H "Content-Type: application/json" -d '{"path": "<FULL_PATH_TO_FOLDER>", "ignore": [<OPTIONAL_IGNORE_LIST>]}' -H "Authorization: <.ENV_SECRET_TOKEN>"
3036
```
3137

3238
For example:
39+
3340
```bash
3441
curl -X POST http://127.0.0.1:5000/analyze_folder -H "Content-Type: application/json" -d '{"path": "/Users/roilipman/Dev/GraphRAG-SDK", "ignore": ["./.github", "./build"]}' -H "Authorization: OpenSesame"
3542
```
43+
3644
## Working with your graph
45+
3746
Once the source code analysis completes your FalkorDB DB will be populated with
3847
a graph representation of your source code, the graph name should be the same as
3948
the name of the folder you've requested to analyze, for the example above a graph named:
@@ -43,6 +52,8 @@ At the moment only the Python and C languages are supported, we do intend to sup
4352

4453
At this point you can explore and query your source code using various tools
4554
Here are several options:
46-
1. FalkorDB built-in UI
55+
56+
1. [Code-Graph UI](https://github.com/FalkorDB/code-graph)
57+
1. FalkorDB [Browser](https://github.com/FalkorDB/falkordb-browser/)
4758
2. One of FalkorDB's [clients](https://docs.falkordb.com/clients.html)
4859
3. Use FalkorDB [GraphRAG-SDK](https://github.com/FalkorDB/GraphRAG-SDK) to connect an LLM for natural language exploration.

api/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_repos() -> List[str]:
2828
password=os.getenv('FALKORDB_PASSWORD', None))
2929

3030
graphs = db.list_graphs()
31-
graphs = [g for g in graphs if not g.endswith('_git')]
31+
graphs = [g for g in graphs if not (g.endswith('_git') or g.endswith('_schema'))]
3232
return graphs
3333

3434
class Graph():

api/llm.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import logging
33

4-
from graphrag_sdk.models.openai import OpenAiGenerativeModel
4+
from graphrag_sdk.models.litellm import LiteModel
55
from graphrag_sdk import (
66
Ontology,
77
Entity,
@@ -12,7 +12,6 @@
1212
KnowledgeGraphModelConfig
1313
)
1414

15-
#from graphrag_sdk.models.gemini import GeminiGenerativeModel
1615
from .prompts import (CYPHER_GEN_SYSTEM,
1716
CYPHER_GEN_PROMPT,
1817
GRAPH_QA_SYSTEM,
@@ -199,15 +198,15 @@ def _define_ontology() -> Ontology:
199198
def _create_kg_agent(repo_name: str):
200199
global ontology
201200

202-
openapi_model = OpenAiGenerativeModel("gpt-4o")
203-
#gemini_model = GeminiGenerativeModel("gemini-1.5-flash-001")
204-
#gemini_model_pro = GeminiGenerativeModel("gemini-1.5-pro")
201+
model_name = os.getenv('MODEL_NAME', 'gemini/gemini-2.0-flash-exp')
202+
203+
model = LiteModel(model_name)
205204

206205
#ontology = _define_ontology()
207206
code_graph_kg = KnowledgeGraph(
208207
name=repo_name,
209208
ontology=ontology,
210-
model_config=KnowledgeGraphModelConfig.with_model(openapi_model),
209+
model_config=KnowledgeGraphModelConfig.with_model(model),
211210
host=os.getenv('FALKORDB_HOST', 'localhost'),
212211
port=os.getenv('FALKORDB_PORT', 6379),
213212
username=os.getenv('FALKORDB_USERNAME', None),

0 commit comments

Comments
 (0)