diff --git a/apps/codexgraph_agent/README.md b/apps/codexgraph_agent/README.md index db9eecba..68faf84f 100644 --- a/apps/codexgraph_agent/README.md +++ b/apps/codexgraph_agent/README.md @@ -1,10 +1,21 @@ # 🌟✨ CodexGraph 🌟✨ + +

+ framework +

- image-20240719171906628 + ArXiv Paper +        + Webpage

+ + + ## πŸ“˜ Introduction -**CodexGraph Agent** is an advanced multi-tasking agent that integrates a language model (LM) agent with a code graph database interface. By utilizing the structural characteristics of graph databases and the versatility of the Cypher query language, CodexGraph enables the LM agent to formulate and execute multi-step queries. This capability allows for precise context retrieval and code navigation that is aware of the code's structure. +**CodexGraph** is an advanced multi-tasking agent that integrates a language model (LM) agent with a code graph database interface. By utilizing the structural characteristics of graph databases and the versatility of the Cypher query language, CodexGraph enables the LM agent to formulate and execute multi-step queries. This capability allows for precise context retrieval and code navigation that is aware of the code's structure. + + ## πŸš€ How to Use @@ -55,16 +66,71 @@ python apps\codexgraph_agent\run.py ``` ## πŸ“‚ Example Usage -### πŸ“‘ code summary: -TBD +### πŸ“‘ code chat: +**Code Chat** allows users to inquire about a code repository, providing insights into code structure and function usage. This functionality is particularly useful for understanding complex codebases, identifying dependencies, and exploring the usage of specific classes, methods, and functions. + +Here is an example of **Code Chat**. The user's question is: "Summarize the `CodexGraphAgentChat` class, what methods it has, and what they are for." + +code chat + +Once the necessary information is gathered, **Code Chat** constructs a comprehensive response to the user’s question. This response includes a summary of the `CodexGraphAgentChat` class, a list of its methods, and a description of what each method does. + ### πŸ” code debug: -TBD + +The **Code Debugger** diagnoses and resolves bugs by applying iterative reasoning and information retrieval to suggest targeted fixes. It utilizes Cypher queries to analyze the code repository, identify the cause of the issue, and recommend precise modifications. + +Here is an example of **Code Debugger**. The user’s input is a real issue where the outcome does not match the expected behavior. The **Code Debugger** first analyzes the problem, then uses Cypher queries to retrieve relevant information and infer the cause of the bug. Finally, it provides an explanation of the bug and suggests the location for the modification. + +code debug + +Identifying the precise location of the bug in the codebase and providing a detailed explanation of the issue and the underlying cause of the bug. + +![code_debug_7](img/README/code_debug_7.png) + +![code_debug_8](img/README/code_debug_8.png) + +Finally, **Code Debugger** will suggest modifications to ensure the bug is resolved. + +![code_debug_9](img/README/code_debug_9.png) + + + + + ### πŸ“‘ code add comment: -TBD +The **Code Commentor** analyzes code to provide detailed comments, enhancing code readability and maintainability. It leverages the code graph database to understand the code’s structure and behavior, ensuring accurate and informative comments. + +![code_commentor1](img/README/code_commentor1.png) + +By using Cypher queries, the specific implementation of the return function was obtained, and the return type was clarified. + +![code_commentor2](img/README/code_commentor2.png) + + + ### πŸ“‘ code generate: -TBD + +The user has requested a function to retrieve the number of input and output tokens of `CypherAgent`. However, the challenge is identifying the corresponding fields within `CypherAgent` as this information is not provided in the user’s input. + +![code_gen0](img/README/code_gen0.png) + +First, **Code Generator** will consider the thought process in determining how to identify the relevant fields. Then, by using Cypher queries, it was discovered that the corresponding fields are `input_token_num` and `output_token_num`, which enables the generation of the correct code. + +![code_gen1](img/README/code_gen1.png) + + + ### πŸ“‘ code add unit-test: -TBD + + + +Here is an example of **Code Unittestor**. The user’s input is: "Generate test cases for `TaskManager`." The **Code Unittestor** will first retrieve all methods and inheritance relationships in `TaskManager`, and then generate detailed test case code. + + + +**Code Unittestor** will generate detailed unit test code for the `TaskManager` class, covering its methods and inheritance relationships. + +![code_unittester](img/README/code_unittester.png) ## Future work 1. Streaming output the llm output diff --git a/apps/codexgraph_agent/img/README/code_chat2.png b/apps/codexgraph_agent/img/README/code_chat2.png new file mode 100644 index 00000000..cc050ddb Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_chat2.png differ diff --git a/apps/codexgraph_agent/img/README/code_commentor1.png b/apps/codexgraph_agent/img/README/code_commentor1.png new file mode 100644 index 00000000..dd41cba9 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_commentor1.png differ diff --git a/apps/codexgraph_agent/img/README/code_commentor2.png b/apps/codexgraph_agent/img/README/code_commentor2.png new file mode 100644 index 00000000..fb415eb2 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_commentor2.png differ diff --git a/apps/codexgraph_agent/img/README/code_debug_0.png b/apps/codexgraph_agent/img/README/code_debug_0.png new file mode 100644 index 00000000..823d525c Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_debug_0.png differ diff --git a/apps/codexgraph_agent/img/README/code_debug_7.png b/apps/codexgraph_agent/img/README/code_debug_7.png new file mode 100644 index 00000000..0ba7e711 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_debug_7.png differ diff --git a/apps/codexgraph_agent/img/README/code_debug_8.png b/apps/codexgraph_agent/img/README/code_debug_8.png new file mode 100644 index 00000000..2f26d066 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_debug_8.png differ diff --git a/apps/codexgraph_agent/img/README/code_debug_9.png b/apps/codexgraph_agent/img/README/code_debug_9.png new file mode 100644 index 00000000..b9644b9f Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_debug_9.png differ diff --git a/apps/codexgraph_agent/img/README/code_gen0.png b/apps/codexgraph_agent/img/README/code_gen0.png new file mode 100644 index 00000000..b7ae5f65 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_gen0.png differ diff --git a/apps/codexgraph_agent/img/README/code_gen1.png b/apps/codexgraph_agent/img/README/code_gen1.png new file mode 100644 index 00000000..ae12d8fc Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_gen1.png differ diff --git a/apps/codexgraph_agent/img/README/code_unittester.png b/apps/codexgraph_agent/img/README/code_unittester.png new file mode 100644 index 00000000..5d2b0bc9 Binary files /dev/null and b/apps/codexgraph_agent/img/README/code_unittester.png differ diff --git a/apps/codexgraph_agent/img/framework.png b/apps/codexgraph_agent/img/framework.png new file mode 100644 index 00000000..fa2193fa Binary files /dev/null and b/apps/codexgraph_agent/img/framework.png differ