new feature: frontend with separated responses

This commit is contained in:
2026-09-11 09:33:55 -03:00
parent 6c81b21aaa
commit ecfbfbf8e1
60 changed files with 657 additions and 337 deletions

View File

@@ -230,6 +230,9 @@ KBDB_MAX_CROSS_REF_HOPS=1
KBDB_DOCUMENT_TYPE=customer_safe
KBDB_METADATA_JSON=
KBDB_MIN_SCORE=
KBDB_IDENTIFY_DOCUMENT=true
KBDB_STORE_QUERY=true
KBDB_IDENTIFY_TOP_N=3
# RAG grounding
RAG_GROUNDED_ONLY=false

View File

@@ -457,6 +457,8 @@ async def _process_gateway_message(req: GatewayRequest, emit_sse: bool = False)
"route": result.get("route"),
"intent": result.get("intent"),
"route_decision": result.get("route_decision"),
"supervisor_results": result.get("supervisor_results") or [],
"agent_responses": result.get("agent_responses") or result.get("supervisor_results") or [],
"domain": result.get("domain"),
"mcp_tools": result.get("mcp_tools"),
"mcp_results": result.get("mcp_results"),

View File

@@ -40,6 +40,7 @@ class AgentState(TypedDict, total=False):
missing_parameters: list[str]
supervisor_plan: dict[str, Any]
supervisor_results: list[dict[str, Any]]
agent_responses: list[dict[str, Any]]
pending_topics: list[dict[str, Any]]
handled_topics: list[dict[str, Any]]
active_agent: str

View File

@@ -490,6 +490,7 @@ class AgentWorkflow:
return {
"answer": answer,
"supervisor_results": partials,
"agent_responses": partials,
"mcp_results": mcp_results,
"next_state": "SUPERVISOR_ACTIVE",
}
@@ -569,6 +570,7 @@ class AgentWorkflow:
"final_answer": candidate,
"pending_topics": drained.pending_topics,
"handled_topics": drained.handled_topics,
"agent_responses": drained.agent_responses,
"mcp_results": drained.mcp_results,
"rag_results": drained.rag_results,
"output_guardrails_already_applied": False,
@@ -650,6 +652,7 @@ class AgentWorkflow:
"output_guardrails_already_applied": True,
"pending_topics": drained.pending_topics,
"handled_topics": drained.handled_topics,
"agent_responses": drained.agent_responses,
"mcp_results": drained.mcp_results,
"rag_results": drained.rag_results,
"guardrail_decisions": state.get("guardrail_decisions", [])

View File

@@ -215,7 +215,7 @@ LONG_TERM_MEMORY_INJECT_CONTEXT=true
# kbdb = KBDB enterprise via PKG_KB_SERVING.SEARCH_KNOWLEDGE_BASE
RAG_PROVIDER=standard
# Somente usados quando RAG_PROVIDER=kbdb. Se vazios, credenciais caem para ADB_*.
# Somente usados quando RAG_PROVIDER=kbdb; não há fallback para ADB_*.
KBDB_DB_USER=
KBDB_DB_PASSWORD=
KBDB_DB_DSN=
@@ -229,3 +229,6 @@ KBDB_MAX_CROSS_REF_HOPS=1
KBDB_DOCUMENT_TYPE=customer_safe
KBDB_METADATA_JSON=
KBDB_MIN_SCORE=
KBDB_IDENTIFY_DOCUMENT=true
KBDB_STORE_QUERY=true
KBDB_IDENTIFY_TOP_N=3

View File

@@ -452,6 +452,8 @@ async def _process_gateway_message(req: GatewayRequest, emit_sse: bool = False)
"route": result.get("route"),
"intent": result.get("intent"),
"route_decision": result.get("route_decision"),
"supervisor_results": result.get("supervisor_results") or [],
"agent_responses": result.get("agent_responses") or result.get("supervisor_results") or [],
"domain": result.get("domain"),
"mcp_tools": result.get("mcp_tools"),
"mcp_results": result.get("mcp_results"),

View File

@@ -37,6 +37,7 @@ class AgentState(TypedDict, total=False):
missing_parameters: list[str]
supervisor_plan: dict[str, Any]
supervisor_results: list[dict[str, Any]]
agent_responses: list[dict[str, Any]]
pending_topics: list[dict[str, Any]]
handled_topics: list[dict[str, Any]]
active_agent: str

View File

@@ -488,6 +488,7 @@ class AgentWorkflow:
return {
"answer": answer,
"supervisor_results": partials,
"agent_responses": partials,
"mcp_results": mcp_results,
"next_state": "SUPERVISOR_ACTIVE",
}
@@ -567,6 +568,7 @@ class AgentWorkflow:
"final_answer": candidate,
"pending_topics": drained.pending_topics,
"handled_topics": drained.handled_topics,
"agent_responses": drained.agent_responses,
"mcp_results": drained.mcp_results,
"rag_results": drained.rag_results,
"output_guardrails_already_applied": False,
@@ -648,6 +650,7 @@ class AgentWorkflow:
"output_guardrails_already_applied": True,
"pending_topics": drained.pending_topics,
"handled_topics": drained.handled_topics,
"agent_responses": drained.agent_responses,
"mcp_results": drained.mcp_results,
"rag_results": drained.rag_results,
"guardrail_decisions": state.get("guardrail_decisions", [])