# Agent Readiness

This page tracks how close Data Quality Agent is to a mature LLM agent. It is intentionally conservative: implemented capabilities are separated from partial and planned work.

## Implemented

| Capability | Evidence |
| --- | --- |
| LLM chooses among data-quality tools | `app/tool_agent.py` exposes `get_dataset_contract`, `profile_dataset`, `select_quality_strategy`, `run_quality_checks`, and `build_quality_report` as tool-calling functions. |
| Tool results feed back into a multi-step agent loop | `LLMDataQualityAgent.run` appends tool results back into model messages and continues for up to six rounds. |
| Real business data entrypoints | `/business-data/agent-report` accepts bounded CSV exports and `/postgres/support-tickets/agent-report` uses a read-only PostgreSQL adapter. |
| OpenAPI contract artifact | `docs/openapi.json` is generated from FastAPI and verified for core business-data, agent, trace, memory, and incident endpoints. |
| Deterministic report guardrails | `ReportVerifier` validates evidence support, known field references, sensitive evidence, unsupported LLM evidence, recommended actions, and score bounds. |
| Persistent trace audit trail | `TRACE_DB_PATH` enables SQLite persistence for sanitized run traces, allowing `/runs/{trace_id}` records to be recovered after process restart. |
| Dataset memory retrieval | `/datasets/{dataset_id}/memory` retrieves recent sanitized traces, recurring checks, and recurring root-cause titles for a dataset. |
| Incident-pattern memory | `docs/incident-pattern-memory.json` verifies recurring incident-pattern retrieval from sanitized support-ticket traces. |
| Memory-informed planning | `retrieve_dataset_memory` lets the LLM agent inspect sanitized prior traces and recurring checks inside the tool-calling loop before continuing its plan. |
| Source-cited business-rule retrieval | `retrieve_business_rules` lets the LLM agent retrieve relevant business rules with source citations after quality checks. |
| Agent observability artifact | `docs/agent-observability.json` summarizes trace ids, report types, fallback status, verification status, dataset memory, incident-pattern memory, and tool-call previews. |
| Agent safety boundaries | `docs/agent-safety-boundaries.json` verifies tool allowlists, read-only PostgreSQL query limits, sensitive-field redaction, disabled fallback, and report verifier rules. |
| Evidence-ranked root-cause hypotheses | `QualityReport.root_cause_hypotheses` ranks likely causes by confidence and attaches supporting checks, evidence, and recommended actions. |
| Hypothesis feedback labels | `docs/hypothesis-feedback.json` records accepted and needs-review labels for generated root-cause hypotheses. |
| Safe fallback | When `OPENAI_API_KEY` is not configured, the agent returns a structured `DISABLED` state instead of failing the API. |
| Public evidence | `docs/outcome-evidence.json`, `docs/resume-evidence.md`, and Public Evidence Health verify resume-safe claims. |

## Partial

| Capability | Current state | Next step |
| --- | --- | --- |
| Memory | The LLM agent can retrieve sanitized trace memory during planning. | Use accepted or needs-review hypothesis labels to tune future root-cause ranking. |
| RAG | Source-cited business-rule retrieval is available inside the LLM tool loop for local Markdown rules. | Add optional embedding-backed retrieval with permission filtering for larger policy and incident documents. |
| Observability | Sanitized trace summaries, tool-call previews, and a generated run observability artifact are available. | Track prompt version, model version, token use, latency breakdown, retries, and estimated cost. |
| Evaluation | Tests cover fallback, tool use, evidence support, and public artifacts. | Add a larger labeled eval set for tool-choice accuracy, finding recall, false positives, and cost. |

## Planned

- Use accepted hypothesis labels to adjust incident-pattern ranking.
- Add a human approval boundary before exporting remediation SQL or ticket actions.
- Add issue-pattern memory retrieval that reuses accepted or needs-review root-cause labels.

## Not Claimed

- External users
- Customer feedback
- Enterprise production deployment
- Paid model benchmark results

## Resume-Safe Wording

- Built an LLM tool-calling data-quality agent with dynamic tool selection, memory-informed planning, source-cited business-rule retrieval, read-only PostgreSQL analysis, CI-verified OpenAPI contract, dataset memory retrieval, incident-pattern memory, run observability artifacts, safety-boundary evidence, persistent SQLite trace audit logging, evidence-ranked root-cause hypotheses, human-reviewed hypothesis feedback labels, structured report guardrails, and safe model-key fallback.
- Published an agent-readiness checklist that separates implemented LLM agent capabilities from partial embedding-backed RAG, observability, evaluation, and feedback-informed memory work.
