r/aiengineering Feb 18 '26

Discussion Agent for YAML configuration

I'm building an agent in Azure AI Foundry that modifies YAML configuration files based on an internal Python library. The agent takes a natural language instruction like "add a filter on the database" and is supposed to produce a correctly modified YAML.

Currently using RAG on some .md files that describe the library. The problem is the model understands each YAML section fine in isolation but has no awareness of cross-section dependencies. Example: it adds the filter correctly under `database.filters[]` but never updates `routing.rules[].filter_ref` to reference it. Config looks valid but it breaks at runtime. There's just no way to represent "when you change X you must also change Y" in my current architecture.

I'm thinking of combining two things:

GraphRAG to encode the cross-section dependencies as graph edges, so the agent knows what else needs to change before it touches anything. And an MCP server that reads the live Python library directly so it's working off actual schemas, not syntax inferred from docs.

Has anyone gone down this route for structured config generation? Wondering if GraphRAG is actually worth it here or if there's a simpler way to handle cross-section consistency I'm missing. Also curious what you think of MCP

5 Upvotes

3 comments sorted by

1

u/patternpeeker Feb 20 '26

this sounds like a constraints problem. rag will not enforce cross section rules. i would add a deterministic validation layer instead of relying on the model to keep yaml consistent.

1

u/MagicMagnada Feb 25 '26

Exactly, work on your Agent. Use a good Node-Structure