Kehrwoche AI Service

AI-powered LeanIX Kehrwoche Automation โ€” Pre-fills quarterly to-do answers, resolves sources automatically, and delivers one-click approval for Product Owners. Agent + Copilot for end-to-end IT portfolio governance.

Kehrwoche Automation RAG-Powered One-Click Approval Zero PO Setup EU-Compliant LeanIX-Native
70% Rules-Based (Auto)
30% LLM-Assisted
95%+ Auto-Resolved Sources
1 Click PO Approval
3 AI Components
6+ Integrations
57 Mandatory Fields
~75% Time Reduction
Data-Driven

Field Analysis โ€” What Can Be Automated?

57 mandatory fields classified into three automation tiers based on data source availability and confidence.

57 Fields
Tier 1 โ€” Fully Automatable
19 fields (33%)
Tier 2 โ€” AI-Assisted
17 fields (30%)
Tier 3 โ€” Human + AI Guidance
21 fields (37%)
Known external data source โ€” no human intervention needed. High-confidence, rule-based writes.
#ClusterFieldSourceStatus
1Business ArchitectureBusiness Capability & FunctionLeanIXMapped
2Portfolio StrategyTIME ClassificationLeanIXDerivable
3Portfolio StrategyUS Risk RelevantLeanIX + HostingRule-based
4Portfolio StrategyCloud NativityLeanIX + InfraRule-based
5โ€“11Security / Info ClassAvailability, Confidentiality, Integrity, Personal Data, Validity, Classification Date, Internet FacingArcher (AGP)Synced
12โ€“16Security / App ProtectionApp-Confidentiality, App-Integrity, App-AvailabilityArcher (AGP)Synced
17โ€“18Technology ArchitectureSoftware Acquisition Model, Source Code LocationGit / SCMDerivable
19Technology ArchitectureData CenterHosting MetadataDerivable
20โ€“22Identity / AccessApplication Registration, Client ID, Auth MethodIAMSynced
23โ€“25OrganisationApplication Owner, Technical Contact, User GroupsAliceSynced
26โ€“28Technology ArchitectureCloud Provider, Hosting Region, Account IDCloud AccountsSynced
AI suggests answers based on patterns, peer applications, and User Guide. Human confirms.
#ClusterFieldAI Approach
1InformationCategoryClassify from description + tags
2InformationApplication TypeInfer from deployment/usage patterns
3InformationShort NameGenerate abbreviation from name
4InformationDescriptionValidate length (≥100 chars), suggest improvements
5InformationLifecycleValidate date consistency, flag gaps
6Portfolio StrategyScalability RequirementsInfer from infra + traffic patterns
7Portfolio StrategyIntegration ComplexityCount relations/interfaces in LeanIX
8Portfolio StrategyMigration ComplexityAnalyze tech stack + dependencies
9Regulatory/LegalGDPR RelevanceInfer from Personal Data flag + data flows
10Regulatory/LegalNIS2 โ€” Digital InfrastructureClassify from service type
11โ€“13SecurityVehicle IT Security (3 fields)Classify from app domain/description
14Specific AttributesAuth Transformation AnalysisCheck AD component mapping
Requires human knowledge or organizational decisions. Copilot provides guided walkthroughs with policy references and decision trees.
#ClusterFieldCopilot Support
1โ€“3OrganisationBusiness / Technical / Consumer Owner OrgSuggest from org tree, human confirms
4โ€“8SubscriptionsResponsible, Business Owner, Tech Owner, ContactsSuggest from existing subscriptions
9Regulatory/LegalPassword Requirements (RISE)Decision tree with policy references
10Regulatory/LegalAccess Rights ReviewDecision tree with policy references
11Regulatory/LegalMulti-Factor AuthenticationGuide through GAS MFA / local options
12Regulatory/LegalAuthorization SystemsList approved systems (Alice, GEMS, etc.)
13โ€“15Regulatory/LegalAccess Concept, On-/Offboarding, Privileged AccountsRISE compliance checklist
16โ€“17Regulatory/LegalIAM Data Source, Regular SyncGuide through provisioning options
18โ€“19Regulatory/LegalDeletion Concept, Type of DeletionGDPR policy references
20โ€“21Regulatory/LegalEU Digital Service Act, EU Sovereign InfraDSA framework / US risk guidance
The Big Picture

How Kehrwoche AI Works

Three AI-powered components work together to automate the quarterly Kehrwoche cycle end-to-end. The Agent pre-fills answers, the Copilot assists POs interactively, and the Source Resolver auto-maps LeanIX fact sheets to code repositories and documentation.

1
TRIGGER Hourly poll detects new Kehrwoche to-dos in LeanIX (EventBridge + Lambda)
2
RESOLVE Auto-map each fact sheet to its GitHub repo + Confluence space (95%+ hit rate, no mapping files)
3
GATHER Fetch evidence from GitHub, Jira, Confluence, Archer, IAM, Alice, Cloud Accounts (AWS/Azure), and LeanIX relations in parallel
4
ANSWER Rules engine for deterministic questions (70%) + LLM for ambiguous ones (30%)
5
NOTIFY Bundle answers per PO, send email with evidence inline + signed approve link
6
APPROVE PO clicks one link → Agent writes to LeanIX via GraphQL + marks to-dos complete
Agent

Kehrwoche Agent

Resolves sources, gathers evidence, and pre-fills Kehrwoche to-do answers. Rules for 70%, LLM for 30%. Sends bundled email to POs.

Source Resolver Rules Engine LLM Answerer Email Notifier
Copilot

Kehrwoche Copilot

RAG chatbot for interactive guidance. Explains agent answers, helps POs edit suggestions, and handles Tier 3 fields requiring expert input.

RAG Pipeline Chat Handler Field Advisor Apply Action
Resolver

Source Resolver

Auto-maps LeanIX fact sheets to GitHub repos and Confluence spaces. Priority chain: org custom property → LeanIX field → file scan → fuzzy name match.

GitHub Properties LeanIX ExternalId Repo File Scan Name Matching

Agent Canvas View

Horizontal node-graph showing the Orchestrator Agent, its tools, and decision branches — n8n style

โšก
EventBridge
Scheduler
Kehrwoche
hourly trigger
๐Ÿ“ก
LeanIX
Fetch To-Dos
open Kehrwoche
fact sheets
๐Ÿค–
Kehrwoche Agent
Tools Agent
Chat Model*
Memory
Tool
Model
๐Ÿง 
Nexus LLMMB Model Garden
Memory
๐Ÿ’พ
DynamoDBAgent State
Tool
+
๐Ÿ’ป
GitHubEnterprise
๐Ÿ“‹
JiraSoftware
๐Ÿ“–
ConfluenceWiki
๐Ÿ›ก๏ธ
ArcherAGP
๐Ÿ“Š
LeanIXGraphQL
๐Ÿ”‘
IAMApp Details
๐Ÿ‘ฅ
AliceUser Details
โ˜๏ธ
Cloud AcctsAWS / Azure
๐Ÿ”€
Quality Gate
confidence check
confidence ≥ 0.8?
true
๐Ÿ“ง
SMTP
Send Email
Bundle per PO
approval email
โณ
PO Reviews
Human Gate
7d remind / 14d
escalate / 30d expire
๐Ÿ”—
Lambda
Approve
validate HMAC
+ write to LeanIX
โœ…
Confirm
Done
email + audit
trail to PO
+
false
๐Ÿ”„
Retry / Escalate
re-gather evidence
flag for manual
PO review
+

Kehrwoche Copilot โ€” RAG Pipeline

Interactive chatbot flow: PO asks a question, RAG retrieves context from knowledge sources, LLM generates an answer with an Apply action

๐Ÿ‘ค
Product Owner
Opens Copilot
from approval email
or LeanIX portal
๐Ÿ’ฌ
User Question
natural language
"How do I fill
Cloud Nativity?"
๐Ÿ“
Embed Query
multilingual-e5
384-dim vector
embedding
๐Ÿ”
Vector Search
FAISS index
Top-5 chunks
from KB
๐Ÿง 
LLM Generation
Nexus Model Garden
Context
App Data
KB Sources
Context
๐Ÿค–
Agent Resultspre-filled answers
App Data
๐Ÿ“Š
LeanIXfact sheet data
KB Sources
+
๐Ÿ“„
User GuidePDF chunks
๐Ÿ“‹
KehrwocheExcel
๐Ÿ“œ
PoliciesRISE / GDPR
โš™๏ธ
Field Metaenums / rules
๐Ÿ’ป
GitHubrepo context
๐Ÿ”‘
IAMApp Details
๐Ÿ‘ฅ
AliceUser Details
โ˜๏ธ
Cloud AcctsAWS / Azure
โœ…
Response
answer + citations
AI answer with
"Apply" button
๐Ÿ”€
PO Decision
apply changes?
accept, edit,
or ask more
apply
โœ๏ธ
LeanIX
Write Field
GraphQL mutation
update fact sheet
๐Ÿ“
Audit Log
DynamoDB
change recorded
with evidence
+
edit / ask
๐Ÿ”„
Continue Chat
follow-up Q
loops back to
User Question
+
Agentic AI Orchestration

Kehrwoche Agent โ€” Workflow Orchestration

An agentic AI pipeline where a central Orchestrator Agent delegates tasks to specialized sub-agents, each equipped with tools, memory, and decision loops. Human-in-the-loop approval gates ensure PO oversight.

1
โฐ
EventBridge Scheduler
Cron rule fires hourly during Kehrwoche window (Q1/Q3)
aws:eventbridge cron: 0 * * * *
TRIGGER
invokes orchestrator
2
๐Ÿงฌ
Orchestrator Agent
Central coordinator โ€” plans execution, delegates to sub-agents, manages state, handles retries and escalations
state: DynamoDB retry: 3x timeout: 30min
ORCHESTRATOR
๐Ÿง  Agent State — run_id status fact_sheets[] drafts[] errors[]
๐Ÿ“‹ PLANNING SUB-AGENT
3
๐Ÿ“ก
Fetch Open To-Dos
GraphQL allFactSheets query: filter open Kehrwoche to-dos, include PO subscriptions
tool: leanix_graphql query: openTodos
4
๐Ÿ”€
Dedup + Filter
Check DynamoDB: skip already-processed, identify delta since last run
tool: dynamodb_query key: run_status
new to-dos → build execution plan
5
๐Ÿ“
Build Execution Plan
Group fact sheets by PO, load skill_guide.yaml, assign question strategy per to-do
tool: skill_guide_loader output: plan.json
orchestrator dispatches per fact sheet
๐Ÿ”„ FOR EACH fact sheet in execution plan
๐Ÿ” SOURCE RESOLUTION SUB-AGENT
6
๐Ÿ”
Resolve Sources (Priority Chain)
4-level fallback: org custom props → LeanIX externalId → repo file scan → fuzzy name match
tool: github_org_props tool: leanix_external_id tool: repo_file_scanner tool: fuzzy_matcher
95%+ HIT
returns: github_repo, confluence_space, jira_project, iam_app, alice_users, cloud_accounts
๐Ÿ’พ Cache resolved mappings in DynamoDB — reuse across runs
๐Ÿ“‚ EVIDENCE GATHERING SUB-AGENT
PARALLEL TOOL CALLS โ€” fetch evidence concurrently
๐Ÿ’ป
GitHub
Tech stack, Dockerfile, CI config, models
tool: github_api
๐Ÿ“‹
Jira
Roles, releases, sprint data
tool: jira_api
๐Ÿ“–
Confluence
Architecture, data protection
tool: confluence_api
๐Ÿ›ก๏ธ
Archer
Security class, availability
tool: archer_api
๐Ÿ“Š
LeanIX
Relations, org structure
tool: leanix_graphql
๐Ÿ”‘
IAM
App registration, auth method
tool: iam_api
๐Ÿ‘ฅ
Alice
User details, org contacts
tool: alice_api
โ˜๏ธ
Cloud Accounts
AWS/Azure hosting, region, tags
tool: cloud_accounts_api
MERGE — Assemble evidence bundle per question
๐Ÿง  REASONING SUB-AGENT
7
๐Ÿ“‹
Skill Guide Lookup
Map each question to answering strategy: deterministic rule or LLM inference
config: skill_guide.yaml
?
Strategy: Deterministic or LLM?
~70% Rules
8a
โš™๏ธ
Rules Engine
Direct lookup from evidence: tech stack, hosting, security class
tool: rule_engine confidence: 1.0
~30% LLM
8b
๐Ÿง 
LLM Answerer (Nexus)
Structured JSON: answer, confidence, evidence citations, reasoning
tool: nexus_llm format: json_mode threshold: 0.8
MERGE — Combine all answers per fact sheet
validated answers with confidence scores
9
โœ…
Quality Gate
Validate: all required answers present, confidence ≥ 0.8, enum values valid, no contradictions
tool: answer_validator retry: low-confidence
๐Ÿ’พ Persist answers to DynamoDB — drafts/{po_email}/{fs_id}
๐Ÿ” END FOR EACH — all fact sheets processed
๐Ÿ“ง NOTIFICATION SUB-AGENT
10
๐Ÿ“ฆ
Bundle Answers per PO
Aggregate all fact sheet drafts by Product Owner (LeanIX RESPONSIBLE subscription)
tool: po_bundler
11
๐Ÿ”
Generate HMAC Tokens
SHA-256 signed approval URL per PO: bound to email, run_id, 30-day TTL, one-time-use
tool: hmac_signer algo: SHA-256
12
๐Ÿ“ง
Send Approval Email
HTML email: all answers inline with evidence citations + one-click "Approve All" button
tool: smtp_sender relay: corporate
email delivered to PO inbox
๐Ÿ‘ค HUMAN-IN-THE-LOOP
๐Ÿ›‘
PO Review Gate Agent pauses โ€” PO reviews answers in email, optionally edits via Copilot chatbot
13
โณ
Escalation Timer
Day 7: gentle reminder • Day 14: escalation to team lead • Day 30: auto-expire draft
tool: reminder_scheduler tool: escalation_engine
PO clicks "Approve All"
14
๐Ÿ”—
Lambda Function URL โ€” Validate
Verify HMAC signature + expiry + PO email binding + one-time-use token
tool: hmac_validator aws: lambda_url
15
โœ๏ธ
Write to LeanIX
GraphQL mutations: update fields + mark to-dos complete + log audit trail
tool: leanix_mutate tool: audit_logger
16
โœ…
Confirmation Email
Summary of all approved changes + audit trail reference + link to Copilot for follow-up
tool: smtp_sender
๐Ÿ Run Complete — status: done approved: N pending: M expired: K
Trigger / Scheduler
Tool Call / API
Filter / Gate
Data / Transform
LLM Reasoning
Notification
Orchestrator
Human-in-the-Loop
Reference Blueprint

Target Architecture

A layered, provider-agnostic architecture for AI-powered factsheet automation. Swap any component without breaking the stack.

Target Architecture

Kehrwoche AI Service

Data flows top-down: API โ†’ Business Logic โ†’ Providers โ†’ External Systems

Layer 0 โ€” API Routes
๐Ÿ”Œ Agent API /api/v1/agent/*
๐Ÿ’ฌ Copilot API /api/v1/copilot/*
๐Ÿ“Š Reports API /api/v1/reports/*
๐Ÿ“‹ Audit API /api/v1/audit/*
โค๏ธ Health /api/v1/health
โ–ผ routed via FastAPI Depends()
Layer 1 โ€” Business Logic
Kehrwoche Agent
๐Ÿ” Source Resolver
โš™๏ธ Rules Engine
๐Ÿค– LLM Answerer
๐Ÿ“ง Email Service
โœ… Approval Handler
๐Ÿ“‹ Skill Guide
Kehrwoche Copilot
๐Ÿ“š Knowledge Base
๐Ÿ’ฌ Chat Handler
๐Ÿงญ Field Advisor
โ–ผ ABC + Factory pattern
Layer 2 โ€” Providers & Clients
๐Ÿง  LLM Service Nexus (GPT-5.2 / Claude Opus 4.6)
๐Ÿ“ Embedding Service multilingual-e5-small
๐Ÿ—„๏ธ Vector Store ChromaDB / OpenSearch
โšก Cache Service Redis / In-Memory
โ–ผ OAuth2 / API Key / Bearer Token
Layer 3 โ€” Core & Shared
Config
Exceptions
Dependencies
Middleware
Telemetry
Audit Logger
Prompts
โ–ผ external API calls
Layer 4 โ€” External Systems
LeanIX GraphQL + OAuth2
MB Nexus Model Garden (LLM)
GitHub Enterprise Org App + Custom Props
Jira REST โ€” Service Account
Confluence REST โ€” Service Account
Archer (AGP) REST โ€” Security
IAM App Details / Auth
Alice User Details / Org
Cloud Accounts AWS / Azure
Corporate SMTP Email Relay

Provider Abstractions

Each infrastructure concern uses the Abstract Base Class + Factory pattern โ€” swap implementations without changing business logic.

LLM Provider (ABC)
NexusProvider (prod) NexusProvider (dev โ€” local)
get_llm_provider() โ€” config-driven singleton
Embedding Provider (ABC)
LocalEmbeddingProvider
get_embedding_provider() โ€” singleton factory
VectorStore Provider (ABC)
ChromaVectorStore (dev) OpenSearch (prod)
get_vectorstore_provider() โ€” singleton factory
Automation Engine

Kehrwoche Agent โ€” End-to-End Automation

Auto-resolves sources, gathers evidence from 6+ systems, pre-fills Kehrwoche to-do answers, and delivers one-click approval to Product Owners. Zero PO setup, zero maintenance.

Source Resolution โ€” No Mapping Files

The agent auto-resolves which GitHub repo and Confluence space belongs to each LeanIX fact sheet using a priority chain of fallbacks. 95%+ auto-resolved.

Priority 1

GitHub Org Custom Property

  • leanix_id set as mandatory property at repo creation
  • One API call resolves entire org (~60-80% hit rate)
  • Requires one-time org admin setup
Priority 2

LeanIX ExternalId / URL

  • Fact sheet externalId or description contains repo URL
  • LeanIX GraphQL query (~20-40% hit rate)
  • No additional setup needed
Priority 3

Repo File Scan + Name Match

  • Search repos for .leanix.yml, catalog-info.yaml
  • Fuzzy match fact sheet name to repo name
  • Fallback: notify PO to add repo URL (one-time)

Multi-Source Data Gathering

Evidence is fetched in parallel from all available sources for each fact sheet.

๐Ÿ’ป GitHub Enterprise

Tech stack, Dockerfile, CI config, models, README, Confluence URLs. Read via Org App.

๐Ÿ“‹ Jira

Project roles, release cycles, sprint status, active development signals.

๐Ÿ“– Confluence

Architecture docs, data-protection pages, design decisions, API documentation.

๐Ÿ›ก๏ธ Archer (AGP)

Security classification, availability, confidentiality, integrity ratings.

๐Ÿ“Š LeanIX

Existing field values, relations, subscriptions, org structure, fact sheet metadata.

๐Ÿง  LLM (Nexus)

Ambiguous questions only (~30%). Structured JSON output with confidence scores.

Answering Strategy โ€” Rules (70%) + LLM (30%)

A skill_guide.yaml maps each Kehrwoche question to its data source, answer strategy, and expected format.

~70%

Rules Engine

Deterministic answers for questions with clear data sources. High confidence, no LLM cost.

Tech stack Cloud hosting Release cycles Owner / team Security class Data center
~30%

LLM Answerer

AI-generated answers for ambiguous or context-dependent questions. Evidence-cited, confidence-scored.

GDPR relevance Data classification Retirement plan Architecture fit Migration strategy

Approval Workflow โ€” One Click, No Web App

1
BUNDLE Group all pre-filled answers by PO (from LeanIX subscription role = RESPONSIBLE)
2
STORE Save drafts in DynamoDB with HMAC-signed review token (TTL: 30 days)
3
EMAIL Send to PO: all answers inline with evidence citations + signed "Approve All" link
4
APPROVE PO clicks link → Lambda Function URL validates HMAC → writes to LeanIX → marks to-dos complete
5
REMIND Day 7: reminder email. Day 14: escalation to ACCOUNTABLE manager. Auto-expire at Day 30.
6
CONFIRM Success email to PO with summary of all approved changes + audit trail reference
RAG Chatbot

Copilot Deep-Dive โ€” AI-Guided Field Completion

Explains agent-generated answers, helps POs review and edit suggestions, guides Tier 3 fields interactively, and applies changes โ€” all through a conversational interface backed by expanded knowledge sources.

Knowledge Base Sources

๐Ÿ“„ User Guide PDF

Field descriptions, valid options, hints. Chunked per field/question section.

๐Ÿ“Š Kehrwoche Excel

Field inventory, automation status, source systems. One chunk per row.

โš™๏ธ LeanIX Field Metadata

Enum values, dependencies, validation rules. One chunk per field definition.

๐Ÿค– Agent Results

Pre-filled answers with evidence citations and confidence scores from the Kehrwoche Agent.

๐Ÿ’ป GitHub / Jira / Confluence

Live context from code repos, project boards, and documentation gathered by the Source Resolver.

๐Ÿ“œ Policy Documents

RISE, GDPR, NIS2, DSA frameworks. Decision trees for Tier 3 compliance fields.

๐Ÿ”‘ IAM

Application registration details, client IDs, authentication methods, and identity provider mappings.

๐Ÿ‘ฅ Alice

User directory details, org contacts, team memberships, and role assignments for PO lookup.

โ˜๏ธ Cloud Accounts

AWS/Azure account details, hosting regions, resource tags, and cloud provider metadata.

RAG Pipeline

๐Ÿ’ฌ User Question "How do I fill Cloud Nativity?"
โ†’
๐Ÿ“ Embed Query multilingual-e5 โ†’ 384-dim
โ†’
๐Ÿ” Vector Search Top-5 chunks from KB
โ†’
๐Ÿง  LLM Generation Context + App data โ†’ GPT-5.2
โ†’
โœ… Response + Action Answer + "Apply" button

Conversation Demos

Kehrwoche Copilot โ€” Field Guidance
U
How should I fill the "Cloud Nativity" field for my application?
AI
Based on the User Guide, Cloud Nativity has 3 options:

Cloud-Native (Advanced) โ€” Designed for the cloud with heavy use of cloud services

Cloud-Enabled / Hybrid โ€” Partially modernized; uses some cloud services

Traditional / Infrastructure-Centric โ€” Legacy or monolithic

Looking at your app MyApp-12345, hosted on AWS ECS with Lambda, I'd suggest Cloud-Enabled / Hybrid.

Shall I set this value?
U
Yes, please apply it.
AI
Done! Cloud Nativity set to "Cloud-Enabled / Hybrid" for MyApp-12345. Change logged in audit trail. โœ…
Kehrwoche Copilot โ€” Bulk Suggestions
U
Show me all missing fields for application ITCOMP-12345
AI
Your application has 8 unfilled mandatory fields:

1. US Risk Relevant โ†’ Yes (hosted on AWS) โ€” Auto-fillable
2. Cloud Nativity โ†’ Cloud-Enabled / Hybrid (ECS + Lambda)
3. Integration Complexity โ†’ Medium (5 interfaces found)
4. GDPR Relevance โ†’ Yes (Personal Data = Yes)
5. MFA โ†’ Needs your input...
6. Password Requirements โ†’ Needs your input...
7. Access Rights Review โ†’ Needs your input...
8. Deletion Concept โ†’ Needs your input...

I can auto-fill items 1โ€“4. For 5โ€“8, I'll guide you through each. Proceed?
Kehrwoche Copilot โ€” Policy Explanation
U
What is RISE and why does it matter for password requirements?
AI
RISE is Mercedes-Benz's security policy framework. For "Password Requirements", RISE requires:

โ€ข Password usage, creation, review, and storage standards
โ€ข Special requirements for administrative passwords
โ€ข GAS authentication automatically fulfills all requirements

If your app uses GAS โ†’ select Yes.
If not โ†’ check RISE criteria. If a risk process is in place, select No, but Risk Process Enabled and add Risk ID (e.g., RSK-1234567).
Sequence Flows

Interaction Sequences

Step-by-step message flows between components for each major operation.

Kehrwoche Agent: Quarterly Automation Sequence

EventBridge
Agent
LeanIX
Resolver
GitHub/Jira/Conf
Rules/LLM
SMTP
Hourly trigger (EventBridge rule)
GraphQL: fetch all open to-dos + subscriptions
Fact sheets grouped by PO email
Dedup: skip already processed (DynamoDB)
resolve(fact_sheet_id)
GitHub repo + Confluence space
Parallel: gather evidence (tech, releases, docs)
Evidence bundle per fact sheet
answer(question, evidence, skill_guide)
Draft answer + confidence + citations
Bundle all answers per PO, store in DynamoDB
Send email: answers + evidence + signed approve link
Delivery confirmed

Kehrwoche Agent: PO Approval Sequence

PO (Email)
Lambda URL
DynamoDB
LeanIX
SMTP
Click signed "Approve All" link
Validate HMAC + expiry + PO match
Load draft answers by review token
All pre-filled answers for this PO
GraphQL mutations: update fields + complete to-dos
Mutation results
Mark as approved (update status)
Confirmation email: "Kehrwoche done"
Success page: all changes applied

Agent: Auto-Populate Sequence (Field-Level)

Client
Agent API
Validator
Rule Engine
LeanIX
Audit Log
POST /agent/auto-populate/{fs_id}
get_factsheet(fs_id)
Factsheet data (GraphQL)
validate_factsheet(data)
List[FieldGap] + QualityScore
evaluate_all(gaps, enrichment)
List[FieldProposal]
dry_run check
update_factsheet(validateOnly=true)
Validation OK
update_factsheet(mutations)
MutationResult
log_mutation(before, after, confidence)
AutoPopulateResult + AuditEntries

Copilot: RAG Chat Sequence

User
Chat Handler
Embedding
VectorStore
Field Advisor
LLM Service
POST /copilot/chat {message, session_id}
Classify intent
embed_text(query)
384-dim vector
search(embedding, top_k=5)
Ranked context chunks
get_decision_tree(field_name)
Decision tree + policy refs (RISE, GDPR)
generate(system_prompt + context + history)
LLM response text
ChatResponse {message, suggestions, actions, sources}

OAuth2 Authentication Sequence

Client
Kehrwoche AI
LeanIX MTM
Bearer Token / SSO
API Token (client_credentials)
Access Token (JWT)
GraphQL + Bearer access_token
Factsheet Data (JSON)
API Response

Suggestion Engine: Tier 2 AI Suggestions

Agent API
Suggestion Eng.
VectorStore
LLM Service
Validator
suggest(factsheet, field_gaps)
search(field_context, top_k=5)
RAG context + peer patterns
generate_json(prompt + context)
JSON {field: value, confidence, reasoning}
validate_against_options(value)
Validated FieldProposal
requires_approval = True
List[FieldProposal] (human approval required)
Components

Two AI-Powered Engines

Agent for automation, Copilot for interactive guidance.

๐Ÿค–

Kehrwoche Agent

Automation Engine

End-to-end Kehrwoche automation: resolves sources, gathers evidence, answers questions, emails POs, and handles one-click approvals.

ModulePurpose
source_resolver.pyAuto-map fact sheets to GitHub repos + Confluence spaces
evidence_gatherer.pyParallel fetch from GitHub, Jira, Confluence, Archer
rule_engine.pyDeterministic answers for ~70% of questions
llm_answerer.pyLLM-generated answers for ~30% ambiguous questions
email_service.pyBundle answers per PO, send via SMTP with approve link
approval_handler.pyHMAC validation, LeanIX write-back, to-do completion
skill_guide.yamlMaps each question to source, strategy, and format
Quarterly Run โ€” EventBridge-triggered, processes all open to-dos
Validate/Report โ€” Read-only scan, produces gap report
Approve โ€” Lambda Function URL, HMAC-signed one-click approval
๐Ÿ’ฌ

Kehrwoche Copilot

RAG Chatbot

Interactive assistant for reviewing agent answers, editing suggestions, explaining policies, and guiding Tier 3 fields with multi-turn conversations.

ModulePurpose
knowledge_base.pyPDF/Excel/metadata + agent results + policy docs ingestion
chat_handler.pyMulti-turn conversation + intent classification
field_advisor.pyDecision trees + policy references (RISE, GDPR, NIS2)
review_agent_answer โ€” "Explain why Cloud Nativity was set to Hybrid"
field_guidance โ€” "How do I fill usRiskRelevant?"
policy_explanation โ€” "Explain GDPR relevance"
apply_suggestion โ€” "Yes, apply that"
REST API

API Endpoints

FastAPI-powered REST API with OpenAPI docs at /docs.

Kehrwoche Agent (Automation)

MethodEndpointDescription
POST/api/v1/agent/runTrigger Kehrwoche processing (all open to-dos)
GET/api/v1/agent/drafts/{po_email}Get pre-filled draft answers for a PO
GET/api/v1/agent/statusCurrent run status (pending, processing, done)
GET/approve/{token}Lambda Function URL โ€” one-click approval endpoint

Agent (Field-Level)

MethodEndpointDescription
POST/api/v1/agent/validate/{fs_id}Validate a factsheet against all mandatory field rules
POST/api/v1/agent/auto-populate/{fs_id}Auto-populate Tier 1 fields (dry-run by default)
POST/api/v1/agent/suggest/{fs_id}Generate AI suggestions for Tier 2 fields
POST/api/v1/agent/batchBatch process multiple factsheets

Copilot

MethodEndpointDescription
POST/api/v1/copilot/chatSend a message and get an AI response
POST/api/v1/copilot/applyApply a chat-suggested value to LeanIX
GET/api/v1/copilot/session/{session_id}Get conversation history

Reports

MethodEndpointDescription
GET/api/v1/reports/qualityPortfolio-wide quality report
GET/api/v1/reports/gaps/{org_id}Gap report for a specific organization
GET/api/v1/reports/factsheet/{fs_id}Detailed quality report for one factsheet

System

MethodEndpointDescription
GET/api/v1/healthHealth check with dependency status
GET/api/v1/audit/{fs_id}Audit trail for a factsheet
GET/api/v1/audit/All audit entries
Infrastructure

Deployment Architecture

Production on AWS with EventBridge scheduling, Lambda Function URL for approvals, DynamoDB for draft storage, and MB Nexus Model Garden for LLM.

Production Architecture

๐Ÿ‘ฅ Users
HTTPS
โ˜๏ธ AWS Cloud EU Region (eu-central-1)
๐Ÿ“ Region
๐Ÿ”’ VPC 10.0.0.0/16
Public Subnet 10.0.1.0/24 ยท AZ-a
โš–๏ธ Application Load Balancer HTTPS :443 โ†’ target group :8000 WAF + SSL termination
Agent Copilot KB
Target Group
Private Subnet 10.0.2.0/24 ยท AZ-a, AZ-b
Amazon ECS Cluster
๐Ÿš€ Fargate Task โ€” FastAPI Service :8000 2 vCPU ยท 4 GB ยท auto-scaling
Agent /api/v1/agent/* Validate & Auto-Populate
Copilot /api/v1/copilot/* RAG Chat
KB /api/v1/knowledge/* Knowledge Base Ingestion
๐Ÿ’ฌ Fargate Task โ€” Chat UI Streamlit :8501 ยท 1 vCPU ยท 2 GB
Copilot
Data Subnet 10.0.3.0/24 ยท AZ-a, AZ-b
๐Ÿ” OpenSearch Serverless Vector store (HNSW / cosine) 384-dim embeddings
Copilot KB
โšก ElastiCache Redis Session + field cache Tiered TTLs ยท cluster mode
Agent Copilot
๐Ÿ—ƒ๏ธ DynamoDB Audit metadata On-demand capacity
Agent
๐Ÿ“ฆ S3 Bucket Audit logs (JSONL) Lifecycle: Glacier 90d
Agent KB
AWS Managed Services (outside VPC)
โฐ EventBridge Hourly poll trigger
๐Ÿ”— Lambda Function URL Approval endpoint (no API GW)
๐Ÿ” Secrets Manager Auto-rotated keys + HMAC secret
๐Ÿ“Š CloudWatch Logs + Metrics + Alarms
๐Ÿ—๏ธ ECR Container Registry
๐Ÿ”‘ IAM Task roles + policies
External Services (MB Network)
๐Ÿง  MB Nexus Model Garden GPT-5.2 / Claude Opus 4.6 via OpenAI-compatible API HTTPS ยท API Key auth
Agent Copilot
๐Ÿ“Š LeanIX GraphQL API ยท OAuth2 MTM Factsheet CRUD
Agent
๐Ÿ›ก๏ธ Archer (AGP) REST API ยท security metadata App risk profiles
Agent
๐Ÿ’ป GitHub Enterprise Org App ยท custom properties Tech stack, Dockerfile, CI config
Agent
๐Ÿ“‹ Jira REST API ยท Service Account Releases, roles, sprints
Agent
๐Ÿ“– Confluence REST API ยท Service Account Arch docs, data protection
Agent
๐Ÿ“ง Corporate SMTP Email relay ยท TLS PO notifications + approvals
Agent
Connection Map
ECS โ†’ Nexus HTTPS :443 ยท API Key
ECS โ†’ LeanIX GraphQL ยท OAuth2 Bearer
ECS โ†’ GitHub REST ยท Org App (leanix_id props)
ECS โ†’ Jira/Confluence REST ยท Service Account
ECS โ†’ SMTP TLS :587 ยท Relay credentials
ECS โ†’ Data VPC internal ยท security groups
Data Flow ↔ Infrastructure Mapping
Agent Kehrwoche Automation (Primary)
EventBridge → ECS Agent → LeanIX (to-dos) → Source Resolver (GitHub props) → GitHub/Jira/Confluence (evidence) → Rules + Nexus LLM (answers) → DynamoDB (drafts) → SMTP (email) → Lambda URL (approve) → LeanIX (write)
EventBridgeECS FargateNexusLeanIXGitHubJiraConfluenceDynamoDBSMTPLambda
Agent Validate & Field Auto-Populate
ALB → FastAPI /agent → LeanIX (read) → Rule Engine → Nexus LLM → LeanIX (write) → Redis (cache) → DynamoDB + S3 (audit)
ALBECS FargateNexusLeanIXArcherGitHubRedisDynamoDBS3
Copilot RAG Chat
Chat UI → ALB → FastAPI /copilot → OpenSearch (vector search) → Redis (session) → Nexus LLM → response
Chat UIALBECS FargateNexusOpenSearchRedis
KB Knowledge Base Ingestion
Admin upload → ALB → FastAPI /knowledge → PDF extract → chunk → embed (e5-small) → OpenSearch (store) → S3 (source backup)
ALBECS FargateOpenSearchS3

Dev vs Production Comparison

๐Ÿ–ฅ๏ธ Development (Docker Compose)

Composedocker-compose.yml
APIFastAPI :8000 (hot reload)
Chat UIStreamlit :8501
LLMMB Nexus (GPT-5.2 / Claude Opus 4.6)
VectorsChromaDB (embedded)
CacheRedis :6379 (container)
AuditLocal JSONL โ†’ ./data/
Secrets.env file
Networkkehrwoche-net (bridge)
Nexus override: docker compose -f docker-compose.yml -f docker-compose.nexus.yml up

โ˜๏ธ Production (AWS + MB Nexus)

ComputeECS Fargate (auto-scaling 2โ€“10)
APIFastAPI โ†’ ALB HTTPS :443
Chat UIStreamlit โ†’ ALB path routing
LLMMB Nexus Model Garden (GPT-5.2 / Claude Opus 4.6)
VectorsOpenSearch Serverless (HNSW)
CacheElastiCache Redis (cluster)
AuditS3 + DynamoDB (durable)
SecretsAWS Secrets Manager (rotated)
NetworkVPC + private subnets + SGs
Key difference: No local LLM container, no local storage, all managed services.

Local Development: Docker Compose Topology

๐Ÿณ docker-compose.yml kehrwoche-net (bridge)
๐Ÿš€ kehrwoche-api FastAPI :8000 env_file: .env volumes: ./data:/app/data
๐Ÿ’ฌ chat-ui Streamlit :8501 โ†’ http://kehrwoche-api:8000
๐Ÿง  nexus-proxy MB Nexus (GPT-5.2 / Claude Opus 4.6) OpenAI-compatible API env: NEXUS_API_KEY
โšก redis Redis 7 Alpine :6379 volume: redis_data
api โ†’ nexus, redis chat-ui โ†’ api
Business Value

Expected Impact

Measurable improvements across time, quality, and cycle duration.

Time per Factsheet
45โ€“60 min
10โ€“15 min
~75% reduction
Tier 1 Fields
Manual lookup
Automated
100% automated
Tier 2 Fields
Manual research
1-Click
~80% faster
Tier 3 Fields
Unguided
AI-Guided
~50% faster
Data Quality Errors
15โ€“20%
<5%
~75% reduction
Kehrwoche Cycle
3 weeks
1โ€“2 weeks
~50% shorter
Risk Management

Risks & Mitigations

โš ๏ธLeanIX API Rate Limits
Impact: Batch processing blocked
Rate limiting + pagination + response caching
๐Ÿ’ฅIncorrect Auto-Population
Impact: Data quality regression
Dry-run mode + approval workflow + full audit trail with rollback
๐Ÿค–LLM Hallucination
Impact: Wrong values suggested
Constrain to valid enum values + high-confidence threshold (โ‰ฅ0.8)
๐Ÿ”Archer / Git API Access
Impact: Can't populate Tier 1 from external sources
Fallback to manual + copilot guidance + existing sync data
๐Ÿ”Source Resolution Miss
Impact: Agent can't gather evidence for some fact sheets
4-level priority chain (org props, externalId, file scan, name match) + fallback: notify PO once to link repo
๐Ÿ“งEmail Deliverability
Impact: PO doesn't receive approval email
Corporate SMTP relay + delivery tracking + bounce handling + Copilot as backup channel
๐Ÿ“ˆScale (Thousands of Factsheets)
Impact: Performance issues at volume
Batch processing + async operations + response caching + parallel evidence gathering
Tech Stack

Built With

Language
Python 3.11+
API Framework
FastAPI
LLM
MB Nexus (GPT-5.2 / Claude Opus 4.6)
Embeddings
multilingual-e5-small (384d)
Vector Store
ChromaDB / OpenSearch
Cache
Redis (tiered TTLs)
External APIs
LeanIX GraphQL, GitHub Org App, Jira, Confluence, Archer
Email
Corporate SMTP Relay (TLS)
Auth
OAuth2 + HMAC signed links + MB SSO
Scheduling
EventBridge (hourly poll)
Deployment
Docker, ECS Fargate, Lambda Function URL
Observability
OpenTelemetry + CloudWatch
Security & Compliance

Security Architecture

Enterprise-grade security with EU data residency and audit trail.

๐Ÿ”’

OAuth2 Authentication

LeanIX API token exchange. Mercedes-Benz SSO integration planned.

๐Ÿ‡ช๐Ÿ‡บ

EU Data Residency

MB Nexus Model Garden (GPT-5.2 / Claude Opus 4.6) hosted within MB infrastructure (EU compliant).

๐Ÿ›ก๏ธ

PII Scrubbing

User emails and names stripped before LLM context injection.

๐Ÿ“œ

Immutable Audit Trail

Every write operation logged with before/after values, confidence scores, and source.

๐Ÿ”‘

Secrets Management

.env for dev; AWS Secrets Manager for production with key rotation.

๐Ÿ”—

HMAC-Signed Approval Links

One-click approve URLs are HMAC-SHA256 signed with expiry, PO email binding, and one-time-use token.

๐Ÿงช

Dry-Run Default

All field auto-populate operations default to dry_run=True. Preview before writing.

View Authentication Sequence Diagram โ†’
Code Quality

Module Boundary Rules

Strict layered architecture โ€” imports flow downward only.

RuleAllowedForbidden
R1api/routes/ โ†’ agent/, copilot/, core/agent/ โ†’ api/routes/
R2agent/ โ†’ providers, core/agent/ โ†’ copilot/
R3copilot/ โ†’ providers, core/copilot/ โ†’ agent/
R4Providers โ†’ core/ onlyProviders cross-importing
R5core/ โ†’ stdlib, third-partycore/ โ†’ any app module
Roadmap

Implementation Phases

โœ…

Phase 1: Foundation

Weeks 1โ€“2

LeanIX GraphQL client, knowledge base from User Guide + Excel, field validation, first quality report

Quality report showing all gaps across all applications
โœ…

Phase 2: Field Agent

Weeks 3โ€“4

Rule engine for Tier 1, Archer/Git data fetchers, GraphQL mutations, audit trail, dry-run, batch processing

Agent auto-fills Tier 1 fields with complete audit log
โœ…

Phase 3: Copilot

Weeks 5โ€“6

RAG pipeline, chat handler, Tier 2 suggestions, context injection, Streamlit UI, "Apply" action

Chat interface for AI-suggested field values
๐Ÿšง

Phase 4: Kehrwoche Agent

Weeks 7โ€“9

Source resolver (GitHub custom props, LeanIX ExternalId), multi-source evidence gathering (GitHub, Jira, Confluence), skill guide, rules + LLM answering, email-based approval with HMAC-signed links

End-to-end quarterly Kehrwoche automation with one-click PO approval
๐Ÿ”ฒ

Phase 5: Integration

Weeks 10โ€“11

Copilot integration with agent results, dashboard with quality scores, reminder/escalation engine, performance optimization

Integrated platform: Agent + Copilot ready for pilot
๐Ÿ”ฒ

Phase 6: Production

Weeks 12โ€“14

AWS deployment (EventBridge, Lambda URL, DynamoDB, ECS, OpenSearch), MB SSO, SMTP relay, load testing, UAT

Production-ready platform for all Product Owners