This repository contains a pipeline that uses an LLM agent to extract or refine knowledge graphs, validate them with SHACL, and store run artifacts.
- Create and activate a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt-
(Optional) Create a
.envfile at the repository root for any model credentials or environment variables the LLM adapter requires. The pipeline callsload_dotenv()on startup. -
Run the example pipeline (uses the example config by default):
python main.py
# or explicitly:
python main.py --config configs/example_run_config.yaml- To run in asynchronous (concurrent) mode, enable it in the YAML config:
# in configs/example_run_config.yaml or your chosen config
runtime:
async_mode: trueThen run the same python main.py command.
The main.py includes a convenience commented line that points to the full
run config. If you wish to run against your full dataset, either:
- point the CLI at
configs/run_config.yamlexplicitly:
python main.py --config configs/run_config.yaml- or uncomment the reserved line in
main.pythat references the full config (this line is left commented for convenience so casual runs use theexample_run_config.yaml). See main.py for the commented line.
- Run artifacts are written under
results/by default. Each run gets arun_dir(computed fromoutputsettings in the config). - Per-task artifacts (conversations, usage metadata, graphs) are stored under
each task's
artifacts/folder. Atrace.jsonlfile is also created in the run directory for tracing events. - Example run: an example run output is already provided under
results/example_run_with_shacl/.
- The main config model is
configs/run_config.yaml. See configs/run_config.py for the schema used by the loader. - Prompts live in
prompts/. Useprompts/main_user.mdandprompts/main_system.mdto customize agent behavior.
- SHACL validation is performed via
pyshacl; ensure it is available in your environment (it is included inrequirements.txtfor the repository). - If you use cloud LLMs, ensure any required API keys are set in your
environment or
.envfile before running.