From cf62eb51b00f15a1acbc81c547a546eb812ab693 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Tue, 10 Mar 2026 10:43:38 +0200 Subject: [PATCH 1/3] Add API documentation for graph retrieval, query, and commit history endpoints Migrated from FalkorDB/code-graph-backend PR #96. Original issue: FalkorDB/code-graph-backend#83 Resolves #534 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 533b32e3..8e1f698a 100644 --- a/README.md +++ b/README.md @@ -246,4 +246,41 @@ A C analyzer exists in the source tree, but it is commented out and is not curre This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database + +## 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: ${SECRET_TOKEN}" +``` + +Example: +```bash +curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: ${SECRET_TOKEN}" +``` + +### 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: ${SECRET_TOKEN}" +``` + +### History change + +List all commits: +```bash +curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": ""}' -H "Authorization: ${SECRET_TOKEN}" +``` + +Switch 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: ${SECRET_TOKEN}" +``` + Copyright FalkorDB Ltd. 2025 From 625f87ddeb1d58aef18e21c63a055ffc025a34fc Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Sat, 21 Mar 2026 23:26:42 +0200 Subject: [PATCH 2/3] =?UTF-8?q?fix(docs):=20address=20review=20=E2=80=94?= =?UTF-8?q?=20add=20/api=20prefix,=20fix=20auth=20header,=20clean=20up=20R?= =?UTF-8?q?EADME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add /api prefix to all curl URLs (graph_entities, chat, list_commits, switch_commit) - Standardize auth header to Bearer format - Rename 'History change' section to 'Commit history' - Remove SEO keywords line Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8e1f698a..389ccda3 100644 --- a/README.md +++ b/README.md @@ -246,8 +246,6 @@ A C analyzer exists in the source tree, but it is commented out and is not curre This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. -Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database - ## API Reference ### Retrieve a graph @@ -255,12 +253,12 @@ Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Da Fetch graph entities from a repository: ```bash -curl -X GET "http://127.0.0.1:5000/graph_entities?repo=" -H "Authorization: ${SECRET_TOKEN}" +curl -X GET "http://127.0.0.1:5000/api/graph_entities?repo=" -H "Authorization: Bearer ${SECRET_TOKEN}" ``` Example: ```bash -curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: ${SECRET_TOKEN}" +curl -X GET "http://127.0.0.1:5000/api/graph_entities?repo=GraphRAG-SDK" -H "Authorization: Bearer ${SECRET_TOKEN}" ``` ### Send Query @@ -268,19 +266,19 @@ curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authori 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: ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/chat -H "Content-Type: application/json" -d '{"repo": "", "msg": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" ``` -### History change +### Commit history List all commits: ```bash -curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": ""}' -H "Authorization: ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/list_commits -H "Content-Type: application/json" -d '{"repo": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" ``` Switch 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: ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/switch_commit -H "Content-Type: application/json" -d '{"repo": "", "commit": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" ``` Copyright FalkorDB Ltd. 2025 From d4cb1040d3b4e5b851eb472dde42d28294beb178 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Sat, 21 Mar 2026 23:58:58 +0200 Subject: [PATCH 3/3] fix(docs): merge duplicate API sections, standardize auth format - Remove duplicate 'API Reference' section, merge curl examples into 'API Endpoints' as 'Usage examples' subsection - Standardize auth header to Bearer placeholder - Move License section to end of file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 389ccda3..bbc7bae7 100644 --- a/README.md +++ b/README.md @@ -242,43 +242,40 @@ A C analyzer exists in the source tree, but it is commented out and is not curre | POST | `/api/analyze_repo` | Clone and analyze a git repository | | POST | `/api/switch_commit` | Switch the indexed repository to a specific commit | -## License - -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. - -## API Reference - -### Retrieve a graph - -Fetch graph entities from a repository: +### Usage examples +Fetch graph entities: ```bash -curl -X GET "http://127.0.0.1:5000/api/graph_entities?repo=" -H "Authorization: Bearer ${SECRET_TOKEN}" +curl -X GET "http://127.0.0.1:5000/api/graph_entities?repo=" \ + -H "Authorization: Bearer " ``` -Example: -```bash -curl -X GET "http://127.0.0.1:5000/api/graph_entities?repo=GraphRAG-SDK" -H "Authorization: Bearer ${SECRET_TOKEN}" -``` - -### Send Query - Query your code graph using natural language: - ```bash -curl -X POST http://127.0.0.1:5000/api/chat -H "Content-Type: application/json" -d '{"repo": "", "msg": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/chat \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer " \ + -d '{"repo": "", "msg": ""}' ``` -### Commit history - List all commits: ```bash -curl -X POST http://127.0.0.1:5000/api/list_commits -H "Content-Type: application/json" -d '{"repo": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/list_commits \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer " \ + -d '{"repo": ""}' ``` Switch to a specific commit: ```bash -curl -X POST http://127.0.0.1:5000/api/switch_commit -H "Content-Type: application/json" -d '{"repo": "", "commit": ""}' -H "Authorization: Bearer ${SECRET_TOKEN}" +curl -X POST http://127.0.0.1:5000/api/switch_commit \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer " \ + -d '{"repo": "", "commit": ""}' ``` +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + Copyright FalkorDB Ltd. 2025