From f234233a0b2c518ad3e6afc83b260912bb2acd07 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Tue, 10 Mar 2026 10:43:38 +0200 Subject: [PATCH] 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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 742864c1..b0dfcf6a 100644 --- a/README.md +++ b/README.md @@ -214,3 +214,38 @@ Have questions or feedback? Reach out via: If you find this repository helpful, please consider giving it a star! 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: <.ENV_SECRET_TOKEN>" +``` + +Example: +```bash +curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: OpenSesame" +``` + +### 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>" +``` + +### 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: <.ENV_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: <.ENV_SECRET_TOKEN>" +```