SAP Agent Context is a curated, link-first context layer for AI agents working with SAP functional design, field mapping, workflow, roles, scope items, and implementation support. It stores compact YAML context items, source pointers, freshness metadata, bundle quality gates, and deterministic evaluation fixtures for SAP S/4HANA Cloud Public Edition work.
The repository does not mirror SAP Help, SAP Notes, Learning Hub, SAP for Me, or customer content. It keeps reusable, agent-friendly metadata and cites external sources through access-labelled pointers.
- Canonical YAML knowledge items under
knowledge/**/*.yaml. - Canonical context layout documented in Context Structure.
- Rebuildable SQLite, JSONL, and vector-ready indexes under
build/. - Context bundle generation through the
sap-agent-contextCLI. - Completeness, evidence integrity, retrieval precision, and FO-output evaluation gates.
- Typed context bundle contract for downstream consumers such as McCoy FO Generator v2 and local AI agent workflows.
- Public/gated/internal source labels, review dates, and expiration dates to prevent stale, expired, or private evidence from becoming hidden assumptions.
Install uv and clone the repository:
git clone <repo-url>
cd sap-agent-context
uv syncFor local development without a remote, use the same commands from the repository root after checking out this folder.
Validate the context repository:
uv run sap-agent-context validate
uv run sap-agent-context audit-completeness
uv run sap-agent-context evaluate-fixturesBuild indexes:
uv run sap-agent-context build-indexGenerate a context bundle:
uv run sap-agent-context query \
--intent fo.workflow \
--topic "supplier-invoice workflow" \
--sap-product s4hana_cloud_public \
--limit 12 \
--output build/context-bundles/supplier-invoice-workflow.jsonCreate a McCoy local-folder provider manifest:
uv run sap-agent-context mccoy-provider \
build/context-bundles/supplier-invoice-workflow.json \
--title "SAP Agent Context bundle - supplier-invoice workflow" \
--output build/context-bundles/mccoy-provider.jsonFor local AI workflows, each colleague can clone the repository and register the generated bundle directory with their agent or source-provider layer:
git clone <repo-url> sap-agent-context
cd sap-agent-context
uv sync
uv run sap-agent-context query \
--intent fo.workflow \
--topic "supplier-invoice workflow" \
--sap-product s4hana_cloud_public \
--limit 12 \
--output build/context-bundles/supplier-invoice-workflow.jsonThe generated bundle includes producer.name: sap-agent-context and
producer.contract: sap-agent-context-bundle. The legacy
bundle_kind: sap_fo_context_bundle remains for backward-compatible consumers.
Representative no-gap queries:
uv run sap-agent-context query --intent fo.workflow --topic "supplier-invoice workflow" --sap-product s4hana_cloud_public --limit 12
uv run sap-agent-context query --intent fo.sap_configuration --topic "procurement purchase requisition workflow" --sap-product s4hana_cloud_public --limit 12
uv run sap-agent-context query --intent fo.field_mapping --topic "business partner master data" --sap-product s4hana_cloud_public --limit 12
uv run sap-agent-context query --intent fo.test_scenarios --topic "sales order output management" --sap-product s4hana_cloud_public --limit 12
uv run sap-agent-context query --intent fo.authorization --topic "integration communication role authorization api" --sap-product s4hana_cloud_public --limit 12The current product-grade scope is sap_fo_starter_coverage, defined in
schema/completeness-matrix.yaml.
It covers starter Functional Design knowledge for finance/AP, procurement,
sales, master data, migration, workflow, output management, authorizations,
integrations, extensibility, and analytics/reporting. The scope is intentionally
bounded: it is not exhaustive SAP product coverage. It is complete when
sap-agent-context audit-completeness reports zero critical and zero important
gaps.
Representative bundles are also checked against the Bundle Quality Contract, so completeness is not only item-count and knowledge-kind coverage.
Run the full local quality gate:
uv run sap-agent-context validate
uv run sap-agent-context audit-completeness
uv run sap-agent-context evaluate-fixtures
uv run pytest -q
uv run ruff check .The CI workflow runs the same core validation commands on pushes and pull requests.
mccoy-fo-generator-v2 can register generated bundle directories as local
source providers:
cd /path/to/mccoy-fo-generator-v2
uv run fo-gen-v2 register-source <workspace> <project-id> \
--type local-folder \
--title "SAP Agent Context bundle - supplier-invoice workflow" \
--path "/path/to/sap-agent-context/build/context-bundles" \
--provenance sap-agent-contextTyped consumers should use the Agent Consumer Contract. McCoy-specific local-folder registration remains an example integration path in McCoy FO Generator v2 Hook Contract.
This repository is designed for public release. It stores generic SAP context,
Functional Design patterns, field mapping context, and source pointers, not
customer-specific evidence. Do not add tenant exports, client screenshots, SAP
Notes content, credentials, .env files, private keys, personal data, or
proprietary customer material.
The supplier-invoice filenames are generic SAP process examples, not customer
or private invoice records. See docs/public-readiness.md for the current
publication checklist and privacy review notes.
Report security issues privately according to SECURITY.md.
This Python package is source-first. Public releases should be created as GitHub tags/releases after the quality gate passes.
Canonical public repository:
https://github.com/viggomeesters/sap-agent-context
Recommended GitHub metadata:
- Description:
Source-backed SAP context bundles for AI agents, functional design, and field mapping. - Topics:
sap,s4hana,ai-agents,functional-design,field-mapping,knowledge-base
MIT License. See LICENSE.