How mims-harvard/ark works
ARK is an agentic knowledge-graph retriever: a question is explored through model-selected global search and neighborhood traversal, then candidate entities are collected and returned. The repository also includes graph preprocessing, benchmark evaluation, and optional trajectory distillation and fine-tuned model serving. Runtime links are based on excerpts or the source index; broader capability links use README documentation where source details were not sampled.
Main entry points: graph.py Knowledge graph · main.py Experiment runner · graph_explorer.py Explorer agent · utils.py Model selection
Components 26
Adaptive retrieval
- Experiment runner
main.py - Explorer agent
src/agents/graph_explorer/graph_explorer.py - Global search
src/agents/graph_explorer/tools/search_in_graph.py - Neighborhood search
src/agents/graph_explorer/tools/search_in_neighborhood.py - Connection search
src/agents/graph_explorer/tools/find_connections.py - Answer selection
src/agents/graph_explorer/tools/add_to_answers.py - Finish exploration
src/agents/graph_explorer/tools/finish.py - Tool interface
src/agents/graph_explorer/tools/tool.py
Graph and search
- Knowledge graph
src/core/graph.py - Lexical index
src/core/index.py - Embedding index
src/core/embedding_index.py - Graph entities
src/core/node.py
Language models
- Model selection
utils.py - LiteLLM model
src/models/LiteLLMModel.py - Qwen model
src/models/QwenModel.py - Transformers model
src/models/TransformersModel.py - Fine-tuned Qwen
src/models/FineTunedQwenModel.py - VLLM Qwen
src/models/VLLMQwenModel.py
Benchmark data
- Graph preprocessing
preprocessing/summary_utils.py - STaRK datasets
preprocessing - Result evaluation
eval.py
Distillation and serving
- Training trajectories
fine_tuning/utils.py - Policy fine-tuning
fine_tuning/graph_fine_tuning.py - Training configuration
fine_tuning/config.py - VLLM server
src/servers/VLLMServer.py
Other components
- Questioner
Connections 32
- Questioner → Experiment runner: submits query
README.md - Experiment runner → Explorer agent: starts agents
main.py - Experiment runner → Knowledge graph: loads graph
- Experiment runner → Model selection: loads model
utils.py - Explorer agent → Model selection: requests decisions
src/agents/graph_explorer/graph_explorer.py - Model selection → LiteLLM model: selects model
utils.py - Model selection → Qwen model: selects model
utils.py - Model selection → VLLM Qwen: selects model
utils.py - Model selection → Fine-tuned Qwen: selects model
utils.py - Explorer agent → Global search: dispatches tools
src/agents/graph_explorer/graph_explorer.py - Explorer agent → Neighborhood search: dispatches tools
src/agents/graph_explorer/graph_explorer.py - Explorer agent → Answer selection: dispatches tools
src/agents/graph_explorer/graph_explorer.py - Explorer agent → Finish exploration: dispatches tools
src/agents/graph_explorer/graph_explorer.py - Explorer agent → Tool interface: uses interface
src/agents/graph_explorer/graph_explorer.py - Global search → Knowledge graph: searches nodes
src/agents/graph_explorer/tools/search_in_graph.py - Neighborhood search → Knowledge graph: expands neighborhood
src/agents/graph_explorer/tools/search_in_neighborhood.py - Connection search → Knowledge graph: finds paths
src/agents/graph_explorer/tools/find_connections.py - Knowledge graph → Lexical index: uses lexical index
src/core/graph.py - Knowledge graph → Embedding index: uses embeddings
src/core/graph.py - Lexical index → Graph entities: returns entities
src/core/index.py - Knowledge graph → Graph entities: loads entities
src/core/graph.py - Answer selection → Knowledge graph: selects entities
src/agents/graph_explorer/graph_explorer.py - STaRK datasets → Graph preprocessing: converts data
README.md - Graph preprocessing → Knowledge graph: provides graph files
README.md - Experiment runner → STaRK datasets: runs benchmark queries
README.md - Experiment runner → Result evaluation: evaluates results
README.md - Experiment runner → Training trajectories: records trajectories
README.md - Training trajectories → Policy fine-tuning: trains policy
fine_tuning/graph_fine_tuning.py - Policy fine-tuning → Training configuration: reads settings
fine_tuning/graph_fine_tuning.py - Policy fine-tuning → Fine-tuned Qwen: produces adapter
README.md - VLLM server → VLLM Qwen: serves model
README.md - Fine-tuned Qwen → Experiment runner: supports retrieval
README.md