Skip to content

feat: Add autonomous-enterprise-audit-sanctions-compliance template - #323

Open
maitimeraki wants to merge 1 commit into
Lamatic:mainfrom
maitimeraki:main
Open

feat: Add autonomous-enterprise-audit-sanctions-compliance template#323
maitimeraki wants to merge 1 commit into
Lamatic:mainfrom
maitimeraki:main

Conversation

@maitimeraki

@maitimeraki maitimeraki commented Aug 5, 2026

Copy link
Copy Markdown

Problem

An AI-powered compliance workflow for onboarding high-profile corporate clients and vendors. This kit screens entities against sanctions and risk signals, extracts and verifies onboarding documents, audits public financial and compliance records, and stores a durable memory trail of the checks that were performed. High-risk cases are escalated to human compliance managers with Slack and external verification support.

What this kit does

Send a vendor onboarding packet, audit document, or compliance checklist to the webhook and get back an automated compliance decision that can:

  • Screen the entity using document extraction, classifier routing, and retrieval against prior audit memory
  • Search internal compliance knowledge using hybrid search over stored vectors and indexed records
  • Verify onboarding details through an external API check before final classification
  • Escalate suspicious, incomplete, or high-risk cases to a supervisor path with MCP-assisted investigation
  • Record approved low-risk audits in immutable memory and vector storage for future lookup
  • Notify compliance operators in Slack when manual review is required
  • Return a structured JSON summary with vendor name, document title, risk level, audit status, and decision summary

Flow Architecture

Webhook
	↓
Extract from File
	↓
Agentic Doc Extraction
	↓
Classifier
	├── Memory Retrieve
	├── Hybrid Search
	└── API
	↓
Supervisor
	├── MCP
	└── Slack
	↓
Generate JSON
	↓
Vectorize
	↓
VectorDB
	↓
Memory Add
	↓
End

Configuration

Setting Purpose
Trigger Webhook upload or document URL
OCR Document parsing and field extraction
Classifier Routes the audit into memory, search, or API verification paths
External API Compliance and onboarding verification
Supervisor Final routing for low-risk or high-risk decisions
Slack Manual review and escalation alerts
Vector DB Indexed audit history and retrieval support
Memory Persistent audit log and future lookup context

Checklist

  • Folder at kits/autonomous-enterprise-audit-sanctions-compliance/ (kebab-case, unique)
  • lamatic.config.ts with valid type, name, author, tags, steps, links
  • agent.md present
  • README.md present
  • flows/autonomous-enterprise-audit-sanctions-compliance.ts exists for the declared step
  • constitutions/default.md present
  • links.github points to kits/autonomous-enterprise-audit-sanctions-compliance
  • PR touches only files inside kits/autonomous-enterprise-audit-sanctions-compliance/
  • Added the autonomous-enterprise-audit-sanctions-compliance kit.
  • Added workflow documentation in README.md and agent.md.
  • Added the default constitution with identity, safety, data-handling, and communication rules.
  • Added Lamatic template metadata, tags, mandatory workflow configuration, and GitHub link.
  • Added environment ignore rules for .lamatic/, node_modules/, .env, and .env.local.
  • Added model configurations for Mistral Small 2501 and Mistral Embed across agent, classifier, memory, retrieval, vectorization, hybrid search, instructor, and MCP nodes.
  • Added prompts for:
    • Document extraction and OCR cleanup.
    • Document classification.
    • Risk supervision and routing.
    • Low-risk audit formatting.
  • Added the complete workflow definition with webhook intake, document extraction, classification, memory retrieval, hybrid search, external verification, supervisor evaluation, and result routing.
  • The flow stores low-risk audit results in vector and persistent memory systems.
  • The flow sends high-risk cases through MCP verification and Slack escalation.
  • The flow uses loop and conditional edges to route each case according to document category and risk level.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

Enterprise audit and sanctions compliance workflow

Layer / File(s) Summary
Workflow foundation and runtime configuration
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., constitutions/default.md, lamatic.config.ts, model-configs/*
Defines workflow metadata, credentials, model assignments, constitution rules, and template configuration.
Document intake and evidence routing
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., prompts/*classifier*, prompts/*doc-extraction*
Processes PDF input with OCR, extracts structured audit data, classifies documents, and routes evidence to retrieval or compliance API nodes.
Risk handling, output, and persistence
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., prompts/*agent-node*, prompts/*instructor*
Evaluates risk, formats low-risk results, persists audit data, and sends high-risk cases through MCP verification and Slack escalation.
Operational documentation and repository setup
kits/autonomous-enterprise-audit-sanctions-compliance/README.md, agent.md, .gitignore
Documents setup, operation, integrations, troubleshooting, example flows, and ignored local files.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the kit and includes a custom checklist, but it omits most required template sections for general requirements, file structure, and validation. Use the repository checklist headings and complete the missing requirements, including contribution type, validation results, workflow structure, and review status.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the addition of the autonomous enterprise audit sanctions compliance template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Template: kits/autonomous-enterprise-audit-sanctions-compliance

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Around line 505-507: Update the Vectorize node’s inputText and metadataField
construction to insert clear separators between vendor_name, document_title, and
summary, preserving the existing field order and values while preventing
boundary tokens from merging.
- Around line 229-239: Move the inline ocrModelName configuration into
model-configs/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_ocr-model-name.ts,
preserving its provider, model, credential, and config values. Remove the inline
block from the flow and update references.modelConfigs to point to the external
`@model-configs` configuration, matching the existing model selection pattern.
- Around line 171-202: Remove the unused dynamic node identified by id
extractFromFileNode_877, since no downstream node consumes its output and
agenticDocExtractionNode_581 reads triggerNode_1.output.prompt directly.
Alternatively, update agenticDocExtractionNode_581 to consume
extractFromFileNode_877.output and preserve the extraction flow, but do not
leave the node disconnected.
- Around line 350-353: Document the Middesk integration requirements in the kit
README: use the production businesses endpoint instead of the sandbox host and
configure the required Authorization credential alongside Content-Type.
Alternatively, update the request configuration around the POST businesses call
to reference the established credential mechanism, ensuring adopters do not send
unauthenticated requests.
- Around line 550-555: Update the memoryValue content in the audit memory record
to use the Agentic Doc Extraction node’s ID-based interpolation, matching the
existing agenticDocExtractionNode_581.output.structuredData path used elsewhere
in the flow, for both vendor_name and document_title references; preserve the
$now interpolation and surrounding message.
- Line 435: The promptTemplate in the escalation evaluation node must
interpolate the vendor name instead of leaving an empty placeholder. Restore the
vendor-name expression used by the surrounding flow before “and verify
compliance records,” while preserving the existing
agenticDocExtractionNode_581.output.extractedText interpolation.
- Around line 726-733: Delete the edge with id
xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top from the flow
definition, leaving the existing InstructorLLMNode_771 → vectorizeNode_704
connection and declared agent-loop edges unchanged.
- Around line 452-459: Update the terminal Slack node identified by id
"slackNode_425" and nodeName "Slack" to post a high-risk sanctions escalation
alert instead of the generic greeting. Build the message from the flagged
vendor/entity, risk finding, and MCP verification result available in the
HighRiskAgent flow, and replace the placeholder channelName "C0BMENFFABC" with
the configured escalation channel identifier.
- Around line 4-16: Update the exported meta object in the autonomous enterprise
audit sanctions compliance flow by populating description, tags, and githubUrl
from the corresponding values in lamatic.config.ts, and provide the appropriate
deployUrl. Preserve the existing name, author, and other metadata fields while
ensuring template listings no longer show these fields as empty.
- Around line 273-289: Update the three classifier value entries in the
classifier configuration to reference the declared agentClassifierEdge IDs: map
Memory Retrieve to agentClassifierNode_252-memoryRetrieveNode_264-651, API to
agentClassifierNode_252-apiNode_483-112, and Hybrid Search to
agentClassifierNode_252-hybridSearchNode_546-234, while preserving their labels
and descriptions.
- Line 351: The request body template currently serializes the non-string fields
incorrectly. In the payload body near agenticDocExtractionNode_581, remove JSON
string quotes around has_all_signoffs and compliance_checklist so they remain
boolean and array values; keep quotes around vendor_name, document_title, and
extracted_text.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md`:
- Around line 1-5: Update the classifier prompt text to begin with “Analyze the
following document...” instead of the malformed “WriAnalyze”, and remove the
trailing “te your prompt here” fragment so the prompt ends immediately after
{{agenticDocExtractionNode_581.output.extractedText}}.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md`:
- Around line 2-4: Update the Vendor Details mappings to inject the exact
vendor_name and document_title fields from agenticDocExtractionNode_581’s
structuredData using the precise paths already used elsewhere in the flow; do
not pass the entire structuredData object or extractedText dump, and preserve
the existing labels so the schema values remain suitable for the VectorDB
primary key and Memory uniqueId.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1c8b1e35-2944-4602-a768-724f4109ee0e

📥 Commits

Reviewing files that changed from the base of the PR and between 3e355f5 and ca2bd98.

📒 Files selected for processing (22)
  • kits/autonomous-enterprise-audit-sanctions-compliance/.gitignore
  • kits/autonomous-enterprise-audit-sanctions-compliance/README.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/agent.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/constitutions/default.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/lamatic.config.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_hybrid-search-node-546_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_mcp-node-737_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-retrieve-node-264_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_vectorize-node-704_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md

Comment on lines +229 to +239
"ocrModelName": [
{
"type": "ocr/document",
"params": {},
"configName": "configA",
"model_name": "mistral/mistral-ocr-latest",
"credentialId": "bb2f5d05-9c8d-4e02-a753-6f59783b609e",
"provider_name": "mistral",
"credential_name": "agentkit"
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Externalize the OCR model config. ocrModelName is inlined here with provider, model, and credential identifiers. Every other model selection in this flow points at @model-configs/.... Move this block into model-configs/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_ocr-model-name.ts and reference it from references.modelConfigs.

As per coding guidelines: "LLM and model configurations must be externalized into separate TypeScript files in the model-configs/ directory instead of being inlined in nodes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 229 - 239, Move the inline ocrModelName configuration into
model-configs/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_ocr-model-name.ts,
preserving its provider, model, credential, and config values. Remove the inline
block from the flow and update references.modelConfigs to point to the external
`@model-configs` configuration, matching the existing model selection pattern.

Source: Coding guidelines

Comment on lines +273 to +289
"classifier": [
{
"label": "Memory Retrieve",
"value": "agentClassifierNode_252-addNode_484",
"description": "Use when the document requires checking past session history, previous audit logs, or entity interaction history."
},
{
"label": "Hybrid Search",
"value": "agentClassifierNode_252-plus-node-addNode_508532-616",
"description": "Use when the document requires searching internal regulatory knowledge bases, legal policies, or sanctions compliance indices."
},
{
"label": "API",
"value": "agentClassifierNode_252-addNode_891",
"description": "Use when the document is a vendor onboarding form or compliance checklist requiring immediate external database verification or API submission."
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Compare classifier route values against declared edge ids in other kits that use agentClassifierNode.
rg -l 'agentClassifierNode' --glob 'kits/**/flows/*.ts' | while read -r f; do
  echo "=== $f"
  rg -n -C3 '"classifier"|agentClassifierEdge' "$f" | head -60
done

Repository: Lamatic/AgentKit

Length of output: 154


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts"

echo "=== file exists and line count"
wc -l "$file"

echo "=== classifier values and nearby metadata"
rg -n -C5 '"classifier"|label|"value":|agentClassifierEdge|agentClassifierNode' "$file" | head -120

echo "=== node ids containing classifier/node target names"
py="import json,re,sys; data=open(sys.argv[1],encoding='utf-8').read(); print('\\n'.join(re.findall(r'\"id\"[^\n]*', data)))"
python3 - <<'PY' "$file" | grep -Ei "classifier|retrieve|hybrid|api|edge|addNode|memoryRetrieveNode|apiNode|hybridSearchNode" || true
PY

echo "=== edge objects/source/target excerpts"
python3 - <<'PY' "$file"
import re, sys
text=open(sys.argv[1],encoding='utf-8').read()
# print line numbers for ids containing classifier/edge/node target terms
for i,line in enumerate(text.splitlines(),1):
    if re.search(r'edge|classifier|retrieve|hybrid|api|memoryRetrieveNode|apiNode|hybridSearchNode|addNode', line, re.I):
        print(f"{i}: {line[:400]}")
PY

Repository: Lamatic/AgentKit

Length of output: 9426


Your mission, should you choose to accept it: match classifier routes to real edge IDs. The three classifier.value entries point to agentClassifierNode_252-addNode_484, agentClassifierNode_252-plus-node-addNode_508532-616, and agentClassifierNode_252-addNode_891; instead, use the declared agentClassifierEdge IDs: agentClassifierNode_252-memoryRetrieveNode_264-651, agentClassifierNode_252-apiNode_483-112, and agentClassifierNode_252-hybridSearchNode_546-234.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 273 - 289, Update the three classifier value entries in the
classifier configuration to reference the declared agentClassifierEdge IDs: map
Memory Retrieve to agentClassifierNode_252-memoryRetrieveNode_264-651, API to
agentClassifierNode_252-apiNode_483-112, and Hybrid Search to
agentClassifierNode_252-hybridSearchNode_546-234, while preserving their labels
and descriptions.

Comment on lines +350 to +353
"url": "https://api-sandbox.middesk.com/v1/businesses",
"body": "{\n \"vendor_name\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name || '' }}\",\n \"has_all_signoffs\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.has_all_signoffs || false }}\",\n \"document_title\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title || '' }}\",\n \"compliance_checklist\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.compliance_checklist || [] }}\",\n \"extracted_text\": \"{{ agenticDocExtractionNode_581.output.extractedText || '' }}\"\n}",
"method": "POST",
"headers": "{\"Content-Type\":\"application/json\"}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

The endpoint is a sandbox, and the request carries no credential. https://api-sandbox.middesk.com/v1/businesses is Middesk's test host, and headers contains only Content-Type. Adopters will get 401s or silent sandbox writes. Document the production host and the required Authorization header in the kit README, or wire a credential reference.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 350 - 353, Document the Middesk integration requirements in the kit
README: use the production businesses endpoint instead of the sandbox host and
configure the required Authorization credential alongside Content-Type.
Alternatively, update the request configuration around the POST businesses call
to reference the established credential mechanism, ensuring adopters do not send
unauthenticated requests.

Comment on lines +505 to +507
"nodeName": "Vectorize",
"inputText": "{{InstructorLLMNode_771.output.vendor_name}}{{InstructorLLMNode_771.output.document_title}}{{InstructorLLMNode_771.output.summary}}",
"embeddingModelName": "@model-configs/autonomous-enterprise-audit-sanctions-compliance_vectorize-node-704_embedding-model-name.ts"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Concatenation without separators degrades the embedding and the metadata. inputText joins vendor name, title, and summary with no delimiter, so tokens merge at the boundaries. metadataField at Line 531 does the same. Insert separators.

♻️ Proposed fix
-        "inputText": "{{InstructorLLMNode_771.output.vendor_name}}{{InstructorLLMNode_771.output.document_title}}{{InstructorLLMNode_771.output.summary}}",
+        "inputText": "{{InstructorLLMNode_771.output.vendor_name}} | {{InstructorLLMNode_771.output.document_title}} | {{InstructorLLMNode_771.output.summary}}",

Also applies to: 531-531

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 505 - 507, Update the Vectorize node’s inputText and metadataField
construction to insert clear separators between vendor_name, document_title, and
summary, preserving the existing field order and values while preventing
boundary tokens from merging.

Comment on lines +550 to +555
"memoryValue": [
{
"role": "user",
"content": "Vendor {{ Agentic Doc Extraction: structuredData.0.annotation.vendor_details.vendor_name }} successfully cleared low-risk compliance audit for {{ Agentic Doc Extraction: structuredData.0.annotation.document_metadata.document_title }} on {{ $now }}."
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Wrong interpolation syntax in the memory record. This value uses {{ Agentic Doc Extraction: structuredData... }}, the display-name form. Every other node in this flow uses the node-id form, for example Line 308 uses {{agenticDocExtractionNode_581.output.structuredData.0...}}. The stored audit memory will likely persist unresolved placeholder text.

🐛 Proposed fix
-            "content": "Vendor {{ Agentic Doc Extraction: structuredData.0.annotation.vendor_details.vendor_name }} successfully cleared low-risk compliance audit for {{ Agentic Doc Extraction: structuredData.0.annotation.document_metadata.document_title }} on {{ $now }}."
+            "content": "Vendor {{agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name}} successfully cleared low-risk compliance audit for {{agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title}} on {{ $now }}."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"memoryValue": [
{
"role": "user",
"content": "Vendor {{ Agentic Doc Extraction: structuredData.0.annotation.vendor_details.vendor_name }} successfully cleared low-risk compliance audit for {{ Agentic Doc Extraction: structuredData.0.annotation.document_metadata.document_title }} on {{ $now }}."
}
],
"memoryValue": [
{
"role": "user",
"content": "Vendor {{agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name}} successfully cleared low-risk compliance audit for {{agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title}} on {{ $now }}."
}
],
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 550 - 555, Update the memoryValue content in the audit memory
record to use the Agentic Doc Extraction node’s ID-based interpolation, matching
the existing agenticDocExtractionNode_581.output.structuredData path used
elsewhere in the flow, for both vendor_name and document_title references;
preserve the $now interpolation and surrounding message.

Comment on lines +726 to +733
{
"id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
"source": "vectorizeNode_704",
"target": "InstructorLLMNode_771",
"sourceHandle": "bottom",
"targetHandle": "top",
"type": "defaultEdge"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Reverse edge creates a cycle. Line 695 already routes InstructorLLMNode_771vectorizeNode_704. This edge routes vectorizeNode_704InstructorLLMNode_771. The pair forms a loop outside the declared agent-loop edges, and vectorizeNode_704.inputText at Line 506 depends on InstructorLLMNode_771 output, so the reverse direction is unsatisfiable. Delete this edge.

🐛 Proposed fix
-  {
-    "id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
-    "source": "vectorizeNode_704",
-    "target": "InstructorLLMNode_771",
-    "sourceHandle": "bottom",
-    "targetHandle": "top",
-    "type": "defaultEdge"
-  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
"source": "vectorizeNode_704",
"target": "InstructorLLMNode_771",
"sourceHandle": "bottom",
"targetHandle": "top",
"type": "defaultEdge"
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 726 - 733, Delete the edge with id
xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top from the flow
definition, leaving the existing InstructorLLMNode_771 → vectorizeNode_704
connection and declared agent-loop edges unchanged.

Comment on lines +2 to +4
Vendor Details:
- Vendor Name: {{agenticDocExtractionNode_581.output.structuredData}}
- Document Title: {{agenticDocExtractionNode_581.output.extractedText}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

The labels and the data do not match. Line 3 is labelled "Vendor Name" but injects the entire structuredData object. Line 4 is labelled "Document Title" but injects the full extractedText OCR dump. The model must emit exact vendor_name and document_title values per the schema at Line 473 of the flow, and that output becomes the VectorDB primary key and the Memory uniqueId. Wrong values here corrupt the stored audit record and break deduplication.

Use the precise paths the flow already uses elsewhere.

🐛 Proposed fix
 Vendor Details:
-- Vendor Name: {{agenticDocExtractionNode_581.output.structuredData}}
-- Document Title: {{agenticDocExtractionNode_581.output.extractedText}}
+- Vendor Name: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name}}
+- Document Title: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title}}
+- Compliance Checklist: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.compliance_checklist}}

I left the markdownlint MD041 heading warning alone. Based on learnings, prompt Markdown files are sent to the model as instruction content, so cosmetic headings should not be added for lint satisfaction.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Vendor Details:
- Vendor Name: {{agenticDocExtractionNode_581.output.structuredData}}
- Document Title: {{agenticDocExtractionNode_581.output.extractedText}}
Vendor Details:
- Vendor Name: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name}}
- Document Title: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title}}
- Compliance Checklist: {{agenticDocExtractionNode_581.output.structuredData.0.annotation.compliance_checklist}}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md`
around lines 2 - 4, Update the Vendor Details mappings to inject the exact
vendor_name and document_title fields from agenticDocExtractionNode_581’s
structuredData using the precise paths already used elsewhere in the flow; do
not pass the entire structuredData object or extractedText dump, and preserve
the existing labels so the schema values remain suitable for the VectorDB
primary key and Memory uniqueId.

Source: Learnings

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Hi @maitimeraki! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

@akshatvirmani

Copy link
Copy Markdown
Contributor

/validate

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📡 Running Studio validation — results will appear here shortly.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Studio Runtime Validation (Phase 2)

Studio validation passed. The kit loaded successfully in Lamatic Studio.

This PR is ready for final review and merge.

@akshatvirmani

Copy link
Copy Markdown
Contributor

@maitimeraki PR LGTM!

There are some comments left by coderabbit, please solve them and we are ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants