Spaces:
Sleeping
Sleeping
saikiran76 commited on
Commit ·
5774aff
0
Parent(s):
Clean deployment without binary history
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .env.example +11 -0
- .gitignore +2 -0
- __init__.py +1 -0
- __pycache__/config.cpython-314.pyc +0 -0
- __pycache__/server.cpython-314.pyc +0 -0
- agents/__init__.py +1 -0
- agents/__pycache__/__init__.cpython-314.pyc +0 -0
- agents/__pycache__/base_agent.cpython-314.pyc +0 -0
- agents/__pycache__/enrollment_agent.cpython-314.pyc +0 -0
- agents/__pycache__/financial_agent.cpython-314.pyc +0 -0
- agents/__pycache__/identity_agent.cpython-314.pyc +0 -0
- agents/__pycache__/narrative.cpython-314.pyc +0 -0
- agents/__pycache__/sponsor_agent.cpython-314.pyc +0 -0
- agents/__pycache__/temporal_agent.cpython-314.pyc +0 -0
- agents/base_agent.py +168 -0
- agents/enrollment_agent.py +51 -0
- agents/financial_agent.py +79 -0
- agents/identity_agent.py +57 -0
- agents/narrative.py +170 -0
- agents/sponsor_agent.py +51 -0
- agents/temporal_agent.py +58 -0
- config.py +40 -0
- debug/20260518_092733/cp0_ingestion.json +19 -0
- debug/20260518_092733/cp1_page_01_raw.json +7 -0
- debug/20260518_092733/cp1_page_02_raw.json +7 -0
- debug/20260518_092733/cp2_page_01_extraction.json +89 -0
- debug/20260518_092733/cp2_page_02_extraction.json +89 -0
- debug/20260518_092733/cp3_graph.json +62 -0
- debug/20260518_092733/cp3_graph_summary.txt +27 -0
- debug/20260518_092733/cp4_enrollment_agent_prompt.json +11 -0
- debug/20260518_092733/cp4_financial_agent_prompt.json +10 -0
- debug/20260518_092733/cp4_identity_agent_prompt.json +9 -0
- debug/20260518_092733/cp4_sponsor_agent_prompt.json +11 -0
- debug/20260518_092733/cp4_temporal_agent_prompt.json +10 -0
- debug/20260518_092733/cp5_enrollment_agent_response.json +41 -0
- debug/20260518_092733/cp5_financial_agent_response.json +41 -0
- debug/20260518_092733/cp5_identity_agent_response.json +29 -0
- debug/20260518_092733/cp5_sponsor_agent_response.json +41 -0
- debug/20260518_092733/cp5_temporal_agent_response.json +29 -0
- debug/20260518_092733/cp6_narrative.json +45 -0
- debug/20260518_092733/run_summary.json +144 -0
- debug/20260518_142500/cp0_ingestion.json +199 -0
- debug/20260518_142500/cp1_page_01_raw.json +7 -0
- debug/20260518_142500/cp1_page_02_raw.json +7 -0
- debug/20260518_142500/cp1_page_03_raw.json +7 -0
- debug/20260518_142500/cp1_page_04_raw.json +7 -0
- debug/20260518_142500/cp1_page_05_raw.json +7 -0
- debug/20260518_142500/cp1_page_06_raw.json +7 -0
- debug/20260518_142500/cp1_page_07_raw.json +7 -0
- debug/20260518_142500/cp1_page_08_raw.json +7 -0
.env.example
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ─────────────────────────────────────────────────────────────────────
|
| 2 |
+
# Uplan PoC — Environment Variables
|
| 3 |
+
# ─────────────────────────────────────────────────────────────────────
|
| 4 |
+
# Copy to .env and fill in your values.
|
| 5 |
+
|
| 6 |
+
# ─── Option A: Google AI Studio (default, simpler) ───────────────────
|
| 7 |
+
GEMINI_API_KEY=your_api_key_here
|
| 8 |
+
|
| 9 |
+
# ─── Model Overrides (optional) ─────────────────────────────────────
|
| 10 |
+
# FLASH_MODEL=gemini-2.0-flash
|
| 11 |
+
# PRO_MODEL=gemini-2.5-pro-preview-05-06
|
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.env
|
| 2 |
+
.env.exampletest_files/
|
__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Uplan — Adversarial Immigration Document Intelligence
|
__pycache__/config.cpython-314.pyc
ADDED
|
Binary file (2.13 kB). View file
|
|
|
__pycache__/server.cpython-314.pyc
ADDED
|
Binary file (31.6 kB). View file
|
|
|
agents/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Specialist agents — Gemini Pro reasoning on semantic graph
|
agents/__pycache__/__init__.cpython-314.pyc
ADDED
|
Binary file (185 Bytes). View file
|
|
|
agents/__pycache__/base_agent.cpython-314.pyc
ADDED
|
Binary file (10.1 kB). View file
|
|
|
agents/__pycache__/enrollment_agent.cpython-314.pyc
ADDED
|
Binary file (3.19 kB). View file
|
|
|
agents/__pycache__/financial_agent.cpython-314.pyc
ADDED
|
Binary file (5.21 kB). View file
|
|
|
agents/__pycache__/identity_agent.cpython-314.pyc
ADDED
|
Binary file (3.74 kB). View file
|
|
|
agents/__pycache__/narrative.cpython-314.pyc
ADDED
|
Binary file (9 kB). View file
|
|
|
agents/__pycache__/sponsor_agent.cpython-314.pyc
ADDED
|
Binary file (3.21 kB). View file
|
|
|
agents/__pycache__/temporal_agent.cpython-314.pyc
ADDED
|
Binary file (3.8 kB). View file
|
|
|
agents/base_agent.py
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Uplan Base Specialist Agent
|
| 3 |
+
|
| 4 |
+
Abstract base class for all 5 domain agents.
|
| 5 |
+
Handles: graph subset extraction, rule filtering, Gemini Pro call with
|
| 6 |
+
structured output, and exponential backoff retry for rate limits.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import random
|
| 12 |
+
import time
|
| 13 |
+
from abc import ABC, abstractmethod
|
| 14 |
+
from typing import Optional
|
| 15 |
+
|
| 16 |
+
from pydantic import BaseModel, Field
|
| 17 |
+
|
| 18 |
+
from config import (
|
| 19 |
+
PRO_MODEL,
|
| 20 |
+
API_RETRY_ATTEMPTS,
|
| 21 |
+
API_RETRY_BASE_DELAY,
|
| 22 |
+
API_RETRY_MAX_DELAY,
|
| 23 |
+
client,
|
| 24 |
+
)
|
| 25 |
+
from orchestrator.state import UplanState
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class Anomaly(BaseModel):
|
| 29 |
+
"""A single anomaly detected by a specialist agent."""
|
| 30 |
+
field_path: str = Field(description="Dot-path to the relevant graph field, e.g. 'financial.spikes[0].amount'")
|
| 31 |
+
severity: str = Field(description="'critical', 'warning', or 'info'")
|
| 32 |
+
explanation: str = Field(description="Plain English explanation, 1-2 sentences")
|
| 33 |
+
rule_id: Optional[str] = Field(default=None, description="Links back to rule engine finding if applicable")
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
class AgentFinding(BaseModel):
|
| 37 |
+
"""Structured output from each specialist agent."""
|
| 38 |
+
agent_id: str = Field(description="Identifier of the agent producing this finding")
|
| 39 |
+
anomalies: list[Anomaly] = Field(default_factory=list, description="All detected anomalies")
|
| 40 |
+
confidence: float = Field(description="Agent confidence in its assessment, 0.0-1.0")
|
| 41 |
+
agent_verdict: str = Field(description="'pass', 'flag', or 'critical'")
|
| 42 |
+
summary: str = Field(description="1-sentence summary for the narrative agent")
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
class BaseSpecialistAgent(ABC):
|
| 46 |
+
"""
|
| 47 |
+
Abstract base for domain specialist agents.
|
| 48 |
+
Subclasses override agent_id, focus_nodes, and _build_prompt().
|
| 49 |
+
"""
|
| 50 |
+
agent_id: str
|
| 51 |
+
focus_nodes: list[str] # Which keys to pull from semantic_graph
|
| 52 |
+
|
| 53 |
+
def _extract_focus(self, graph: dict) -> dict:
|
| 54 |
+
"""Extract only the graph nodes relevant to this agent."""
|
| 55 |
+
return {k: graph[k] for k in self.focus_nodes if k in graph and graph[k]}
|
| 56 |
+
|
| 57 |
+
def _relevant_rules(self, rule_findings: list[dict]) -> list[dict]:
|
| 58 |
+
"""Filter rule findings to this agent's primary domain."""
|
| 59 |
+
prefix = self.focus_nodes[0] # Primary domain
|
| 60 |
+
return [r for r in rule_findings if r.get("field_path", "").startswith(prefix)]
|
| 61 |
+
|
| 62 |
+
@abstractmethod
|
| 63 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 64 |
+
"""Build the domain-specific reasoning prompt."""
|
| 65 |
+
pass
|
| 66 |
+
|
| 67 |
+
def _call_with_retry(self, prompt: str) -> AgentFinding:
|
| 68 |
+
"""Call Gemini Pro with exponential backoff retry on rate limits."""
|
| 69 |
+
last_err = None
|
| 70 |
+
for attempt in range(API_RETRY_ATTEMPTS):
|
| 71 |
+
try:
|
| 72 |
+
response = client.models.generate_content(
|
| 73 |
+
model=PRO_MODEL,
|
| 74 |
+
contents=prompt,
|
| 75 |
+
config={
|
| 76 |
+
"response_mime_type": "application/json",
|
| 77 |
+
"response_schema": AgentFinding,
|
| 78 |
+
},
|
| 79 |
+
)
|
| 80 |
+
return response.parsed
|
| 81 |
+
except Exception as e:
|
| 82 |
+
last_err = e
|
| 83 |
+
err_str = str(e)
|
| 84 |
+
is_rate_limit = "429" in err_str or "RESOURCE_EXHAUSTED" in err_str
|
| 85 |
+
|
| 86 |
+
if is_rate_limit and attempt < API_RETRY_ATTEMPTS - 1:
|
| 87 |
+
delay = min(
|
| 88 |
+
API_RETRY_BASE_DELAY * (2 ** attempt) + random.uniform(0, 1),
|
| 89 |
+
API_RETRY_MAX_DELAY,
|
| 90 |
+
)
|
| 91 |
+
print(f" [WAIT] {self.agent_id}: rate limited, retry in {delay:.0f}s (attempt {attempt + 1}/{API_RETRY_ATTEMPTS})")
|
| 92 |
+
time.sleep(delay)
|
| 93 |
+
elif not is_rate_limit:
|
| 94 |
+
break
|
| 95 |
+
|
| 96 |
+
raise last_err
|
| 97 |
+
|
| 98 |
+
def run(self, state: UplanState) -> dict:
|
| 99 |
+
"""Execute this agent: extract focus -> build prompt -> Gemini Pro -> return finding."""
|
| 100 |
+
graph = state["semantic_graph"]
|
| 101 |
+
graph_subset = self._extract_focus(graph)
|
| 102 |
+
relevant_rules = self._relevant_rules(state.get("rule_findings", []))
|
| 103 |
+
|
| 104 |
+
# Inject document type context so agents understand what they're looking at
|
| 105 |
+
doc_types = graph.get("source_doc_types", [])
|
| 106 |
+
source_is_affidavit = graph.get("financial", {}).get("source_is_affidavit", False)
|
| 107 |
+
|
| 108 |
+
jurisdiction = ""
|
| 109 |
+
if state.get("visa_context"):
|
| 110 |
+
jurisdiction = state["visa_context"].get("jurisdiction_context", "")
|
| 111 |
+
|
| 112 |
+
# Augment graph_subset with document context + dossier completeness
|
| 113 |
+
all_possible_types = [
|
| 114 |
+
"passport", "bank_statement", "payslip", "tax_return",
|
| 115 |
+
"sponsor_letter", "employment_letter", "enrollment_letter", "affidavit",
|
| 116 |
+
]
|
| 117 |
+
present_types = set(doc_types)
|
| 118 |
+
missing_types = [t for t in all_possible_types if t not in present_types]
|
| 119 |
+
|
| 120 |
+
graph_subset["_document_context"] = {
|
| 121 |
+
"source_doc_types": doc_types,
|
| 122 |
+
"missing_doc_types": missing_types,
|
| 123 |
+
"is_partial_dossier": len(missing_types) > 0,
|
| 124 |
+
"source_is_affidavit": source_is_affidavit,
|
| 125 |
+
"note": (
|
| 126 |
+
"IMPORTANT: If source_is_affidavit=True and 'bank_statement' is NOT in source_doc_types, "
|
| 127 |
+
"then transaction_count=0 is EXPECTED and NORMAL. An affidavit declares static balances, "
|
| 128 |
+
"it does NOT have transaction history. Do NOT flag zero transactions as 'funds parking' "
|
| 129 |
+
"when the only financial document is an affidavit. Instead flag the ABSENCE of bank statements."
|
| 130 |
+
) if source_is_affidavit and "bank_statement" not in doc_types else "Standard multi-document analysis.",
|
| 131 |
+
"partial_dossier_instructions": (
|
| 132 |
+
"THIS IS A PARTIAL DOSSIER. The user has NOT uploaded all required documents yet. "
|
| 133 |
+
f"Missing: {missing_types}. "
|
| 134 |
+
"RULES: 1) If a data node is null because the corresponding document was not uploaded, "
|
| 135 |
+
"classify this as 'info' severity with explanation 'Document not provided — required for complete audit.' "
|
| 136 |
+
"Do NOT escalate missing-document gaps to 'critical'. "
|
| 137 |
+
"2) ONLY flag as 'critical' genuine anomalies found WITHIN the provided documents "
|
| 138 |
+
"(e.g., smurfing, unexplained spikes, forged data, balance discontinuities). "
|
| 139 |
+
"3) Set agent_verdict to 'flag' for missing-doc issues, reserve 'critical' for real anomalies."
|
| 140 |
+
) if len(missing_types) > 0 else "Complete dossier — standard adversarial analysis.",
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
prompt = self._build_prompt(graph_subset, relevant_rules, jurisdiction)
|
| 144 |
+
logger = state.get("_debug_logger")
|
| 145 |
+
|
| 146 |
+
# CP4 -- log exact prompt sent to Pro
|
| 147 |
+
if logger:
|
| 148 |
+
logger.cp4_agent_prompt(self.agent_id, prompt, self.focus_nodes)
|
| 149 |
+
|
| 150 |
+
t0 = time.time()
|
| 151 |
+
parse_error = None
|
| 152 |
+
try:
|
| 153 |
+
finding = self._call_with_retry(prompt)
|
| 154 |
+
except Exception as e:
|
| 155 |
+
parse_error = str(e)
|
| 156 |
+
raise
|
| 157 |
+
|
| 158 |
+
finding.agent_id = self.agent_id
|
| 159 |
+
elapsed = time.time() - t0
|
| 160 |
+
|
| 161 |
+
# CP5 -- log agent response
|
| 162 |
+
if logger:
|
| 163 |
+
logger.cp5_agent_response(self.agent_id, finding.model_dump(), elapsed, parse_error)
|
| 164 |
+
|
| 165 |
+
return {
|
| 166 |
+
"agent_findings": [finding.model_dump()],
|
| 167 |
+
"completed_agents": [self.agent_id],
|
| 168 |
+
}
|
agents/enrollment_agent.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Enrollment Specialist Agent
|
| 3 |
+
|
| 4 |
+
Probes: program cost vs available balance, CoE date vs visa dates,
|
| 5 |
+
study duration feasibility, institution verification signals.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
from agents.base_agent import BaseSpecialistAgent
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class EnrollmentAgent(BaseSpecialistAgent):
|
| 16 |
+
agent_id = "enrollment_agent"
|
| 17 |
+
focus_nodes = ["enrollment", "financial", "temporal"]
|
| 18 |
+
|
| 19 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 20 |
+
ctx_block = f"\nJURISDICTION CONTEXT:\n{jurisdiction}\n" if jurisdiction else ""
|
| 21 |
+
dossier_ctx = graph_subset.get("_document_context", {})
|
| 22 |
+
partial_note = dossier_ctx.get("partial_dossier_instructions", "")
|
| 23 |
+
return f"""You are an adversarial pre-submission auditor reviewing enrollment documentation.
|
| 24 |
+
Your task: identify enrollment/financial inconsistencies in the PROVIDED documents and flag missing
|
| 25 |
+
enrollment documents as informational gaps.
|
| 26 |
+
{ctx_block}
|
| 27 |
+
DOSSIER COMPLETENESS: {partial_note}
|
| 28 |
+
|
| 29 |
+
ENROLLMENT DATA:
|
| 30 |
+
{json.dumps(graph_subset.get("enrollment"), indent=2)}
|
| 31 |
+
|
| 32 |
+
FINANCIAL DATA:
|
| 33 |
+
{json.dumps(graph_subset.get("financial"), indent=2)}
|
| 34 |
+
|
| 35 |
+
TEMPORAL DATA:
|
| 36 |
+
{json.dumps(graph_subset.get("temporal"), indent=2)}
|
| 37 |
+
|
| 38 |
+
RULE ENGINE FLAGS (already detected):
|
| 39 |
+
{json.dumps(rule_findings, indent=2)}
|
| 40 |
+
|
| 41 |
+
Analyse the following — be specific, cite exact values:
|
| 42 |
+
1. Does the applicant's closing_balance cover program_cost? Show the arithmetic.
|
| 43 |
+
Include a living expense estimate (~$1,500/month × duration_months) if relevant.
|
| 44 |
+
2. Does enrollment_start align with the visa application timeline?
|
| 45 |
+
3. Is the program_duration_months realistic for the stated program?
|
| 46 |
+
4. If funds_cover_full_stay is false, quantify the shortfall exactly.
|
| 47 |
+
5. If no enrollment data exists (null), classify as 'info' severity — enrollment documents
|
| 48 |
+
may not have been uploaded yet, or this may be a non-student visa.
|
| 49 |
+
Do NOT treat missing enrollment as a critical rejection issue.
|
| 50 |
+
|
| 51 |
+
Respond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."""
|
agents/financial_agent.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Financial Specialist Agent
|
| 3 |
+
|
| 4 |
+
Probes: spike explanation, income-balance coherence, unlabeled deposits,
|
| 5 |
+
cross-document income discrepancies (payslip vs bank deposit amounts).
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
from agents.base_agent import BaseSpecialistAgent
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class FinancialAgent(BaseSpecialistAgent):
|
| 16 |
+
agent_id = "financial_agent"
|
| 17 |
+
focus_nodes = ["financial", "identity"]
|
| 18 |
+
|
| 19 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 20 |
+
ctx_block = f"\nJURISDICTION CONTEXT:\n{jurisdiction}\n" if jurisdiction else ""
|
| 21 |
+
dossier_ctx = graph_subset.get("_document_context", {})
|
| 22 |
+
partial_note = dossier_ctx.get("partial_dossier_instructions", "")
|
| 23 |
+
return f"""You are an adversarial pre-submission auditor reviewing financial documents.
|
| 24 |
+
Your task: identify genuine financial anomalies in the PROVIDED documents. Focus on patterns that
|
| 25 |
+
indicate fund manipulation, smurfing, or unexplained activity — NOT on missing documents.
|
| 26 |
+
{ctx_block}
|
| 27 |
+
DOSSIER COMPLETENESS: {partial_note}
|
| 28 |
+
|
| 29 |
+
FINANCIAL DATA:
|
| 30 |
+
{json.dumps(graph_subset.get("financial"), indent=2)}
|
| 31 |
+
|
| 32 |
+
APPLICANT IDENTITY:
|
| 33 |
+
{json.dumps(graph_subset.get("identity"), indent=2)}
|
| 34 |
+
|
| 35 |
+
RULE ENGINE FLAGS (already detected):
|
| 36 |
+
{json.dumps(rule_findings, indent=2)}
|
| 37 |
+
|
| 38 |
+
Analyse the following — be specific, cite exact values:
|
| 39 |
+
1. For each spike in spikes[]: is there a plausible source? If unlabeled, flag as warning or critical
|
| 40 |
+
based on the severity of the spike ratio and clustering pattern.
|
| 41 |
+
2. Does avg_monthly_income × visa_duration cover declared costs? Show the arithmetic.
|
| 42 |
+
If income data is missing because payslips haven't been uploaded, note this as 'info' not 'critical'.
|
| 43 |
+
3. Does the balance trajectory make sense given declared income? Flag any impossible accumulation.
|
| 44 |
+
4. Are there cross-document income discrepancies (payslip vs bank deposit amounts)?
|
| 45 |
+
5. If the closing balance is below a threshold, note the current documented balance and suggest
|
| 46 |
+
the user upload additional accounts to meet the requirement — do NOT issue a hard rejection.
|
| 47 |
+
6. Aggregate balances across ALL provided accounts before assessing financial thresholds.
|
| 48 |
+
|
| 49 |
+
SEVERITY GUIDE:
|
| 50 |
+
- 'critical': Genuine anomalies WITHIN the data (smurfing clusters, forged amounts, impossible balances)
|
| 51 |
+
- 'warning': Suspicious patterns that need explanation (large unlabeled deposits, unusual spikes)
|
| 52 |
+
- 'info': Missing data because documents haven't been uploaded yet
|
| 53 |
+
|
| 54 |
+
CRITICAL RULE — SMURFING vs PASS-THROUGH:
|
| 55 |
+
Before flagging inbound deposits as 'smurfing' or 'fund parking', you MUST look at the subsequent
|
| 56 |
+
outbound debits within a 24-48 hour window. If a large deposit is followed almost immediately by
|
| 57 |
+
outbound transfers of similar amounts to the same recipient (a 'pass-through' pattern), it is
|
| 58 |
+
NOT smurfing, because the funds are not inflating the closing balance.
|
| 59 |
+
|
| 60 |
+
Example of PASS-THROUGH (NOT smurfing):
|
| 61 |
+
Aug 17: 30,000 IN → Aug 17: 28,000 OUT to same payee → net impact: +2,000
|
| 62 |
+
Aug 18: 30,000 IN → Aug 18: 30,000 OUT to same payee → net impact: 0
|
| 63 |
+
|
| 64 |
+
This is a transit/conduit pattern where the account is used as a pipeline. The balance barely moves.
|
| 65 |
+
Only flag as smurfing if the deposits ACCUMULATE and the closing balance grows significantly
|
| 66 |
+
as a result of the clustered deposits WITHOUT corresponding outflows.
|
| 67 |
+
|
| 68 |
+
Assess the NET IMPACT of each transaction cluster before classifying it.
|
| 69 |
+
|
| 70 |
+
UPI/MICRO-TRANSACTION RULE:
|
| 71 |
+
Do NOT count or flag micro-transactions (inbound transfers under 10,000 INR / 100 USD equivalent)
|
| 72 |
+
as 'unlabeled deposits' or suspicious activity. In modern digital banking (especially India's UPI
|
| 73 |
+
ecosystem), high volumes of small peer-to-peer transfers are completely normal daily behavior —
|
| 74 |
+
lunch splits, shared bills, small reimbursements, etc.
|
| 75 |
+
Only flag deposits as 'unlabeled' or suspicious if they are LARGE, distinct deposits (> 25,000 INR)
|
| 76 |
+
that lack a clear source (like salary, business income, or identifiable sender).
|
| 77 |
+
When reporting unlabeled_deposit_count, exclude micro-transactions from the count entirely.
|
| 78 |
+
|
| 79 |
+
Respond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."""
|
agents/identity_agent.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Identity Specialist Agent
|
| 3 |
+
|
| 4 |
+
Probes: name variant analysis, transliteration mismatches,
|
| 5 |
+
cross-document identity coherence, passport-to-document name matching.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
from agents.base_agent import BaseSpecialistAgent
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class IdentityAgent(BaseSpecialistAgent):
|
| 16 |
+
agent_id = "identity_agent"
|
| 17 |
+
focus_nodes = ["identity"]
|
| 18 |
+
|
| 19 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 20 |
+
ctx_block = f"\nJURISDICTION CONTEXT:\n{jurisdiction}\n" if jurisdiction else ""
|
| 21 |
+
dossier_ctx = graph_subset.get("_document_context", {})
|
| 22 |
+
partial_note = dossier_ctx.get("partial_dossier_instructions", "")
|
| 23 |
+
return f"""You are an adversarial pre-submission auditor reviewing identity documents.
|
| 24 |
+
Your task: identify identity inconsistencies in the PROVIDED documents and flag missing identity documents
|
| 25 |
+
as informational gaps — NOT as rejection grounds.
|
| 26 |
+
{ctx_block}
|
| 27 |
+
DOSSIER COMPLETENESS: {partial_note}
|
| 28 |
+
|
| 29 |
+
IDENTITY DATA:
|
| 30 |
+
{json.dumps(graph_subset.get("identity"), indent=2)}
|
| 31 |
+
|
| 32 |
+
RULE ENGINE FLAGS (already detected):
|
| 33 |
+
{json.dumps(rule_findings, indent=2)}
|
| 34 |
+
|
| 35 |
+
Analyse the following — be specific, cite exact field paths:
|
| 36 |
+
1. Are all name_variants plausibly the same person? Consider transliteration rules
|
| 37 |
+
(e.g. Japanese: family-first vs given-first, romanisation differences).
|
| 38 |
+
2. If cross_doc_name_match is false, is this a genuine mismatch or an expected
|
| 39 |
+
transliteration variation? Rate the severity.
|
| 40 |
+
3. Check for date_of_birth consistency — is it the same across all documents?
|
| 41 |
+
4. Does the passport_number match the identity page expectations for the stated nationality?
|
| 42 |
+
5. If passport data is null, classify as 'info' severity — the passport document has not been uploaded yet.
|
| 43 |
+
Do NOT treat missing passport as a critical rejection issue.
|
| 44 |
+
|
| 45 |
+
CRITICAL ROLE RESOLUTION:
|
| 46 |
+
Before checking for name mismatches, review Affidavit or Sponsor letters to establish roles.
|
| 47 |
+
If Document A (Passport) belongs to the Applicant and Document B (Bank Statement) belongs to a
|
| 48 |
+
Sponsor/Parent/Guardian, DO NOT flag this as a name mismatch. They are two distinct, verified
|
| 49 |
+
individuals linked by the Affidavit. Different names across documents belonging to DIFFERENT PEOPLE
|
| 50 |
+
are expected and correct — not fraud.
|
| 51 |
+
Only flag mismatches if:
|
| 52 |
+
a) The APPLICANT'S name is spelled differently across the applicant's own documents, OR
|
| 53 |
+
b) The SPONSOR'S name is spelled differently across the sponsor's own documents.
|
| 54 |
+
A father's bank statement showing 'SATYANARAYANA' alongside a son's passport showing 'SAI KIRAN'
|
| 55 |
+
is a normal sponsor-applicant relationship, NOT an identity discrepancy.
|
| 56 |
+
|
| 57 |
+
Respond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."""
|
agents/narrative.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Narrative Synthesis Agent
|
| 3 |
+
|
| 4 |
+
Receives ALL 5 specialist agent findings + rule engine findings + full semantic graph.
|
| 5 |
+
Produces: verdict, risk score, rejection narrative, rebuttal guidance, citations.
|
| 6 |
+
Includes exponential backoff retry for rate limits.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import json
|
| 12 |
+
import random
|
| 13 |
+
import time
|
| 14 |
+
from typing import Optional
|
| 15 |
+
|
| 16 |
+
from pydantic import BaseModel, Field
|
| 17 |
+
|
| 18 |
+
from config import (
|
| 19 |
+
PRO_MODEL,
|
| 20 |
+
API_RETRY_ATTEMPTS,
|
| 21 |
+
API_RETRY_BASE_DELAY,
|
| 22 |
+
API_RETRY_MAX_DELAY,
|
| 23 |
+
client,
|
| 24 |
+
)
|
| 25 |
+
from orchestrator.state import UplanState
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class NarrativeVerdict(BaseModel):
|
| 29 |
+
"""Final cross-document verdict -- the output of the entire Uplan pipeline."""
|
| 30 |
+
verdict: str = Field(description="'PASS', 'CONDITIONAL', 'INCOMPLETE_DOSSIER', or 'FAIL'")
|
| 31 |
+
risk_score: float = Field(description="0.0 = clean application, 1.0 = near-certain rejection")
|
| 32 |
+
missing_documents: list[str] = Field(
|
| 33 |
+
default_factory=list,
|
| 34 |
+
description="Document types that are missing from the dossier (e.g. 'passport', 'enrollment_letter')",
|
| 35 |
+
)
|
| 36 |
+
critical_issues: list[str] = Field(default_factory=list, description="Bullet-point critical issues found WITHIN provided documents")
|
| 37 |
+
warning_issues: list[str] = Field(default_factory=list, description="Bullet-point warnings")
|
| 38 |
+
rejection_narrative: str = Field(
|
| 39 |
+
description="Pre-submission audit narrative — formal, specific, distinguishing anomalies from missing docs"
|
| 40 |
+
)
|
| 41 |
+
rebuttal_guidance: list[str] = Field(
|
| 42 |
+
default_factory=list,
|
| 43 |
+
description="For each issue: what additional document or explanation would resolve it",
|
| 44 |
+
)
|
| 45 |
+
citations: list[str] = Field(
|
| 46 |
+
default_factory=list,
|
| 47 |
+
description="Graph node paths supporting each finding (e.g. 'financial.spikes[0]')",
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
# All document types that constitute a complete dossier
|
| 52 |
+
COMPLETE_DOSSIER_TYPES = [
|
| 53 |
+
"passport", "bank_statement", "payslip", "tax_return",
|
| 54 |
+
"sponsor_letter", "employment_letter", "enrollment_letter", "affidavit",
|
| 55 |
+
]
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
class NarrativeAgent:
|
| 59 |
+
"""Cross-document synthesis agent -- the final reasoning step."""
|
| 60 |
+
|
| 61 |
+
def run(self, state: UplanState) -> dict:
|
| 62 |
+
graph = state["semantic_graph"]
|
| 63 |
+
doc_types = graph.get("source_doc_types", [])
|
| 64 |
+
source_is_affidavit = graph.get("financial", {}).get("source_is_affidavit", False)
|
| 65 |
+
|
| 66 |
+
# Compute dossier completeness
|
| 67 |
+
present = set(doc_types)
|
| 68 |
+
missing = [d for d in COMPLETE_DOSSIER_TYPES if d not in present]
|
| 69 |
+
is_partial = len(missing) > 0
|
| 70 |
+
|
| 71 |
+
doc_context_note = ""
|
| 72 |
+
if source_is_affidavit and "bank_statement" not in doc_types:
|
| 73 |
+
doc_context_note = (
|
| 74 |
+
"\n\nDOCUMENT CONTEXT: The financial data comes ONLY from an affidavit (sworn declaration). "
|
| 75 |
+
"An affidavit legitimately has zero bank transactions -- it declares point-in-time asset values. "
|
| 76 |
+
"Do NOT cite 'zero transactions' as evidence of fraud. Instead, note that actual bank statements "
|
| 77 |
+
"are MISSING and must be submitted."
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
partial_dossier_instructions = ""
|
| 81 |
+
if is_partial:
|
| 82 |
+
partial_dossier_instructions = f"""
|
| 83 |
+
|
| 84 |
+
CRITICAL CONTEXT — PARTIAL DOSSIER:
|
| 85 |
+
The user has uploaded ONLY these document types: {doc_types}
|
| 86 |
+
The following document types are MISSING: {missing}
|
| 87 |
+
|
| 88 |
+
RULES FOR PARTIAL DOSSIER:
|
| 89 |
+
1. You MUST set verdict to "INCOMPLETE_DOSSIER" (not FAIL) because the user has not submitted all documents yet.
|
| 90 |
+
2. List all missing document types in the missing_documents field.
|
| 91 |
+
3. DO NOT treat missing data nodes (null passport, null enrollment, null sponsor) as rejection-worthy anomalies.
|
| 92 |
+
These are simply documents the user has not uploaded yet.
|
| 93 |
+
4. ONLY flag as "critical" issues that represent genuine anomalies WITHIN the provided documents
|
| 94 |
+
(e.g., smurfing patterns, unexplained spikes, forged signatures, balance discontinuities).
|
| 95 |
+
5. The risk_score should reflect the risk of the PROVIDED documents only, not penalize for missing docs.
|
| 96 |
+
A clean bank statement with no anomalies but missing passport = risk 0.2-0.3, NOT 0.99.
|
| 97 |
+
6. In rejection_narrative, frame it as a pre-submission audit report, NOT a visa denial letter.
|
| 98 |
+
Example tone: "The provided bank statement shows X anomalies that require attention before submission.
|
| 99 |
+
Additionally, the following documents must be uploaded to complete the dossier: [list]."
|
| 100 |
+
7. In rebuttal_guidance, list actionable steps to complete the dossier and address any real anomalies."""
|
| 101 |
+
|
| 102 |
+
prompt = f"""You are an adversarial pre-submission auditor. Your job is to identify gaps and anomalies
|
| 103 |
+
BEFORE the applicant submits their visa package to the embassy. You are helping them strengthen their case,
|
| 104 |
+
not judging them.
|
| 105 |
+
|
| 106 |
+
DOCUMENT TYPES PROCESSED: {doc_types}
|
| 107 |
+
{doc_context_note}
|
| 108 |
+
{partial_dossier_instructions}
|
| 109 |
+
|
| 110 |
+
SEMANTIC GRAPH (full document picture):
|
| 111 |
+
{json.dumps(graph, indent=2)}
|
| 112 |
+
|
| 113 |
+
RULE ENGINE FINDINGS:
|
| 114 |
+
{json.dumps(state.get("rule_findings", []), indent=2)}
|
| 115 |
+
|
| 116 |
+
SPECIALIST AGENT FINDINGS:
|
| 117 |
+
{json.dumps(state.get("agent_findings", []), indent=2)}
|
| 118 |
+
|
| 119 |
+
Your task:
|
| 120 |
+
1. Synthesise ALL findings into a single coherent verdict.
|
| 121 |
+
2. Distinguish between:
|
| 122 |
+
a) ACTUAL ANOMALIES found within provided documents (these are critical/warning)
|
| 123 |
+
b) MISSING INFORMATION because documents haven't been uploaded yet (these are info-level gaps)
|
| 124 |
+
3. Write the rejection_narrative as a pre-submission audit: formal, specific, citing document evidence.
|
| 125 |
+
Separate the "Anomalies Found" section from the "Documents Still Required" section.
|
| 126 |
+
4. For each issue, write one rebuttal_guidance item: what additional document or action would resolve it.
|
| 127 |
+
5. Risk score: 0.0 = clean provided documents, 1.0 = severe anomalies in provided documents.
|
| 128 |
+
Do NOT inflate risk score just because documents are missing.
|
| 129 |
+
6. In citations, list the exact graph node paths that support your findings (e.g. 'financial.spikes[0].amount').
|
| 130 |
+
|
| 131 |
+
Respond ONLY with NarrativeVerdict JSON."""
|
| 132 |
+
|
| 133 |
+
t0 = time.time()
|
| 134 |
+
last_err = None
|
| 135 |
+
for attempt in range(API_RETRY_ATTEMPTS):
|
| 136 |
+
try:
|
| 137 |
+
response = client.models.generate_content(
|
| 138 |
+
model=PRO_MODEL,
|
| 139 |
+
contents=prompt,
|
| 140 |
+
config={
|
| 141 |
+
"response_mime_type": "application/json",
|
| 142 |
+
"response_schema": NarrativeVerdict,
|
| 143 |
+
},
|
| 144 |
+
)
|
| 145 |
+
v = response.parsed
|
| 146 |
+
elapsed = time.time() - t0
|
| 147 |
+
|
| 148 |
+
# CP6 -- log narrative synthesis
|
| 149 |
+
logger = state.get("_debug_logger")
|
| 150 |
+
if logger:
|
| 151 |
+
logger.cp6_narrative(prompt, v.model_dump(), elapsed)
|
| 152 |
+
logger.close()
|
| 153 |
+
|
| 154 |
+
return {"verdict": v.model_dump(), "risk_score": v.risk_score}
|
| 155 |
+
except Exception as e:
|
| 156 |
+
last_err = e
|
| 157 |
+
err_str = str(e)
|
| 158 |
+
is_rate_limit = "429" in err_str or "RESOURCE_EXHAUSTED" in err_str
|
| 159 |
+
|
| 160 |
+
if is_rate_limit and attempt < API_RETRY_ATTEMPTS - 1:
|
| 161 |
+
delay = min(
|
| 162 |
+
API_RETRY_BASE_DELAY * (2 ** attempt) + random.uniform(0, 1),
|
| 163 |
+
API_RETRY_MAX_DELAY,
|
| 164 |
+
)
|
| 165 |
+
print(f" [WAIT] narrative: rate limited, retry in {delay:.0f}s (attempt {attempt + 1}/{API_RETRY_ATTEMPTS})")
|
| 166 |
+
time.sleep(delay)
|
| 167 |
+
elif not is_rate_limit:
|
| 168 |
+
break
|
| 169 |
+
|
| 170 |
+
raise last_err
|
agents/sponsor_agent.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Sponsor Specialist Agent
|
| 3 |
+
|
| 4 |
+
Probes: sponsor income vs total trip cost, relationship plausibility,
|
| 5 |
+
jurisdiction verification, income documentation sufficiency.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
from agents.base_agent import BaseSpecialistAgent
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class SponsorAgent(BaseSpecialistAgent):
|
| 16 |
+
agent_id = "sponsor_agent"
|
| 17 |
+
focus_nodes = ["sponsor", "identity", "financial"]
|
| 18 |
+
|
| 19 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 20 |
+
ctx_block = f"\nJURISDICTION CONTEXT:\n{jurisdiction}\n" if jurisdiction else ""
|
| 21 |
+
dossier_ctx = graph_subset.get("_document_context", {})
|
| 22 |
+
partial_note = dossier_ctx.get("partial_dossier_instructions", "")
|
| 23 |
+
return f"""You are an adversarial pre-submission auditor reviewing sponsor documentation.
|
| 24 |
+
Your task: identify sponsorship inconsistencies in the PROVIDED documents and flag missing sponsor
|
| 25 |
+
documents as informational gaps.
|
| 26 |
+
{ctx_block}
|
| 27 |
+
DOSSIER COMPLETENESS: {partial_note}
|
| 28 |
+
|
| 29 |
+
SPONSOR DATA:
|
| 30 |
+
{json.dumps(graph_subset.get("sponsor"), indent=2)}
|
| 31 |
+
|
| 32 |
+
APPLICANT IDENTITY:
|
| 33 |
+
{json.dumps(graph_subset.get("identity"), indent=2)}
|
| 34 |
+
|
| 35 |
+
APPLICANT FINANCIAL DATA:
|
| 36 |
+
{json.dumps(graph_subset.get("financial"), indent=2)}
|
| 37 |
+
|
| 38 |
+
RULE ENGINE FLAGS (already detected):
|
| 39 |
+
{json.dumps(rule_findings, indent=2)}
|
| 40 |
+
|
| 41 |
+
Analyse the following — be specific, cite exact values:
|
| 42 |
+
1. Does the sponsor's declared_income realistically cover the applicant's total costs
|
| 43 |
+
(tuition + living expenses + travel)? Show the arithmetic.
|
| 44 |
+
2. Is the stated relationship plausible? (e.g. "uncle" sponsoring a non-relative is suspicious)
|
| 45 |
+
3. If income_supports_coverage is false, quantify the shortfall.
|
| 46 |
+
4. Does the sponsor's income_currency match the jurisdiction where they claim to reside?
|
| 47 |
+
5. If no sponsor data exists (null), classify as 'info' severity — the sponsor documents
|
| 48 |
+
have not been uploaded yet. The applicant may be self-funded or sponsor docs are pending.
|
| 49 |
+
Do NOT treat missing sponsor as a critical rejection issue.
|
| 50 |
+
|
| 51 |
+
Respond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."""
|
agents/temporal_agent.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Temporal Specialist Agent
|
| 3 |
+
|
| 4 |
+
Probes: employment gap arithmetic, date range overlaps, visa window fit,
|
| 5 |
+
chronological consistency across documents.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
from agents.base_agent import BaseSpecialistAgent
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class TemporalAgent(BaseSpecialistAgent):
|
| 16 |
+
agent_id = "temporal_agent"
|
| 17 |
+
focus_nodes = ["temporal", "financial"]
|
| 18 |
+
|
| 19 |
+
def _build_prompt(self, graph_subset: dict, rule_findings: list[dict], jurisdiction: str) -> str:
|
| 20 |
+
ctx_block = f"\nJURISDICTION CONTEXT:\n{jurisdiction}\n" if jurisdiction else ""
|
| 21 |
+
dossier_ctx = graph_subset.get("_document_context", {})
|
| 22 |
+
partial_note = dossier_ctx.get("partial_dossier_instructions", "")
|
| 23 |
+
return f"""You are an adversarial pre-submission auditor reviewing the timeline of an application.
|
| 24 |
+
Your task: identify temporal inconsistencies in the PROVIDED documents. Missing temporal data due to
|
| 25 |
+
un-uploaded documents should be flagged as 'info', not 'critical'.
|
| 26 |
+
{ctx_block}
|
| 27 |
+
DOSSIER COMPLETENESS: {partial_note}
|
| 28 |
+
|
| 29 |
+
TEMPORAL DATA:
|
| 30 |
+
{json.dumps(graph_subset.get("temporal"), indent=2)}
|
| 31 |
+
|
| 32 |
+
FINANCIAL DATA (for date cross-reference):
|
| 33 |
+
{json.dumps(graph_subset.get("financial"), indent=2)}
|
| 34 |
+
|
| 35 |
+
RULE ENGINE FLAGS (already detected):
|
| 36 |
+
{json.dumps(rule_findings, indent=2)}
|
| 37 |
+
|
| 38 |
+
Analyse the following — be specific, cite exact dates:
|
| 39 |
+
1. Do employment_start and employment_end form a continuous period? Flag any gaps.
|
| 40 |
+
2. Do the doc_date_ranges overlap logically? A bank statement ending after an
|
| 41 |
+
employment letter's issue date is normal; the reverse is suspicious.
|
| 42 |
+
3. If visa_window_start/end exist, does the employment and financial history
|
| 43 |
+
cover the required pre-application period (typically 3-6 months)?
|
| 44 |
+
4. Check chronology_valid — if false, explain what dates are logically impossible.
|
| 45 |
+
5. Are transaction dates within the stated employment period?
|
| 46 |
+
6. If employment dates are null because employment letters haven't been uploaded,
|
| 47 |
+
classify as 'info' severity — not a critical temporal anomaly.
|
| 48 |
+
|
| 49 |
+
CRITICAL RULE — BANK STATEMENT DATE GAPS:
|
| 50 |
+
Bank statements only record days with active transactions. Gaps of days or even weeks between
|
| 51 |
+
transaction dates are COMPLETELY NORMAL human behavior — people do not transact every single day.
|
| 52 |
+
Do NOT flag date gaps as 'missing days', 'discontinuities', or 'suspicious gaps' UNLESS:
|
| 53 |
+
a) The running mathematical balance breaks (e.g., closing balance on page N does not match
|
| 54 |
+
opening balance on page N+1), OR
|
| 55 |
+
b) Page numbers are explicitly missing from the sequence (e.g., page 5 jumps to page 7).
|
| 56 |
+
A person who buys something on April 24th and then next on May 7th is normal. Do NOT flag this.
|
| 57 |
+
|
| 58 |
+
Respond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."""
|
config.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Uplan -- Central Configuration
|
| 3 |
+
Initializes the Gemini client and exposes model names + rule thresholds.
|
| 4 |
+
Uses Google AI Studio directly via API key.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import os
|
| 8 |
+
from dotenv import load_dotenv
|
| 9 |
+
from google import genai
|
| 10 |
+
|
| 11 |
+
load_dotenv()
|
| 12 |
+
|
| 13 |
+
# -- Client Initialization ------------------------------------------------
|
| 14 |
+
# Using Google AI Studio directly via API key.
|
| 15 |
+
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
|
| 16 |
+
|
| 17 |
+
# -- Model Selection -------------------------------------------------------
|
| 18 |
+
# Available models confirmed via models.list():
|
| 19 |
+
# Extraction: gemini-3-flash-preview (fast, vision-capable)
|
| 20 |
+
# Reasoning: gemini-3.1-pro-preview (smart, structured output)
|
| 21 |
+
FLASH_MODEL = os.environ.get("FLASH_MODEL", "gemini-3-flash-preview")
|
| 22 |
+
PRO_MODEL = os.environ.get("PRO_MODEL", "gemini-3.1-pro-preview")
|
| 23 |
+
|
| 24 |
+
# -- Rate Limit / Retry Config --------------------------------------------
|
| 25 |
+
# With paid credits, rate limits are generous. Keeping retry logic as safety net.
|
| 26 |
+
MAX_CONCURRENT_PAGES = int(os.environ.get("MAX_CONCURRENT_PAGES", "5"))
|
| 27 |
+
API_RETRY_ATTEMPTS = int(os.environ.get("API_RETRY_ATTEMPTS", "3"))
|
| 28 |
+
API_RETRY_BASE_DELAY = float(os.environ.get("API_RETRY_BASE_DELAY", "2.0"))
|
| 29 |
+
API_RETRY_MAX_DELAY = float(os.environ.get("API_RETRY_MAX_DELAY", "30.0"))
|
| 30 |
+
INTER_AGENT_DELAY = float(os.environ.get("INTER_AGENT_DELAY", "1.0"))
|
| 31 |
+
|
| 32 |
+
# -- Rule Engine Thresholds ------------------------------------------------
|
| 33 |
+
# Hardcoded for PoC. Will be RAG-fed from policy store in production.
|
| 34 |
+
ALPHA_SPIKE_RATIO = float(os.environ.get("ALPHA_SPIKE_RATIO", "3.0"))
|
| 35 |
+
EPSILON_INCOME_COHERENCE = float(os.environ.get("EPSILON_INCOME_COHERENCE", "0.20"))
|
| 36 |
+
DELTA_GAP_WARN_DAYS = int(os.environ.get("DELTA_GAP_WARN_DAYS", "30"))
|
| 37 |
+
DELTA_GAP_CRIT_DAYS = int(os.environ.get("DELTA_GAP_CRIT_DAYS", "90"))
|
| 38 |
+
|
| 39 |
+
# -- Page Rendering --------------------------------------------------------
|
| 40 |
+
PAGE_DPI = int(os.environ.get("PAGE_DPI", "150"))
|
debug/20260518_092733/cp0_ingestion.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"file_path": "document_1.pdf",
|
| 3 |
+
"file_size_bytes": 82676,
|
| 4 |
+
"page_count": 2,
|
| 5 |
+
"is_electronic": true,
|
| 6 |
+
"is_scanned": false,
|
| 7 |
+
"pages": [
|
| 8 |
+
{
|
| 9 |
+
"page": 1,
|
| 10 |
+
"char_count": 1805,
|
| 11 |
+
"has_text_layer": true
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"page": 2,
|
| 15 |
+
"char_count": 101,
|
| 16 |
+
"has_text_layer": true
|
| 17 |
+
}
|
| 18 |
+
]
|
| 19 |
+
}
|
debug/20260518_092733/cp1_page_01_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 1,
|
| 3 |
+
"png_size_kb": 220.1,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 1805,
|
| 6 |
+
"text_preview": "Affidavit \nTo whomsoever concerned \n \nI, KORADA SATYANARAYANA, Father of Korada SaiKiran, declare that I am a \nresident at the address “Plot No. 76, SBI Colony, Balaji Nagar, Totapalem area, \nnear Srinivasa College, near Abdul Kalam Park, Vizianagaram”. I hereby declare that \nI will bear all expenses for my son during his studies in Japan. \n \nMy family includes the following people – \n1. Korada Satyanarayana (Self), Date of Birth: 21/02/1971, Age: 55 Y. \n2. Korada Venkata Lakshmi (Wife), Dat"
|
| 7 |
+
}
|
debug/20260518_092733/cp1_page_02_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 2,
|
| 3 |
+
"png_size_kb": 19.5,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 101,
|
| 6 |
+
"text_preview": "What is stated in the above is true and correct to the best of my knowledge, belief, and information."
|
| 7 |
+
}
|
debug/20260518_092733/cp2_page_01_extraction.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 1,
|
| 3 |
+
"elapsed_s": 9.8,
|
| 4 |
+
"page_type_detected": "affidavit",
|
| 5 |
+
"non_null_fields": {
|
| 6 |
+
"page_number": 1,
|
| 7 |
+
"page_type": "affidavit",
|
| 8 |
+
"person_name": "KORADA SATYANARAYANA",
|
| 9 |
+
"date_of_birth": "21/02/1971",
|
| 10 |
+
"applicant_dob": "02-06-2003",
|
| 11 |
+
"currency": "INR",
|
| 12 |
+
"sponsor_name": "KORADA SATYANARAYANA",
|
| 13 |
+
"sponsor_relationship": "Father",
|
| 14 |
+
"sponsor_declared_income": 1200000.0,
|
| 15 |
+
"sponsor_income_currency": "INR",
|
| 16 |
+
"applicant_name": "Korada Sai Kiran",
|
| 17 |
+
"declared_liquid_assets": 1744664.76,
|
| 18 |
+
"declared_movable_assets": 2500000.0,
|
| 19 |
+
"declared_property_value": 16360000.0,
|
| 20 |
+
"declared_annual_income": 1200000.0
|
| 21 |
+
},
|
| 22 |
+
"null_or_empty_fields": [
|
| 23 |
+
"nationality",
|
| 24 |
+
"passport_number",
|
| 25 |
+
"opening_balance",
|
| 26 |
+
"closing_balance",
|
| 27 |
+
"transactions",
|
| 28 |
+
"employer_name",
|
| 29 |
+
"job_title",
|
| 30 |
+
"monthly_salary",
|
| 31 |
+
"annual_income",
|
| 32 |
+
"document_date",
|
| 33 |
+
"period_start",
|
| 34 |
+
"period_end",
|
| 35 |
+
"employment_start",
|
| 36 |
+
"employment_end",
|
| 37 |
+
"declared_assets_total",
|
| 38 |
+
"institution_name",
|
| 39 |
+
"program_name",
|
| 40 |
+
"program_cost",
|
| 41 |
+
"program_duration_months",
|
| 42 |
+
"enrollment_start",
|
| 43 |
+
"tax_year",
|
| 44 |
+
"taxable_income",
|
| 45 |
+
"tax_paid",
|
| 46 |
+
"anomaly_flags"
|
| 47 |
+
],
|
| 48 |
+
"raw_extraction": {
|
| 49 |
+
"page_number": 1,
|
| 50 |
+
"page_type": "affidavit",
|
| 51 |
+
"person_name": "KORADA SATYANARAYANA",
|
| 52 |
+
"date_of_birth": "21/02/1971",
|
| 53 |
+
"applicant_dob": "02-06-2003",
|
| 54 |
+
"nationality": null,
|
| 55 |
+
"passport_number": null,
|
| 56 |
+
"currency": "INR",
|
| 57 |
+
"opening_balance": null,
|
| 58 |
+
"closing_balance": null,
|
| 59 |
+
"transactions": [],
|
| 60 |
+
"employer_name": null,
|
| 61 |
+
"job_title": null,
|
| 62 |
+
"monthly_salary": null,
|
| 63 |
+
"annual_income": null,
|
| 64 |
+
"document_date": null,
|
| 65 |
+
"period_start": null,
|
| 66 |
+
"period_end": null,
|
| 67 |
+
"employment_start": null,
|
| 68 |
+
"employment_end": null,
|
| 69 |
+
"sponsor_name": "KORADA SATYANARAYANA",
|
| 70 |
+
"sponsor_relationship": "Father",
|
| 71 |
+
"sponsor_declared_income": 1200000.0,
|
| 72 |
+
"sponsor_income_currency": "INR",
|
| 73 |
+
"applicant_name": "Korada Sai Kiran",
|
| 74 |
+
"declared_liquid_assets": 1744664.76,
|
| 75 |
+
"declared_movable_assets": 2500000.0,
|
| 76 |
+
"declared_property_value": 16360000.0,
|
| 77 |
+
"declared_annual_income": 1200000.0,
|
| 78 |
+
"declared_assets_total": null,
|
| 79 |
+
"institution_name": null,
|
| 80 |
+
"program_name": null,
|
| 81 |
+
"program_cost": null,
|
| 82 |
+
"program_duration_months": null,
|
| 83 |
+
"enrollment_start": null,
|
| 84 |
+
"tax_year": null,
|
| 85 |
+
"taxable_income": null,
|
| 86 |
+
"tax_paid": null,
|
| 87 |
+
"anomaly_flags": []
|
| 88 |
+
}
|
| 89 |
+
}
|
debug/20260518_092733/cp2_page_02_extraction.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 2,
|
| 3 |
+
"elapsed_s": 14.18,
|
| 4 |
+
"page_type_detected": "unknown",
|
| 5 |
+
"non_null_fields": {
|
| 6 |
+
"page_number": 2,
|
| 7 |
+
"page_type": "unknown"
|
| 8 |
+
},
|
| 9 |
+
"null_or_empty_fields": [
|
| 10 |
+
"person_name",
|
| 11 |
+
"date_of_birth",
|
| 12 |
+
"applicant_dob",
|
| 13 |
+
"nationality",
|
| 14 |
+
"passport_number",
|
| 15 |
+
"currency",
|
| 16 |
+
"opening_balance",
|
| 17 |
+
"closing_balance",
|
| 18 |
+
"transactions",
|
| 19 |
+
"employer_name",
|
| 20 |
+
"job_title",
|
| 21 |
+
"monthly_salary",
|
| 22 |
+
"annual_income",
|
| 23 |
+
"document_date",
|
| 24 |
+
"period_start",
|
| 25 |
+
"period_end",
|
| 26 |
+
"employment_start",
|
| 27 |
+
"employment_end",
|
| 28 |
+
"sponsor_name",
|
| 29 |
+
"sponsor_relationship",
|
| 30 |
+
"sponsor_declared_income",
|
| 31 |
+
"sponsor_income_currency",
|
| 32 |
+
"applicant_name",
|
| 33 |
+
"declared_liquid_assets",
|
| 34 |
+
"declared_movable_assets",
|
| 35 |
+
"declared_property_value",
|
| 36 |
+
"declared_annual_income",
|
| 37 |
+
"declared_assets_total",
|
| 38 |
+
"institution_name",
|
| 39 |
+
"program_name",
|
| 40 |
+
"program_cost",
|
| 41 |
+
"program_duration_months",
|
| 42 |
+
"enrollment_start",
|
| 43 |
+
"tax_year",
|
| 44 |
+
"taxable_income",
|
| 45 |
+
"tax_paid",
|
| 46 |
+
"anomaly_flags"
|
| 47 |
+
],
|
| 48 |
+
"raw_extraction": {
|
| 49 |
+
"page_number": 2,
|
| 50 |
+
"page_type": "unknown",
|
| 51 |
+
"person_name": null,
|
| 52 |
+
"date_of_birth": null,
|
| 53 |
+
"applicant_dob": null,
|
| 54 |
+
"nationality": null,
|
| 55 |
+
"passport_number": null,
|
| 56 |
+
"currency": null,
|
| 57 |
+
"opening_balance": null,
|
| 58 |
+
"closing_balance": null,
|
| 59 |
+
"transactions": [],
|
| 60 |
+
"employer_name": null,
|
| 61 |
+
"job_title": null,
|
| 62 |
+
"monthly_salary": null,
|
| 63 |
+
"annual_income": null,
|
| 64 |
+
"document_date": null,
|
| 65 |
+
"period_start": null,
|
| 66 |
+
"period_end": null,
|
| 67 |
+
"employment_start": null,
|
| 68 |
+
"employment_end": null,
|
| 69 |
+
"sponsor_name": null,
|
| 70 |
+
"sponsor_relationship": null,
|
| 71 |
+
"sponsor_declared_income": null,
|
| 72 |
+
"sponsor_income_currency": null,
|
| 73 |
+
"applicant_name": null,
|
| 74 |
+
"declared_liquid_assets": null,
|
| 75 |
+
"declared_movable_assets": null,
|
| 76 |
+
"declared_property_value": null,
|
| 77 |
+
"declared_annual_income": null,
|
| 78 |
+
"declared_assets_total": null,
|
| 79 |
+
"institution_name": null,
|
| 80 |
+
"program_name": null,
|
| 81 |
+
"program_cost": null,
|
| 82 |
+
"program_duration_months": null,
|
| 83 |
+
"enrollment_start": null,
|
| 84 |
+
"tax_year": null,
|
| 85 |
+
"taxable_income": null,
|
| 86 |
+
"tax_paid": null,
|
| 87 |
+
"anomaly_flags": []
|
| 88 |
+
}
|
| 89 |
+
}
|
debug/20260518_092733/cp3_graph.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"identity": {
|
| 3 |
+
"name_variants": [
|
| 4 |
+
"Korada Sai Kiran"
|
| 5 |
+
],
|
| 6 |
+
"canonical_name": "Korada Sai Kiran",
|
| 7 |
+
"date_of_birth": "02-06-2003",
|
| 8 |
+
"nationality": null,
|
| 9 |
+
"passport_number": null,
|
| 10 |
+
"transliteration_flags": [],
|
| 11 |
+
"cross_doc_name_match": true
|
| 12 |
+
},
|
| 13 |
+
"financial": {
|
| 14 |
+
"currency": "INR",
|
| 15 |
+
"opening_balance": null,
|
| 16 |
+
"closing_balance": 1744664.76,
|
| 17 |
+
"avg_monthly_income": 100000.0,
|
| 18 |
+
"total_credits": 0.0,
|
| 19 |
+
"total_debits": 0.0,
|
| 20 |
+
"transaction_count": 0,
|
| 21 |
+
"spikes": [],
|
| 22 |
+
"unlabeled_deposit_count": 0,
|
| 23 |
+
"income_percentile": null,
|
| 24 |
+
"declared_property_value": 16360000.0,
|
| 25 |
+
"declared_movable_assets": 2500000.0,
|
| 26 |
+
"source_is_affidavit": true
|
| 27 |
+
},
|
| 28 |
+
"temporal": {
|
| 29 |
+
"doc_date_ranges": [],
|
| 30 |
+
"employment_start": null,
|
| 31 |
+
"employment_end": null,
|
| 32 |
+
"visa_window_start": null,
|
| 33 |
+
"visa_window_end": null,
|
| 34 |
+
"gap_flags": [],
|
| 35 |
+
"chronology_valid": true
|
| 36 |
+
},
|
| 37 |
+
"sponsor": {
|
| 38 |
+
"sponsor_name": "KORADA SATYANARAYANA",
|
| 39 |
+
"relationship": "Father",
|
| 40 |
+
"declared_income": 1200000.0,
|
| 41 |
+
"income_currency": "INR",
|
| 42 |
+
"income_supports_coverage": true,
|
| 43 |
+
"jurisdiction": null
|
| 44 |
+
},
|
| 45 |
+
"enrollment": null,
|
| 46 |
+
"edges": [
|
| 47 |
+
{
|
| 48 |
+
"edge_type": "sponsor_link",
|
| 49 |
+
"source_node": "identity",
|
| 50 |
+
"target_node": "sponsor",
|
| 51 |
+
"coherent": true,
|
| 52 |
+
"detail": null
|
| 53 |
+
}
|
| 54 |
+
],
|
| 55 |
+
"token_count": 367,
|
| 56 |
+
"source_page_count": 2,
|
| 57 |
+
"estimated_raw_tokens": 4000,
|
| 58 |
+
"source_doc_types": [
|
| 59 |
+
"affidavit",
|
| 60 |
+
"unknown"
|
| 61 |
+
]
|
| 62 |
+
}
|
debug/20260518_092733/cp3_graph_summary.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
=== GRAPH SUMMARY (run: 20260518_092733) ===
|
| 2 |
+
Source pages: 2 | Doc types: ['affidavit', 'unknown']
|
| 3 |
+
Token count: 367 | Compression: 4,000 -> 367
|
| 4 |
+
|
| 5 |
+
--- IDENTITY ---
|
| 6 |
+
canonical_name: Korada Sai Kiran
|
| 7 |
+
date_of_birth: 02-06-2003
|
| 8 |
+
nationality: None
|
| 9 |
+
passport_number: None
|
| 10 |
+
name_variants: ['Korada Sai Kiran']
|
| 11 |
+
|
| 12 |
+
--- FINANCIAL ---
|
| 13 |
+
source_is_affidavit: True
|
| 14 |
+
currency: INR
|
| 15 |
+
closing_balance: 1744664.76
|
| 16 |
+
avg_monthly_income: 100000.0
|
| 17 |
+
transaction_count: 0
|
| 18 |
+
declared_property: 16360000.0
|
| 19 |
+
declared_movables: 2500000.0
|
| 20 |
+
|
| 21 |
+
--- SPONSOR ---
|
| 22 |
+
sponsor_name: KORADA SATYANARAYANA
|
| 23 |
+
relationship: Father
|
| 24 |
+
declared_income: 1200000.0
|
| 25 |
+
|
| 26 |
+
enrollment: null
|
| 27 |
+
edges: [<EdgeType.SPONSOR_LINK: 'sponsor_link'>]
|
debug/20260518_092733/cp4_enrollment_agent_prompt.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "enrollment_agent",
|
| 3 |
+
"graph_subset_keys": [
|
| 4 |
+
"enrollment",
|
| 5 |
+
"financial",
|
| 6 |
+
"temporal"
|
| 7 |
+
],
|
| 8 |
+
"estimated_input_tokens": 453,
|
| 9 |
+
"prompt_char_count": 1815,
|
| 10 |
+
"prompt": "You are an adversarial immigration officer reviewing enrollment documentation.\nYour task: identify every enrollment/financial inconsistency that could justify visa rejection.\n\nJURISDICTION CONTEXT:\nJapanese Student (COE) visa requirements: Minimum bank balance of ¥2,000,000. 6 months of consecutive bank statements required. Certificate of Eligibility (COE) must match visa application dates. All large deposits must have documented sources. Sponsor must demonstrate income ≥1.2× total program costs.\n\nENROLLMENT DATA:\nnull\n\nFINANCIAL DATA:\n{\n \"currency\": \"INR\",\n \"opening_balance\": null,\n \"closing_balance\": 1744664.76,\n \"avg_monthly_income\": 100000.0,\n \"total_credits\": 0.0,\n \"total_debits\": 0.0,\n \"transaction_count\": 0,\n \"spikes\": [],\n \"unlabeled_deposit_count\": 0,\n \"income_percentile\": null,\n \"declared_property_value\": 16360000.0,\n \"declared_movable_assets\": 2500000.0,\n \"source_is_affidavit\": true\n}\n\nTEMPORAL DATA:\n{\n \"doc_date_ranges\": [],\n \"employment_start\": null,\n \"employment_end\": null,\n \"visa_window_start\": null,\n \"visa_window_end\": null,\n \"gap_flags\": [],\n \"chronology_valid\": true\n}\n\nRULE ENGINE FLAGS (already detected):\n[]\n\nAnalyse the following — be specific, cite exact values:\n1. Does the applicant's closing_balance cover program_cost? Show the arithmetic.\n Include a living expense estimate (~$1,500/month × duration_months) if relevant.\n2. Does enrollment_start align with the visa application timeline?\n3. Is the program_duration_months realistic for the stated program?\n4. If funds_cover_full_stay is false, quantify the shortfall exactly.\n5. If no enrollment data exists (null), note that this may be a non-student visa\n and enrollment checks are not applicable.\n\nRespond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."
|
| 11 |
+
}
|
debug/20260518_092733/cp4_financial_agent_prompt.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "financial_agent",
|
| 3 |
+
"graph_subset_keys": [
|
| 4 |
+
"financial",
|
| 5 |
+
"identity"
|
| 6 |
+
],
|
| 7 |
+
"estimated_input_tokens": 500,
|
| 8 |
+
"prompt_char_count": 2003,
|
| 9 |
+
"prompt": "You are an adversarial immigration officer reviewing financial documents.\nYour task: identify every financial inconsistency that could justify visa rejection.\n\nJURISDICTION CONTEXT:\nJapanese Student (COE) visa requirements: Minimum bank balance of ¥2,000,000. 6 months of consecutive bank statements required. Certificate of Eligibility (COE) must match visa application dates. All large deposits must have documented sources. Sponsor must demonstrate income ≥1.2× total program costs.\n\nFINANCIAL DATA:\n{\n \"currency\": \"INR\",\n \"opening_balance\": null,\n \"closing_balance\": 1744664.76,\n \"avg_monthly_income\": 100000.0,\n \"total_credits\": 0.0,\n \"total_debits\": 0.0,\n \"transaction_count\": 0,\n \"spikes\": [],\n \"unlabeled_deposit_count\": 0,\n \"income_percentile\": null,\n \"declared_property_value\": 16360000.0,\n \"declared_movable_assets\": 2500000.0,\n \"source_is_affidavit\": true\n}\n\nAPPLICANT IDENTITY:\n{\n \"name_variants\": [\n \"Korada Sai Kiran\"\n ],\n \"canonical_name\": \"Korada Sai Kiran\",\n \"date_of_birth\": \"02-06-2003\",\n \"nationality\": null,\n \"passport_number\": null,\n \"transliteration_flags\": [],\n \"cross_doc_name_match\": true\n}\n\nRULE ENGINE FLAGS (already detected):\n[\n {\n \"rule_id\": \"FIN-004\",\n \"severity\": \"critical\",\n \"field_path\": \"financial.closing_balance\",\n \"message\": \"Closing balance (1,744,665 JPY) below minimum requirement (2,000,000 JPY). Shortfall: 255,335 JPY\",\n \"expected\": \"balance \\u2265 2,000,000 JPY\",\n \"actual\": \"1,744,665 JPY\"\n }\n]\n\nAnalyse the following — be specific, cite exact values:\n1. For each spike in spikes[]: is there a plausible source? If unlabeled, flag as critical.\n2. Does avg_monthly_income × visa_duration cover declared costs? Show the arithmetic.\n3. Does the balance trajectory make sense given declared income? Flag any impossible accumulation.\n4. Are there cross-document income discrepancies (payslip vs bank deposit amounts)?\n\nRespond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."
|
| 10 |
+
}
|
debug/20260518_092733/cp4_identity_agent_prompt.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "identity_agent",
|
| 3 |
+
"graph_subset_keys": [
|
| 4 |
+
"identity"
|
| 5 |
+
],
|
| 6 |
+
"estimated_input_tokens": 349,
|
| 7 |
+
"prompt_char_count": 1396,
|
| 8 |
+
"prompt": "You are an adversarial immigration officer reviewing identity documents.\nYour task: identify every identity inconsistency that could justify visa rejection.\n\nJURISDICTION CONTEXT:\nJapanese Student (COE) visa requirements: Minimum bank balance of ¥2,000,000. 6 months of consecutive bank statements required. Certificate of Eligibility (COE) must match visa application dates. All large deposits must have documented sources. Sponsor must demonstrate income ≥1.2× total program costs.\n\nIDENTITY DATA:\n{\n \"name_variants\": [\n \"Korada Sai Kiran\"\n ],\n \"canonical_name\": \"Korada Sai Kiran\",\n \"date_of_birth\": \"02-06-2003\",\n \"nationality\": null,\n \"passport_number\": null,\n \"transliteration_flags\": [],\n \"cross_doc_name_match\": true\n}\n\nRULE ENGINE FLAGS (already detected):\n[]\n\nAnalyse the following — be specific, cite exact field paths:\n1. Are all name_variants plausibly the same person? Consider transliteration rules\n (e.g. Japanese: family-first vs given-first, romanisation differences).\n2. If cross_doc_name_match is false, is this a genuine mismatch or an expected\n transliteration variation? Rate the severity.\n3. Check for date_of_birth consistency — is it the same across all documents?\n4. Does the passport_number match the identity page expectations for the stated nationality?\n\nRespond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."
|
| 9 |
+
}
|
debug/20260518_092733/cp4_sponsor_agent_prompt.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "sponsor_agent",
|
| 3 |
+
"graph_subset_keys": [
|
| 4 |
+
"sponsor",
|
| 5 |
+
"identity",
|
| 6 |
+
"financial"
|
| 7 |
+
],
|
| 8 |
+
"estimated_input_tokens": 526,
|
| 9 |
+
"prompt_char_count": 2107,
|
| 10 |
+
"prompt": "You are an adversarial immigration officer reviewing sponsor documentation.\nYour task: identify every sponsorship inconsistency that could justify visa rejection.\n\nJURISDICTION CONTEXT:\nJapanese Student (COE) visa requirements: Minimum bank balance of ¥2,000,000. 6 months of consecutive bank statements required. Certificate of Eligibility (COE) must match visa application dates. All large deposits must have documented sources. Sponsor must demonstrate income ≥1.2× total program costs.\n\nSPONSOR DATA:\n{\n \"sponsor_name\": \"KORADA SATYANARAYANA\",\n \"relationship\": \"Father\",\n \"declared_income\": 1200000.0,\n \"income_currency\": \"INR\",\n \"income_supports_coverage\": true,\n \"jurisdiction\": null\n}\n\nAPPLICANT IDENTITY:\n{\n \"name_variants\": [\n \"Korada Sai Kiran\"\n ],\n \"canonical_name\": \"Korada Sai Kiran\",\n \"date_of_birth\": \"02-06-2003\",\n \"nationality\": null,\n \"passport_number\": null,\n \"transliteration_flags\": [],\n \"cross_doc_name_match\": true\n}\n\nAPPLICANT FINANCIAL DATA:\n{\n \"currency\": \"INR\",\n \"opening_balance\": null,\n \"closing_balance\": 1744664.76,\n \"avg_monthly_income\": 100000.0,\n \"total_credits\": 0.0,\n \"total_debits\": 0.0,\n \"transaction_count\": 0,\n \"spikes\": [],\n \"unlabeled_deposit_count\": 0,\n \"income_percentile\": null,\n \"declared_property_value\": 16360000.0,\n \"declared_movable_assets\": 2500000.0,\n \"source_is_affidavit\": true\n}\n\nRULE ENGINE FLAGS (already detected):\n[]\n\nAnalyse the following — be specific, cite exact values:\n1. Does the sponsor's declared_income realistically cover the applicant's total costs\n (tuition + living expenses + travel)? Show the arithmetic.\n2. Is the stated relationship plausible? (e.g. \"uncle\" sponsoring a non-relative is suspicious)\n3. If income_supports_coverage is false, quantify the shortfall.\n4. Does the sponsor's income_currency match the jurisdiction where they claim to reside?\n5. If no sponsor data exists (null), note that the application lacks financial sponsorship\n documentation — this may be acceptable if self-funded.\n\nRespond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."
|
| 11 |
+
}
|
debug/20260518_092733/cp4_temporal_agent_prompt.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "temporal_agent",
|
| 3 |
+
"graph_subset_keys": [
|
| 4 |
+
"temporal",
|
| 5 |
+
"financial"
|
| 6 |
+
],
|
| 7 |
+
"estimated_input_tokens": 460,
|
| 8 |
+
"prompt_char_count": 1840,
|
| 9 |
+
"prompt": "You are an adversarial immigration officer reviewing the timeline of an application.\nYour task: identify every temporal inconsistency that could justify visa rejection.\n\nJURISDICTION CONTEXT:\nJapanese Student (COE) visa requirements: Minimum bank balance of ¥2,000,000. 6 months of consecutive bank statements required. Certificate of Eligibility (COE) must match visa application dates. All large deposits must have documented sources. Sponsor must demonstrate income ≥1.2× total program costs.\n\nTEMPORAL DATA:\n{\n \"doc_date_ranges\": [],\n \"employment_start\": null,\n \"employment_end\": null,\n \"visa_window_start\": null,\n \"visa_window_end\": null,\n \"gap_flags\": [],\n \"chronology_valid\": true\n}\n\nFINANCIAL DATA (for date cross-reference):\n{\n \"currency\": \"INR\",\n \"opening_balance\": null,\n \"closing_balance\": 1744664.76,\n \"avg_monthly_income\": 100000.0,\n \"total_credits\": 0.0,\n \"total_debits\": 0.0,\n \"transaction_count\": 0,\n \"spikes\": [],\n \"unlabeled_deposit_count\": 0,\n \"income_percentile\": null,\n \"declared_property_value\": 16360000.0,\n \"declared_movable_assets\": 2500000.0,\n \"source_is_affidavit\": true\n}\n\nRULE ENGINE FLAGS (already detected):\n[]\n\nAnalyse the following — be specific, cite exact dates:\n1. Do employment_start and employment_end form a continuous period? Flag any gaps.\n2. Do the doc_date_ranges overlap logically? A bank statement ending after an\n employment letter's issue date is normal; the reverse is suspicious.\n3. If visa_window_start/end exist, does the employment and financial history\n cover the required pre-application period (typically 3-6 months)?\n4. Check chronology_valid — if false, explain what dates are logically impossible.\n5. Are transaction dates within the stated employment period?\n\nRespond ONLY with the AgentFinding JSON schema. Every anomaly must include the exact field_path."
|
| 10 |
+
}
|
debug/20260518_092733/cp5_enrollment_agent_response.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "enrollment_agent",
|
| 3 |
+
"elapsed_s": 24.48,
|
| 4 |
+
"parse_error": null,
|
| 5 |
+
"verdict": "critical",
|
| 6 |
+
"confidence": 1.0,
|
| 7 |
+
"anomaly_count": 4,
|
| 8 |
+
"summary": "The student visa application is critically flawed due to a complete lack of enrollment documentation and the failure to provide the mandatory six-month financial history, warranting immediate rejection.",
|
| 9 |
+
"full_finding": {
|
| 10 |
+
"agent_id": "enrollment_agent",
|
| 11 |
+
"anomalies": [
|
| 12 |
+
{
|
| 13 |
+
"field_path": "enrollment",
|
| 14 |
+
"severity": "critical",
|
| 15 |
+
"explanation": "The application for a student visa contains no enrollment data. This is a fundamental failure, making it impossible to verify the applicant's purpose of entry, program details, or associated costs.",
|
| 16 |
+
"rule_id": null
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"field_path": "temporal.doc_date_ranges",
|
| 20 |
+
"severity": "critical",
|
| 21 |
+
"explanation": "The application fails to provide the required 6 months of consecutive bank statements. The provided financial data shows zero transactions and the document date range is empty, which is an automatic disqualifier.",
|
| 22 |
+
"rule_id": null
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"field_path": "financial.source_is_affidavit",
|
| 26 |
+
"severity": "critical",
|
| 27 |
+
"explanation": "The source of the entire 1,744,664.76 INR closing balance is substantiated only by an affidavit, which is not considered sufficient proof of funds. With no transaction history, the origin of this large sum is undocumented and suspicious.",
|
| 28 |
+
"rule_id": null
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"field_path": "financial.closing_balance",
|
| 32 |
+
"severity": "warning",
|
| 33 |
+
"explanation": "The sufficiency of the closing balance cannot be verified. Without program cost and duration from the missing enrollment data, it is impossible to assess if funds cover tuition and living expenses as required.",
|
| 34 |
+
"rule_id": null
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"confidence": 1.0,
|
| 38 |
+
"agent_verdict": "critical",
|
| 39 |
+
"summary": "The student visa application is critically flawed due to a complete lack of enrollment documentation and the failure to provide the mandatory six-month financial history, warranting immediate rejection."
|
| 40 |
+
}
|
| 41 |
+
}
|
debug/20260518_092733/cp5_financial_agent_response.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "financial_agent",
|
| 3 |
+
"elapsed_s": 24.75,
|
| 4 |
+
"parse_error": null,
|
| 5 |
+
"verdict": "critical",
|
| 6 |
+
"confidence": 1.0,
|
| 7 |
+
"anomaly_count": 4,
|
| 8 |
+
"summary": "The application is critically flawed due to a complete lack of required transaction history, an unverifiable source of funds, and an unexplained large balance relative to income.",
|
| 9 |
+
"full_finding": {
|
| 10 |
+
"agent_id": "financial_agent",
|
| 11 |
+
"anomalies": [
|
| 12 |
+
{
|
| 13 |
+
"field_path": "financial.transaction_count",
|
| 14 |
+
"severity": "critical",
|
| 15 |
+
"explanation": "The financial record shows zero transactions, credits, or debits. This fails to meet the 6-month consecutive bank statement requirement needed to assess financial stability and the legitimate accumulation of funds.",
|
| 16 |
+
"rule_id": null
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"field_path": "financial.closing_balance",
|
| 20 |
+
"severity": "critical",
|
| 21 |
+
"explanation": "The closing balance of 1,744,664.76 INR is over 17 times the declared monthly income of 100,000.0 INR. This accumulation is completely undocumented within the provided transaction history.",
|
| 22 |
+
"rule_id": null
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"field_path": "financial.source_is_affidavit",
|
| 26 |
+
"severity": "critical",
|
| 27 |
+
"explanation": "The source of funds is supported only by an affidavit, which is insufficient primary evidence. The origin of the large balance is unverifiable without supporting transactional or legal documents.",
|
| 28 |
+
"rule_id": null
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"field_path": "financial.opening_balance",
|
| 32 |
+
"severity": "critical",
|
| 33 |
+
"explanation": "The opening balance is null, indicating an incomplete financial record that violates the requirement for a continuous 6-month statement history.",
|
| 34 |
+
"rule_id": null
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"confidence": 1.0,
|
| 38 |
+
"agent_verdict": "critical",
|
| 39 |
+
"summary": "The application is critically flawed due to a complete lack of required transaction history, an unverifiable source of funds, and an unexplained large balance relative to income."
|
| 40 |
+
}
|
| 41 |
+
}
|
debug/20260518_092733/cp5_identity_agent_response.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "identity_agent",
|
| 3 |
+
"elapsed_s": 10.25,
|
| 4 |
+
"parse_error": null,
|
| 5 |
+
"verdict": "critical",
|
| 6 |
+
"confidence": 1.0,
|
| 7 |
+
"anomaly_count": 2,
|
| 8 |
+
"summary": "The application is critically deficient due to missing nationality and passport number, preventing basic identity verification.",
|
| 9 |
+
"full_finding": {
|
| 10 |
+
"agent_id": "identity_agent",
|
| 11 |
+
"anomalies": [
|
| 12 |
+
{
|
| 13 |
+
"field_path": "nationality",
|
| 14 |
+
"severity": "critical",
|
| 15 |
+
"explanation": "Applicant nationality is not specified. This is a mandatory field for identity verification and visa processing.",
|
| 16 |
+
"rule_id": null
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"field_path": "passport_number",
|
| 20 |
+
"severity": "critical",
|
| 21 |
+
"explanation": "Applicant passport number is missing. A valid passport is a required document for any visa application.",
|
| 22 |
+
"rule_id": null
|
| 23 |
+
}
|
| 24 |
+
],
|
| 25 |
+
"confidence": 1.0,
|
| 26 |
+
"agent_verdict": "critical",
|
| 27 |
+
"summary": "The application is critically deficient due to missing nationality and passport number, preventing basic identity verification."
|
| 28 |
+
}
|
| 29 |
+
}
|
debug/20260518_092733/cp5_sponsor_agent_response.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "sponsor_agent",
|
| 3 |
+
"elapsed_s": 27.05,
|
| 4 |
+
"parse_error": null,
|
| 5 |
+
"verdict": "critical",
|
| 6 |
+
"confidence": 1.0,
|
| 7 |
+
"anomaly_count": 4,
|
| 8 |
+
"summary": "The application should be rejected due to the use of an affidavit instead of required bank statements and the sponsor's insufficient declared income.",
|
| 9 |
+
"full_finding": {
|
| 10 |
+
"agent_id": "sponsor_agent",
|
| 11 |
+
"anomalies": [
|
| 12 |
+
{
|
| 13 |
+
"field_path": "applicant_financials.source_is_affidavit",
|
| 14 |
+
"severity": "critical",
|
| 15 |
+
"explanation": "Financial data is provided via an affidavit, but visa regulations require six months of consecutive bank statements, making it impossible to verify the history and stability of the funds.",
|
| 16 |
+
"rule_id": null
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"field_path": "sponsor.declared_income",
|
| 20 |
+
"severity": "critical",
|
| 21 |
+
"explanation": "The sponsor's declared income of 1,200,000 INR is insufficient to meet the requirement to cover at least 1.2 times the total program costs for studying in Japan, which typically exceed this amount annually.",
|
| 22 |
+
"rule_id": null
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"field_path": "sponsor.jurisdiction",
|
| 26 |
+
"severity": "warning",
|
| 27 |
+
"explanation": "The sponsor's jurisdiction is not specified, preventing verification of their employment, residence, and the authenticity of their claimed income.",
|
| 28 |
+
"rule_id": null
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"field_path": "applicant_financials.closing_balance",
|
| 32 |
+
"severity": "warning",
|
| 33 |
+
"explanation": "While the closing balance of 1,744,664.76 INR may be numerically sufficient when converted, its legitimacy cannot be confirmed due to the absence of the required 6-month statement history.",
|
| 34 |
+
"rule_id": null
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"confidence": 1.0,
|
| 38 |
+
"agent_verdict": "critical",
|
| 39 |
+
"summary": "The application should be rejected due to the use of an affidavit instead of required bank statements and the sponsor's insufficient declared income."
|
| 40 |
+
}
|
| 41 |
+
}
|
debug/20260518_092733/cp5_temporal_agent_response.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"agent_id": "temporal_agent",
|
| 3 |
+
"elapsed_s": 19.65,
|
| 4 |
+
"parse_error": null,
|
| 5 |
+
"verdict": "critical",
|
| 6 |
+
"confidence": 1.0,
|
| 7 |
+
"anomaly_count": 2,
|
| 8 |
+
"summary": "The application is critically deficient, lacking any bank statements or employment history, making financial and temporal verification impossible.",
|
| 9 |
+
"full_finding": {
|
| 10 |
+
"agent_id": "temporal_agent",
|
| 11 |
+
"anomalies": [
|
| 12 |
+
{
|
| 13 |
+
"field_path": "doc_date_ranges",
|
| 14 |
+
"severity": "critical",
|
| 15 |
+
"explanation": "The application is missing the mandatory six months of consecutive bank statements. This complete absence of documentation makes it impossible to verify the history, source, and stability of the declared funds.",
|
| 16 |
+
"rule_id": null
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"field_path": "employment_start",
|
| 20 |
+
"severity": "critical",
|
| 21 |
+
"explanation": "No employment start date or employment history has been provided for the applicant or sponsor. This prevents the verification of the source of income and the sponsor's ability to meet financial support requirements.",
|
| 22 |
+
"rule_id": null
|
| 23 |
+
}
|
| 24 |
+
],
|
| 25 |
+
"confidence": 1.0,
|
| 26 |
+
"agent_verdict": "critical",
|
| 27 |
+
"summary": "The application is critically deficient, lacking any bank statements or employment history, making financial and temporal verification impossible."
|
| 28 |
+
}
|
| 29 |
+
}
|
debug/20260518_092733/cp6_narrative.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"elapsed_s": 19.3,
|
| 3 |
+
"parse_error": null,
|
| 4 |
+
"verdict": "FAIL",
|
| 5 |
+
"risk_score": 1.0,
|
| 6 |
+
"critical_issues_count": 7,
|
| 7 |
+
"prompt_char_count": 9896,
|
| 8 |
+
"prompt": "You are a senior immigration officer writing the official assessment.\n\nDOCUMENT TYPES PROCESSED: ['affidavit', 'unknown']\n\n\nDOCUMENT CONTEXT: The financial data comes ONLY from an affidavit (sworn declaration). An affidavit legitimately has zero bank transactions -- it declares point-in-time asset values. Do NOT cite 'zero transactions' as evidence of fraud. Instead, note that actual bank statements are MISSING and must be submitted. The declared liquid assets and income should be treated as sponsor's declared financial standing, not as bank account history.\n\nSEMANTIC GRAPH (full document picture):\n{\n \"identity\": {\n \"name_variants\": [\n \"Korada Sai Kiran\"\n ],\n \"canonical_name\": \"Korada Sai Kiran\",\n \"date_of_birth\": \"02-06-2003\",\n \"nationality\": null,\n \"passport_number\": null,\n \"transliteration_flags\": [],\n \"cross_doc_name_match\": true\n },\n \"financial\": {\n \"currency\": \"INR\",\n \"opening_balance\": null,\n \"closing_balance\": 1744664.76,\n \"avg_monthly_income\": 100000.0,\n \"total_credits\": 0.0,\n \"total_debits\": 0.0,\n \"transaction_count\": 0,\n \"spikes\": [],\n \"unlabeled_deposit_count\": 0,\n \"income_percentile\": null,\n \"declared_property_value\": 16360000.0,\n \"declared_movable_assets\": 2500000.0,\n \"source_is_affidavit\": true\n },\n \"temporal\": {\n \"doc_date_ranges\": [],\n \"employment_start\": null,\n \"employment_end\": null,\n \"visa_window_start\": null,\n \"visa_window_end\": null,\n \"gap_flags\": [],\n \"chronology_valid\": true\n },\n \"sponsor\": {\n \"sponsor_name\": \"KORADA SATYANARAYANA\",\n \"relationship\": \"Father\",\n \"declared_income\": 1200000.0,\n \"income_currency\": \"INR\",\n \"income_supports_coverage\": true,\n \"jurisdiction\": null\n },\n \"enrollment\": null,\n \"edges\": [\n {\n \"edge_type\": \"sponsor_link\",\n \"source_node\": \"identity\",\n \"target_node\": \"sponsor\",\n \"coherent\": true,\n \"detail\": null\n }\n ],\n \"token_count\": 367,\n \"source_page_count\": 2,\n \"estimated_raw_tokens\": 4000,\n \"source_doc_types\": [\n \"affidavit\",\n \"unknown\"\n ]\n}\n\nRULE ENGINE FINDINGS:\n[\n {\n \"rule_id\": \"FIN-004\",\n \"severity\": \"critical\",\n \"field_path\": \"financial.closing_balance\",\n \"message\": \"Closing balance (1,744,665 JPY) below minimum requirement (2,000,000 JPY). Shortfall: 255,335 JPY\",\n \"expected\": \"balance \\u2265 2,000,000 JPY\",\n \"actual\": \"1,744,665 JPY\"\n }\n]\n\nSPECIALIST AGENT FINDINGS:\n[\n {\n \"agent_id\": \"identity_agent\",\n \"anomalies\": [\n {\n \"field_path\": \"nationality\",\n \"severity\": \"critical\",\n \"explanation\": \"Applicant nationality is not specified. This is a mandatory field for identity verification and visa processing.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"passport_number\",\n \"severity\": \"critical\",\n \"explanation\": \"Applicant passport number is missing. A valid passport is a required document for any visa application.\",\n \"rule_id\": null\n }\n ],\n \"confidence\": 1.0,\n \"agent_verdict\": \"critical\",\n \"summary\": \"The application is critically deficient due to missing nationality and passport number, preventing basic identity verification.\"\n },\n {\n \"agent_id\": \"financial_agent\",\n \"anomalies\": [\n {\n \"field_path\": \"financial.transaction_count\",\n \"severity\": \"critical\",\n \"explanation\": \"The financial record shows zero transactions, credits, or debits. This fails to meet the 6-month consecutive bank statement requirement needed to assess financial stability and the legitimate accumulation of funds.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"financial.closing_balance\",\n \"severity\": \"critical\",\n \"explanation\": \"The closing balance of 1,744,664.76 INR is over 17 times the declared monthly income of 100,000.0 INR. This accumulation is completely undocumented within the provided transaction history.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"financial.source_is_affidavit\",\n \"severity\": \"critical\",\n \"explanation\": \"The source of funds is supported only by an affidavit, which is insufficient primary evidence. The origin of the large balance is unverifiable without supporting transactional or legal documents.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"financial.opening_balance\",\n \"severity\": \"critical\",\n \"explanation\": \"The opening balance is null, indicating an incomplete financial record that violates the requirement for a continuous 6-month statement history.\",\n \"rule_id\": null\n }\n ],\n \"confidence\": 1.0,\n \"agent_verdict\": \"critical\",\n \"summary\": \"The application is critically flawed due to a complete lack of required transaction history, an unverifiable source of funds, and an unexplained large balance relative to income.\"\n },\n {\n \"agent_id\": \"temporal_agent\",\n \"anomalies\": [\n {\n \"field_path\": \"doc_date_ranges\",\n \"severity\": \"critical\",\n \"explanation\": \"The application is missing the mandatory six months of consecutive bank statements. This complete absence of documentation makes it impossible to verify the history, source, and stability of the declared funds.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"employment_start\",\n \"severity\": \"critical\",\n \"explanation\": \"No employment start date or employment history has been provided for the applicant or sponsor. This prevents the verification of the source of income and the sponsor's ability to meet financial support requirements.\",\n \"rule_id\": null\n }\n ],\n \"confidence\": 1.0,\n \"agent_verdict\": \"critical\",\n \"summary\": \"The application is critically deficient, lacking any bank statements or employment history, making financial and temporal verification impossible.\"\n },\n {\n \"agent_id\": \"sponsor_agent\",\n \"anomalies\": [\n {\n \"field_path\": \"applicant_financials.source_is_affidavit\",\n \"severity\": \"critical\",\n \"explanation\": \"Financial data is provided via an affidavit, but visa regulations require six months of consecutive bank statements, making it impossible to verify the history and stability of the funds.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"sponsor.declared_income\",\n \"severity\": \"critical\",\n \"explanation\": \"The sponsor's declared income of 1,200,000 INR is insufficient to meet the requirement to cover at least 1.2 times the total program costs for studying in Japan, which typically exceed this amount annually.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"sponsor.jurisdiction\",\n \"severity\": \"warning\",\n \"explanation\": \"The sponsor's jurisdiction is not specified, preventing verification of their employment, residence, and the authenticity of their claimed income.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"applicant_financials.closing_balance\",\n \"severity\": \"warning\",\n \"explanation\": \"While the closing balance of 1,744,664.76 INR may be numerically sufficient when converted, its legitimacy cannot be confirmed due to the absence of the required 6-month statement history.\",\n \"rule_id\": null\n }\n ],\n \"confidence\": 1.0,\n \"agent_verdict\": \"critical\",\n \"summary\": \"The application should be rejected due to the use of an affidavit instead of required bank statements and the sponsor's insufficient declared income.\"\n },\n {\n \"agent_id\": \"enrollment_agent\",\n \"anomalies\": [\n {\n \"field_path\": \"enrollment\",\n \"severity\": \"critical\",\n \"explanation\": \"The application for a student visa contains no enrollment data. This is a fundamental failure, making it impossible to verify the applicant's purpose of entry, program details, or associated costs.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"temporal.doc_date_ranges\",\n \"severity\": \"critical\",\n \"explanation\": \"The application fails to provide the required 6 months of consecutive bank statements. The provided financial data shows zero transactions and the document date range is empty, which is an automatic disqualifier.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"financial.source_is_affidavit\",\n \"severity\": \"critical\",\n \"explanation\": \"The source of the entire 1,744,664.76 INR closing balance is substantiated only by an affidavit, which is not considered sufficient proof of funds. With no transaction history, the origin of this large sum is undocumented and suspicious.\",\n \"rule_id\": null\n },\n {\n \"field_path\": \"financial.closing_balance\",\n \"severity\": \"warning\",\n \"explanation\": \"The sufficiency of the closing balance cannot be verified. Without program cost and duration from the missing enrollment data, it is impossible to assess if funds cover tuition and living expenses as required.\",\n \"rule_id\": null\n }\n ],\n \"confidence\": 1.0,\n \"agent_verdict\": \"critical\",\n \"summary\": \"The student visa application is critically flawed due to a complete lack of enrollment documentation and the failure to provide the mandatory six-month financial history, warranting immediate rejection.\"\n }\n]\n\nYour task:\n1. Synthesise ALL findings into a single coherent verdict.\n2. A finding from ANY agent with severity \"critical\" = FAIL unless directly contradicted by another agent.\n3. Write the rejection_narrative as an officer would: formal, specific, citing document evidence.\n4. For each issue, write one rebuttal_guidance item: what additional document would resolve it.\n5. Risk score: 0.0 = clean application, 1.0 = near-certain rejection.\n6. In citations, list the exact graph node paths that support your verdict (e.g. 'financial.spikes[0].amount').\n\nRespond ONLY with NarrativeVerdict JSON.",
|
| 9 |
+
"full_verdict": {
|
| 10 |
+
"verdict": "FAIL",
|
| 11 |
+
"risk_score": 1.0,
|
| 12 |
+
"critical_issues": [
|
| 13 |
+
"Application is critically incomplete, lacking mandatory identity, financial, and enrollment documentation.",
|
| 14 |
+
"No passport number or nationality provided for the applicant, preventing basic identity verification.",
|
| 15 |
+
"Financial evidence is provided via an affidavit, which is insufficient. Official, consecutive 6-month bank statements are required and have not been submitted.",
|
| 16 |
+
"No proof of enrollment in an educational institution has been provided, failing to establish the purpose of travel.",
|
| 17 |
+
"Sponsor's declared income of 1,200,000 INR is insufficient to cover typical program and living costs.",
|
| 18 |
+
"The closing liquid balance of 1,744,664.76 INR is below the minimum financial threshold required.",
|
| 19 |
+
"No employment history for the sponsor was provided to substantiate the source of their declared income."
|
| 20 |
+
],
|
| 21 |
+
"warning_issues": [
|
| 22 |
+
"The sponsor's jurisdiction is not specified, which hinders verification of their financial standing.",
|
| 23 |
+
"Sufficiency of the closing balance cannot be assessed without enrollment data detailing program costs."
|
| 24 |
+
],
|
| 25 |
+
"rejection_narrative": "The application is refused on the grounds that the applicant has failed to provide fundamental documentation required to assess their eligibility. The application is materially incomplete and does not satisfy regulatory requirements.\n\nFirst, key identity information is missing. The submitted documents do not contain the applicant's passport number or nationality, making basic identity verification impossible. \n\nSecond, the applicant has not demonstrated sufficient financial capacity. The financial evidence consists solely of a sworn affidavit. This document is not a substitute for the mandatory six months of consecutive, official bank statements required to verify the origin, accumulation, and stability of funds. Consequently, the declared closing balance of 1,744,664.76 INR is unsubstantiated. Furthermore, the sponsor's declared annual income of 1,200,000 INR is deemed insufficient to cover the anticipated costs of tuition and living expenses, and no evidence of the sponsor's employment has been provided to verify this income.\n\nThird, the purpose of travel is not established. The application lacks any proof of enrollment, such as a letter of acceptance from a designated learning institution. Without this, the applicant's stated intent to study cannot be verified.\n\nDue to these critical and numerous deficiencies, the application is refused.",
|
| 26 |
+
"rebuttal_guidance": [
|
| 27 |
+
"Submit a clear, valid copy of the applicant's passport bio-data page showing the full name, passport number, and nationality.",
|
| 28 |
+
"Submit complete, official bank statements for the primary sponsor for the last six consecutive months. These must be from a financial institution and not a self-declared affidavit.",
|
| 29 |
+
"Submit an official Letter of Acceptance from the designated educational institution, detailing the program of study, duration, and associated costs.",
|
| 30 |
+
"Provide verifiable proof of the sponsor's current employment and income, such as a letter from their employer, recent salary slips, and tax documents.",
|
| 31 |
+
"Provide an updated financial statement showing a closing balance that meets or exceeds the minimum requirement, which must be supported by a six-month transaction history."
|
| 32 |
+
],
|
| 33 |
+
"citations": [
|
| 34 |
+
"identity.passport_number",
|
| 35 |
+
"identity.nationality",
|
| 36 |
+
"financial.source_is_affidavit",
|
| 37 |
+
"temporal.doc_date_ranges",
|
| 38 |
+
"enrollment",
|
| 39 |
+
"sponsor.declared_income",
|
| 40 |
+
"temporal.employment_start",
|
| 41 |
+
"financial.closing_balance",
|
| 42 |
+
"sponsor.jurisdiction"
|
| 43 |
+
]
|
| 44 |
+
}
|
| 45 |
+
}
|
debug/20260518_092733/run_summary.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"run_id": "20260518_092733",
|
| 3 |
+
"total_elapsed_s": 145.1,
|
| 4 |
+
"checkpoints": [
|
| 5 |
+
{
|
| 6 |
+
"checkpoint": "CP0",
|
| 7 |
+
"timestamp": "2026-05-18T09:27:33.914679+00:00",
|
| 8 |
+
"file": "document_1.pdf",
|
| 9 |
+
"pages": 2,
|
| 10 |
+
"electronic": true
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"checkpoint": "CP2",
|
| 14 |
+
"timestamp": "2026-05-18T09:27:43.831219+00:00",
|
| 15 |
+
"page": 1,
|
| 16 |
+
"type": "affidavit",
|
| 17 |
+
"non_null_count": 15,
|
| 18 |
+
"elapsed_s": 9.8
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"checkpoint": "CP2",
|
| 22 |
+
"timestamp": "2026-05-18T09:27:48.242405+00:00",
|
| 23 |
+
"page": 2,
|
| 24 |
+
"type": "unknown",
|
| 25 |
+
"non_null_count": 2,
|
| 26 |
+
"elapsed_s": 14.18
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"checkpoint": "CP3",
|
| 30 |
+
"timestamp": "2026-05-18T09:27:48.483168+00:00",
|
| 31 |
+
"canonical_name": "Korada Sai Kiran",
|
| 32 |
+
"doc_types": [
|
| 33 |
+
"affidavit",
|
| 34 |
+
"unknown"
|
| 35 |
+
],
|
| 36 |
+
"closing_balance": 1744664.76,
|
| 37 |
+
"token_count": 367
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"checkpoint": "CP4",
|
| 41 |
+
"timestamp": "2026-05-18T09:27:48.485627+00:00",
|
| 42 |
+
"agent": "identity_agent",
|
| 43 |
+
"estimated_tokens": 349,
|
| 44 |
+
"graph_keys": [
|
| 45 |
+
"identity"
|
| 46 |
+
]
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"checkpoint": "CP5",
|
| 50 |
+
"timestamp": "2026-05-18T09:27:58.740777+00:00",
|
| 51 |
+
"agent": "identity_agent",
|
| 52 |
+
"verdict": "critical",
|
| 53 |
+
"confidence": 1.0,
|
| 54 |
+
"elapsed_s": 10.25,
|
| 55 |
+
"parse_error": null
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"checkpoint": "CP4",
|
| 59 |
+
"timestamp": "2026-05-18T09:27:59.742961+00:00",
|
| 60 |
+
"agent": "financial_agent",
|
| 61 |
+
"estimated_tokens": 500,
|
| 62 |
+
"graph_keys": [
|
| 63 |
+
"financial",
|
| 64 |
+
"identity"
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"checkpoint": "CP5",
|
| 69 |
+
"timestamp": "2026-05-18T09:28:24.496202+00:00",
|
| 70 |
+
"agent": "financial_agent",
|
| 71 |
+
"verdict": "critical",
|
| 72 |
+
"confidence": 1.0,
|
| 73 |
+
"elapsed_s": 24.75,
|
| 74 |
+
"parse_error": null
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"checkpoint": "CP4",
|
| 78 |
+
"timestamp": "2026-05-18T09:28:25.497703+00:00",
|
| 79 |
+
"agent": "temporal_agent",
|
| 80 |
+
"estimated_tokens": 460,
|
| 81 |
+
"graph_keys": [
|
| 82 |
+
"temporal",
|
| 83 |
+
"financial"
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"checkpoint": "CP5",
|
| 88 |
+
"timestamp": "2026-05-18T09:28:45.147839+00:00",
|
| 89 |
+
"agent": "temporal_agent",
|
| 90 |
+
"verdict": "critical",
|
| 91 |
+
"confidence": 1.0,
|
| 92 |
+
"elapsed_s": 19.65,
|
| 93 |
+
"parse_error": null
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"checkpoint": "CP4",
|
| 97 |
+
"timestamp": "2026-05-18T09:28:46.149433+00:00",
|
| 98 |
+
"agent": "sponsor_agent",
|
| 99 |
+
"estimated_tokens": 526,
|
| 100 |
+
"graph_keys": [
|
| 101 |
+
"sponsor",
|
| 102 |
+
"identity",
|
| 103 |
+
"financial"
|
| 104 |
+
]
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"checkpoint": "CP5",
|
| 108 |
+
"timestamp": "2026-05-18T09:29:13.198454+00:00",
|
| 109 |
+
"agent": "sponsor_agent",
|
| 110 |
+
"verdict": "critical",
|
| 111 |
+
"confidence": 1.0,
|
| 112 |
+
"elapsed_s": 27.05,
|
| 113 |
+
"parse_error": null
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"checkpoint": "CP4",
|
| 117 |
+
"timestamp": "2026-05-18T09:29:14.200277+00:00",
|
| 118 |
+
"agent": "enrollment_agent",
|
| 119 |
+
"estimated_tokens": 453,
|
| 120 |
+
"graph_keys": [
|
| 121 |
+
"enrollment",
|
| 122 |
+
"financial",
|
| 123 |
+
"temporal"
|
| 124 |
+
]
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"checkpoint": "CP5",
|
| 128 |
+
"timestamp": "2026-05-18T09:29:38.680531+00:00",
|
| 129 |
+
"agent": "enrollment_agent",
|
| 130 |
+
"verdict": "critical",
|
| 131 |
+
"confidence": 1.0,
|
| 132 |
+
"elapsed_s": 24.48,
|
| 133 |
+
"parse_error": null
|
| 134 |
+
},
|
| 135 |
+
{
|
| 136 |
+
"checkpoint": "CP6",
|
| 137 |
+
"timestamp": "2026-05-18T09:29:58.985743+00:00",
|
| 138 |
+
"verdict": "FAIL",
|
| 139 |
+
"risk_score": 1.0,
|
| 140 |
+
"elapsed_s": 19.3
|
| 141 |
+
}
|
| 142 |
+
],
|
| 143 |
+
"output_dir": "C:\\Users\\ksk76\\Downloads\\uplan-hackathon-space-amd\\refined\\new-plan\\debug\\20260518_092733"
|
| 144 |
+
}
|
debug/20260518_142500/cp0_ingestion.json
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"file_path": "document_1.pdf",
|
| 3 |
+
"file_size_bytes": 685797,
|
| 4 |
+
"page_count": 38,
|
| 5 |
+
"is_electronic": true,
|
| 6 |
+
"is_scanned": false,
|
| 7 |
+
"pages": [
|
| 8 |
+
{
|
| 9 |
+
"page": 1,
|
| 10 |
+
"char_count": 1877,
|
| 11 |
+
"has_text_layer": true
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"page": 2,
|
| 15 |
+
"char_count": 2693,
|
| 16 |
+
"has_text_layer": true
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"page": 3,
|
| 20 |
+
"char_count": 2700,
|
| 21 |
+
"has_text_layer": true
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"page": 4,
|
| 25 |
+
"char_count": 2726,
|
| 26 |
+
"has_text_layer": true
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"page": 5,
|
| 30 |
+
"char_count": 2742,
|
| 31 |
+
"has_text_layer": true
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"page": 6,
|
| 35 |
+
"char_count": 2737,
|
| 36 |
+
"has_text_layer": true
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"page": 7,
|
| 40 |
+
"char_count": 2722,
|
| 41 |
+
"has_text_layer": true
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"page": 8,
|
| 45 |
+
"char_count": 2746,
|
| 46 |
+
"has_text_layer": true
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"page": 9,
|
| 50 |
+
"char_count": 2749,
|
| 51 |
+
"has_text_layer": true
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"page": 10,
|
| 55 |
+
"char_count": 2745,
|
| 56 |
+
"has_text_layer": true
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"page": 11,
|
| 60 |
+
"char_count": 2771,
|
| 61 |
+
"has_text_layer": true
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"page": 12,
|
| 65 |
+
"char_count": 2743,
|
| 66 |
+
"has_text_layer": true
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"page": 13,
|
| 70 |
+
"char_count": 2752,
|
| 71 |
+
"has_text_layer": true
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"page": 14,
|
| 75 |
+
"char_count": 2735,
|
| 76 |
+
"has_text_layer": true
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"page": 15,
|
| 80 |
+
"char_count": 2745,
|
| 81 |
+
"has_text_layer": true
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"page": 16,
|
| 85 |
+
"char_count": 2721,
|
| 86 |
+
"has_text_layer": true
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"page": 17,
|
| 90 |
+
"char_count": 2747,
|
| 91 |
+
"has_text_layer": true
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"page": 18,
|
| 95 |
+
"char_count": 2742,
|
| 96 |
+
"has_text_layer": true
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"page": 19,
|
| 100 |
+
"char_count": 2721,
|
| 101 |
+
"has_text_layer": true
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"page": 20,
|
| 105 |
+
"char_count": 2700,
|
| 106 |
+
"has_text_layer": true
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"page": 21,
|
| 110 |
+
"char_count": 2723,
|
| 111 |
+
"has_text_layer": true
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
"page": 22,
|
| 115 |
+
"char_count": 2727,
|
| 116 |
+
"has_text_layer": true
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"page": 23,
|
| 120 |
+
"char_count": 2734,
|
| 121 |
+
"has_text_layer": true
|
| 122 |
+
},
|
| 123 |
+
{
|
| 124 |
+
"page": 24,
|
| 125 |
+
"char_count": 2741,
|
| 126 |
+
"has_text_layer": true
|
| 127 |
+
},
|
| 128 |
+
{
|
| 129 |
+
"page": 25,
|
| 130 |
+
"char_count": 2711,
|
| 131 |
+
"has_text_layer": true
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
"page": 26,
|
| 135 |
+
"char_count": 2738,
|
| 136 |
+
"has_text_layer": true
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"page": 27,
|
| 140 |
+
"char_count": 2748,
|
| 141 |
+
"has_text_layer": true
|
| 142 |
+
},
|
| 143 |
+
{
|
| 144 |
+
"page": 28,
|
| 145 |
+
"char_count": 2762,
|
| 146 |
+
"has_text_layer": true
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"page": 29,
|
| 150 |
+
"char_count": 2766,
|
| 151 |
+
"has_text_layer": true
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"page": 30,
|
| 155 |
+
"char_count": 2757,
|
| 156 |
+
"has_text_layer": true
|
| 157 |
+
},
|
| 158 |
+
{
|
| 159 |
+
"page": 31,
|
| 160 |
+
"char_count": 2774,
|
| 161 |
+
"has_text_layer": true
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"page": 32,
|
| 165 |
+
"char_count": 2779,
|
| 166 |
+
"has_text_layer": true
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"page": 33,
|
| 170 |
+
"char_count": 2743,
|
| 171 |
+
"has_text_layer": true
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"page": 34,
|
| 175 |
+
"char_count": 2753,
|
| 176 |
+
"has_text_layer": true
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"page": 35,
|
| 180 |
+
"char_count": 2729,
|
| 181 |
+
"has_text_layer": true
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"page": 36,
|
| 185 |
+
"char_count": 2732,
|
| 186 |
+
"has_text_layer": true
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"page": 37,
|
| 190 |
+
"char_count": 2755,
|
| 191 |
+
"has_text_layer": true
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"page": 38,
|
| 195 |
+
"char_count": 1440,
|
| 196 |
+
"has_text_layer": true
|
| 197 |
+
}
|
| 198 |
+
]
|
| 199 |
+
}
|
debug/20260518_142500/cp1_page_01_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 1,
|
| 3 |
+
"png_size_kb": 365.6,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 1877,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n1\n38\nYour Details\nName\nMR KORADA \nSATYANARAYANA \nAddress\nS/O KORADA AUDIAH,PLOT \nNO-76 NEAR SRINIVASA,\nCOLLEGE,SBI COLONY \nVIZIANAGARAM,VIZI,535003\nMobile No\n6**** *7650\nEmail id\nStatement Details\nStatement Date\n24-04-2026 23:56\nStatement Period\n24-04-2025 to 24-04-2026\nAccount Details\nCustomer/CIF ID\n56789958\nAccount Type\nSavings Account\nAccount Name\nKORADA SATYANARAYANA\nAccount Number\n253110100033102\nCurrency\nINR\nIFSC\nUBIN0825310\nBranch Address\nPHOOLBAGH\nD.NO.21-13"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_02_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 2,
|
| 3 |
+
"png_size_kb": 457.7,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2693,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n2\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n29-05-2025\nV54438970\nUPIAR/017412959933/DR/ APSRTC/YESB/APSRTCOFFLINEE\n105.0(Dr)\n46374.31(Cr)\n01-06-2025\nX14855162\nUPIAR/826566078890/DR/KELLA BA/YESB/ Q403062371@yb\n140.0(Dr)\n46234.31(Cr)\n04-06-2025\nS48231253\nUPIAB/679706761084/CR/KUSUMAPU/BARB/korada30112@yb\n5500.0(Cr)\n51734.31(Cr)\n09-06-2025\nU94762212\nUPIAR/516004560116/DR/ ICCL/YESB/ ICCLMF@yb\n1000.0(Dr)\n50734.31(Cr)\n09-06-2025\nU96426663\nUPIAR/516072632025/DR/"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_03_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 3,
|
| 3 |
+
"png_size_kb": 459.9,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2700,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n3\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n16-07-2025\nW75419149\nUPIAR/431099256027/DR/PUNNANA /SBIN/ Q810056448@yb\n30.0(Dr)\n18034.14(Cr)\n16-07-2025\nW83176337\nUPIAR/445905073344/DR/SHAIK B/FDRL/BHARATPE.90071\n150.0(Dr)\n17884.14(Cr)\n16-07-2025\nW93140899\nUPIAR/784159703380/DR/SRI SANJ/FDRL/sanjeevani2344\n20.0(Dr)\n17864.14(Cr)\n16-07-2025\nW94950563\nUPIAR/356748168258/DR/SKL VIN /ICIC/pinelabs.26344\n2245.0(Dr)\n15619.14(Cr)\n17-07-2025\nX30778246\nUPIAR/981496790334"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_04_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 4,
|
| 3 |
+
"png_size_kb": 463.0,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2726,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n4\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n18-08-2025\nV97536626\nUPIAR/374842674958/DR/KUSUMAPU/BARB/korada30112@yb\n30000.0(Dr)\n10415.02(Cr)\n20-08-2025\nW89896802\nIMPSAB/523214646291/Mr SATYANARAYANA /6303357650\n30000.0(Cr)\n40415.02(Cr)\n20-08-2025\nW89983878\nUPIAR/171711803971/DR/KUSUMAPU/BARB/korada30112@yb\n25500.0(Dr)\n14915.02(Cr)\n21-08-2025\nX54502272\nUPIAR/288157497249/DR/Sri Vasa/YESB/ Q258749858@yb\n28.0(Dr)\n14887.02(Cr)\n21-08-2025\nX83592817\nIMPSAB/523322"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_05_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 5,
|
| 3 |
+
"png_size_kb": 468.6,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2742,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n5\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n11-09-2025\nW22044077\nUPIAB/111091072628/CR/DINDI RA/IOBA/rameshdindi73@\n3500.0(Cr)\n17032.85(Cr)\n11-09-2025\nW58759857\nUPIAR/128561587280/DR/VENKATA /YESB/paytm.s1ao6ec@\n60.0(Dr)\n16972.85(Cr)\n11-09-2025\nW65560109\nUPIAR/740819912060/DR/KALYANI /YESB/ Q842870797@yb\n100.0(Dr)\n16872.85(Cr)\n11-09-2025\nW71250250\nUPIAB/240478034354/CR/DONDAPAT/KKBK/8121989447-2@a\n3000.0(Cr)\n19872.85(Cr)\n12-09-2025\nX22796892\nUPIAR/525160479"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_06_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 6,
|
| 3 |
+
"png_size_kb": 466.9,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2737,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n6\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n20-09-2025\nV21097717\nUPIAR/919485861324/DR/SAI GANE/YESB/paytmqr58cc4a@\n155.0(Dr)\n34480.41(Cr)\n20-09-2025\nV21449229\nUPIAR/181931202123/DR/MAYURI T/YESB/ Q834771198@yb\n60.0(Dr)\n34420.41(Cr)\n20-09-2025\nV35757543\nUPIAR/110753763845/DR/Siyyadul/SBIN/ 8008146952@yb\n40.0(Dr)\n34380.41(Cr)\n21-09-2025\nV57526074\nUPIAR/115907141336/DR/SUVVADA /YESB/ Q952938643@yb\n130.0(Dr)\n34250.41(Cr)\n21-09-2025\nV64431821\nUPIAR/279599479832"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_07_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 7,
|
| 3 |
+
"png_size_kb": 463.1,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2722,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n7\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n28-09-2025\nT1172867\nUPIAB/183159475035/CR/REDDY KA/CNRB/shankar.reddy2\n700.0(Cr)\n42806.51(Cr)\n28-09-2025\nT2751198\nUPIAR/305314549262/DR/ADIGARLA/YESB/ Q011307040@yb\n85.0(Dr)\n42721.51(Cr)\n28-09-2025\nT11770793\nUPIAR/364672217864/DR/CHEKKA S/YESB/paytm.s1ciysn@\n20.0(Dr)\n42701.51(Cr)\n28-09-2025\nT27560908\nUPIAR/048029829167/DR/ANKABATT/YESB/ Q062714588@yb\n140.0(Dr)\n42561.51(Cr)\n28-09-2025\nT37613951\nUPIAR/189371304758/D"
|
| 7 |
+
}
|
debug/20260518_142500/cp1_page_08_raw.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"page": 8,
|
| 3 |
+
"png_size_kb": 465.9,
|
| 4 |
+
"has_text_layer": true,
|
| 5 |
+
"text_char_count": 2746,
|
| 6 |
+
"text_preview": "Savings Account\nPage of \n8\n38\nDate\nTransaction Id\nRemarks\nAmount( )\nBalance( )\n03-10-2025\nW67535230\nUPIAB/043294329641/CR/REDDY VE/UTIB/ 9182240851@ax\n400.0(Cr)\n30084.37(Cr)\n03-10-2025\nW74021681\nUPIAR/522661787264/DR/Mr Bandi/YESB/ Q669290821@yb\n36.0(Dr)\n30048.37(Cr)\n03-10-2025\nW74284043\nUPIAR/894019215323/DR/Mrs Ter/YESB/ Q246787037@yb\n27.0(Dr)\n30021.37(Cr)\n04-10-2025\nX3413451\nUPIAR/988812903453/DR/SAMANVIT/YESB/paytm-9183714e\n100.0(Dr)\n29921.37(Cr)\n04-10-2025\nX42104803\nUPIAR/806276460674/D"
|
| 7 |
+
}
|