How petergriffinjin/graph-cot works
Project type and purpose
• This is a research‐oriented, model‐centric codebase for “Graph Chain-of-Thought” (Graph-CoT), which augments large language models (LLMs) by letting them iteratively reason over graph-structured knowledge.
• It also provides baseline pipelines for off-the-shelf LLMs (in LLM/) and GPT models (in GPT/), plus data preprocessing (data/) and evaluation (eval.*).
File structure
• Top‐level folders:
• GPT/ – scripts & code to run GPT models (zero-shot, RAG).
• LLM/ – scripts & code to run open-source LLMs (zero-shot, RAG).
• Graph-CoT/ – core Graph-CoT framework: agent, prompts, tools, run script.
• data/ – raw and processed graph datasets plus notebooks for data prep.
• eval.* – evaluation harness integrating EM, BLEU, ROUGE, GPT-4.
• fig/ – static figures for README.
• Within Graph-CoT:
• code/GraphAgent.py – orchestrates reasoning-interaction-execution loop.
• code/graph_prompts.py, graph_fewshots.py – few-shot examples & prompt templates.
• code/tools/ – graph access functions (neighbor lookups, retriever).
• scripts/run_GraphCoT.sh – entrypoint for experiments.
• Presence of shell scripts in each module indicates a CLI-style invocation.
README for additional insights
• Graph-CoT is iterative: each iteration has
a) Reasoning by LLM → b) generate graph queries → c) execute queries on graph → repeat.
• Data flows from data/processed_data/{domain}/data.json into the retriever and agent.
Detail
• Sub-components: GraphAgent vs. graph_prompts vs. tool modules.
• Two variants under LLM Backend (GPT vs. open-source).
• Shell script entrypoints and environment setup (conda env, requirements.txt).