How hkust-knowcomp/autoschemakg works
AutoSchemaKG constructs knowledge graphs from unstructured text, induces conceptual schemas, and supports graph hosting, retrieval-augmented multi-hop QA, and evaluation. Its main workflow extracts triples, converts and conceptualizes them into graph-ready data, then supports indexing and retrieval. The graph also preserves the documented quality, factuality, and general-task evaluation branches. Several internal links are grounded in the README and source index; unsampled implementation details are not inferred as direct calls.
Main entry points: triple_extraction.py Triple extractor · atlas_mutihopqa.py Multi-hop QA · hipporag.py HippoRAG retrieval · hipporag2.py HippoRAG2 retrieval
Components 23
KG Construction
- Processing config
atlas_rag/kg_construction/triple_config.py - Triple extractor
atlas_rag/kg_construction/triple_extraction.py - JSON to CSV
atlas_rag/kg_construction/utils/json_processing/json_to_csv.py - Concept generation
atlas_rag/kg_construction/concept_generation.py - Concept CSV
atlas_rag/kg_construction/concept_to_csv.py - GraphML conversion
atlas_rag/kg_construction/utils/csv_processing/csv_to_graphml.py
LLM Generation
- Extraction prompts
atlas_rag/llm_generator/prompt/triple_extraction_prompt.py - LLM generator
atlas_rag/llm_generator/llm_generator.py - Generation config
atlas_rag/llm_generator/generation_config.py - Schema validation
atlas_rag/llm_generator/format/validate_json_schema.py
Graph and Index
- Neo4j API
atlas_rag/kg_construction/neo4j/neo4j_api.py - Embedding models
atlas_rag/vectorstore/embedding_model.py - Graph index
atlas_rag/vectorstore/create_graph_index.py - Neo4j index
atlas_rag/vectorstore/create_neo4j_index.py
Retrieval and QA
- Retriever interface
atlas_rag/retriever/base.py - HippoRAG retrieval
atlas_rag/retriever/hipporag.py - HippoRAG2 retrieval
atlas_rag/retriever/hipporag2.py - ToG retrieval
atlas_rag/retriever/tog.py - Multi-hop QA
atlas_mutihopqa.py
Evaluation
- KG quality evaluation
EvaluateKGC - Factuality evaluation
EvaluateFactuality/eval.py - General task evaluation
EvaluateGeneralTask/lm-evaluation-harness/lm_eval/evaluator.py
Other components
- KG builder
Connections 27
- KG builder → Triple extractor: runs extraction
README.md - Processing config → Triple extractor: configures
README.md - Triple extractor → LLM generator: generates triples
atlas_rag/kg_construction/triple_extraction.py - Triple extractor → Extraction prompts: uses prompts
atlas_rag/kg_construction/triple_extraction.py - Triple extractor → Schema validation: validates output
atlas_rag/kg_construction/triple_extraction.py - LLM generator → Generation config: uses settings
atlas_rag/llm_generator/llm_generator.py - Triple extractor → JSON to CSV: converts triples
atlas_rag/kg_construction/triple_extraction.py - Triple extractor → Concept generation: starts conceptualization
atlas_rag/kg_construction/triple_extraction.py - Concept generation → Concept CSV: creates concept CSV
atlas_rag/kg_construction/concept_generation.py - Concept generation → GraphML conversion: converts graph data
atlas_rag/kg_construction/concept_generation.py - Triple extractor → GraphML conversion: exports graph
atlas_rag/kg_construction/triple_extraction.py - Triple extractor → Neo4j index: creates index
atlas_rag/kg_construction/triple_extraction.py - Graph index → Embedding models: embeds graph data
atlas_rag/vectorstore/create_graph_index.py - Neo4j index → Neo4j API: indexes in Neo4j
- Multi-hop QA → Graph index: loads graph index
atlas_mutihopqa.py - Multi-hop QA → HippoRAG retrieval: retrieves context
- Multi-hop QA → HippoRAG2 retrieval: retrieves context
- Multi-hop QA → ToG retrieval: supports ToG retrieval
- HippoRAG retrieval → Embedding models: encodes queries
atlas_rag/retriever/hipporag.py - HippoRAG2 retrieval → Embedding models: encodes queries
atlas_rag/retriever/hipporag2.py - HippoRAG retrieval → LLM generator: generates responses
atlas_rag/retriever/hipporag.py - HippoRAG2 retrieval → LLM generator: generates responses
atlas_rag/retriever/hipporag2.py - HippoRAG retrieval → Retriever interface: implements interface
atlas_rag/retriever/hipporag.py - HippoRAG2 retrieval → Retriever interface: implements interface
atlas_rag/retriever/hipporag2.py - KG builder → KG quality evaluation: evaluates graph
README.md - KG builder → Factuality evaluation: evaluates factuality
README.md - KG builder → General task evaluation: evaluates tasks
README.md