This project was rebuilt as a focused agentic RAG assistant for Ab Initio graph failures.
You provide raw execution logs (like your g6t_policy_trans_src failure sample), and the agent:
- Parses graph metadata + failed record fields.
- Optionally retrieves the closest schema/process definition from a schema knowledge base.
- Produces a recommended SQL
UPDATEto reset process status and related fields so rerun is possible.
Your schema/rules live in YAML knowledge docs (schemas/*.yaml).
When table names, status columns, or rerun codes change, update YAML instead of code.
The agent uses RAG retrieval over those docs to pick the right target behavior.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython -m abinitio_sql_agent.cli \
--log-file sample.logpython -m abinitio_sql_agent.cli \
--schema schemas/example_schema.yaml \
--log-file sample.logpython -m abinitio_sql_agent.cli \
--log-data "Ab Initio Graph Execution Log ..."schemas:
- name: g6t_policy_trans_src_prod
table: G6T_POLICY_TRANS_STD
process_status_column: process_status_code
failed_value: FAILED
rerun_ready_value: READY_FOR_RERUN
id_columns: [trans_id, policy_id]
mutable_columns: [process_status_code, retry_count, error_message, updated_by]
notes: Main policy load schemaThe CLI prints:
- SQL update template
- bind parameters extracted from failed record fields
- retrieval reasoning + matched schema docs
In log-only mode (no --schema), the agent does not enforce fixed status checks from a schema doc. It lets the model infer a pragmatic update using table and failed-record fields extracted from the log.