From 4a5bc02dce49599cb22b570e6696cebd3bd787f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 08:14:16 +0000 Subject: [PATCH 1/3] Initial plan From 405d022797c5a90a72002f3734e82bfa6c063326 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 08:21:01 +0000 Subject: [PATCH 2/3] Add missing API documentation to README Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> --- README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/README.md b/README.md index 17c9c75..7197345 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,103 @@ For example: 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" ``` +## API Reference + +### Retrieve a graph + +Fetch graph entities from a repository: + +```bash +curl -X GET "http://127.0.0.1:5000/graph_entities?repo=" -H "Authorization: <.ENV_SECRET_TOKEN>" +``` + +For example: + +```bash +curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: OpenSesame" +``` + +Response: +```json +{ + "status": "success", + "entities": { + "nodes": [...], + "edges": [...] + } +} +``` + +### Send Query + +Query your code graph using natural language: + +```bash +curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "", "msg": ""}' -H "Authorization: <.ENV_SECRET_TOKEN>" +``` + +For example: + +```bash +curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK", "msg": "What are the main classes in this project?"}' -H "Authorization: OpenSesame" +``` + +Response: +```json +{ + "status": "success", + "response": "The main classes in this project are..." +} +``` + +### History change + +List all commits in a repository: + +```bash +curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": ""}' -H "Authorization: <.ENV_SECRET_TOKEN>" +``` + +For example: + +```bash +curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK"}' -H "Authorization: OpenSesame" +``` + +Response: +```json +{ + "status": "success", + "commits": [ + { + "hash": "abc123", + "date": 1234567890, + "author": "John Doe", + "message": "Initial commit" + } + ] +} +``` + +Switch repository to a specific commit: + +```bash +curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "", "commit": ""}' -H "Authorization: <.ENV_SECRET_TOKEN>" +``` + +For example: + +```bash +curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK", "commit": "abc123"}' -H "Authorization: OpenSesame" +``` + +Response: +```json +{ + "status": "success" +} +``` + ## Working with your graph Once the source code analysis completes your FalkorDB DB will be populated with From 9016602541f52be9c95e01d2d37134f2c0343b89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 16:02:57 +0000 Subject: [PATCH 3/3] Fix flake8 error: remove unnecessary global declaration Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> --- api/llm.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/llm.py b/api/llm.py index bd45a95..4ffaecc 100644 --- a/api/llm.py +++ b/api/llm.py @@ -235,8 +235,6 @@ def _define_ontology() -> Ontology: ontology = _define_ontology() def _create_kg_agent(repo_name: str): - global ontology - model_name = os.getenv('MODEL_NAME', 'gemini/gemini-2.0-flash') model = LiteModel(model_name)