Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
becf93b
1
Parent(s): 7815afc
backend stabilization
Browse files- agents/nexus_master.py +3 -10
- agents/prompts.py +5 -2
- agents/tools/langchain_tools.py +1 -1
agents/nexus_master.py
CHANGED
|
@@ -190,16 +190,9 @@ async def nexus_gatekeeper(state: NexusState) -> Dict[str, Any]:
|
|
| 190 |
msg.id = str(uuid4())
|
| 191 |
return {"messages": [msg], "current_tool_output": "GATEKEEPER_RESPONSE"}
|
| 192 |
|
| 193 |
-
# 3. Conversational Fast Path (
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
resp = await llm.ainvoke([
|
| 197 |
-
SystemMessage(content=f"You are Nexus, a helpful assistant. Provide a very brief (1 sentence) response to the user's greeting or simple query. User name: {user_name}."),
|
| 198 |
-
HumanMessage(content=last_msg)
|
| 199 |
-
])
|
| 200 |
-
msg = AIMessage(content=resp.content)
|
| 201 |
-
msg.id = str(uuid4())
|
| 202 |
-
return {"messages": [msg], "current_tool_output": "GATEKEEPER_RESPONSE"}
|
| 203 |
|
| 204 |
return {"current_tool_output": "PROCEED"}
|
| 205 |
|
|
|
|
| 190 |
msg.id = str(uuid4())
|
| 191 |
return {"messages": [msg], "current_tool_output": "GATEKEEPER_RESPONSE"}
|
| 192 |
|
| 193 |
+
# 3. Conversational Fast Path (DELETED character-length bypass)
|
| 194 |
+
# Commands like 'Pulse Check' (11 chars) must go to the router.
|
| 195 |
+
# ONLY greetings and thanks should be short-circuited here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
return {"current_tool_output": "PROCEED"}
|
| 198 |
|
agents/prompts.py
CHANGED
|
@@ -54,10 +54,13 @@ CORE TOOLSET & PRIORITY:
|
|
| 54 |
- Keywords: status, active, recent, my tickets, update on.
|
| 55 |
3. ANALYTICS: Use for any request involving data visualization, trends, charts, metrics, or "heatmaps".
|
| 56 |
- PRIORITY: EXCLUSIVE (If the request asks for "counts", "trends", "charts", or "distribution", call ONLY this tool).
|
| 57 |
-
4.
|
| 58 |
-
5.
|
|
|
|
| 59 |
|
| 60 |
STRATEGIC DIRECTIVES:
|
|
|
|
|
|
|
| 61 |
- SEARCH-FIRST PRINCIPLE: Never guess technical facts. If a user asks a factual question, your FIRST instinct must be to call KB_SEARCH or TICKETS.
|
| 62 |
- TOOL EXCLUSIVITY: If a request involves data visualization or statistics, ALWAYS prioritize ANALYTICS. Do not call KB_SEARCH for metrics.
|
| 63 |
- CONTEXTUAL RECALL: You have access to active ticket data below. Use it to skip redundant questions and go straight to resolution.
|
|
|
|
| 54 |
- Keywords: status, active, recent, my tickets, update on.
|
| 55 |
3. ANALYTICS: Use for any request involving data visualization, trends, charts, metrics, or "heatmaps".
|
| 56 |
- PRIORITY: EXCLUSIVE (If the request asks for "counts", "trends", "charts", or "distribution", call ONLY this tool).
|
| 57 |
+
4. SUMMARIZE_WORKSPACE: Use for high-level health summaries, status reports, or specific "Pulse Check" requests.
|
| 58 |
+
5. SIMILAR_INCIDENTS: Use ONLY when troubleshooting a specific technical error to find historical resolutions that worked in the past.
|
| 59 |
+
6. CONVERSE: Use ONLY if no tool is required (e.g., greetings, simple acknowledgments) or if you need to ask a clarifying question before selecting a tool.
|
| 60 |
|
| 61 |
STRATEGIC DIRECTIVES:
|
| 62 |
+
- NO HALLUCINATION: Never claim "systems appear stable" or provide health updates without first running SUMMARIZE_WORKSPACE or ANALYTICS.
|
| 63 |
+
- PULSE CHECK: If the user query is "Pulse Check" or asks for system status, you MUST call SUMMARIZE_WORKSPACE.
|
| 64 |
- SEARCH-FIRST PRINCIPLE: Never guess technical facts. If a user asks a factual question, your FIRST instinct must be to call KB_SEARCH or TICKETS.
|
| 65 |
- TOOL EXCLUSIVITY: If a request involves data visualization or statistics, ALWAYS prioritize ANALYTICS. Do not call KB_SEARCH for metrics.
|
| 66 |
- CONTEXTUAL RECALL: You have access to active ticket data below. Use it to skip redundant questions and go straight to resolution.
|
agents/tools/langchain_tools.py
CHANGED
|
@@ -31,7 +31,7 @@ async def get_ticket_details(ticket_id: str, **kwargs) -> str:
|
|
| 31 |
|
| 32 |
@tool(args_schema=SummarizeWorkspaceInput)
|
| 33 |
async def summarize_workspace(**kwargs) -> str:
|
| 34 |
-
"""
|
| 35 |
pass
|
| 36 |
|
| 37 |
@tool(args_schema=AddCommentInput)
|
|
|
|
| 31 |
|
| 32 |
@tool(args_schema=SummarizeWorkspaceInput)
|
| 33 |
async def summarize_workspace(**kwargs) -> str:
|
| 34 |
+
"""Generate a high-fidelity 'Executive Health Narrative' (Pulse Check) for the current workspace. USE THIS for 'Pulse Check' requests, status reports, or high-level health summaries."""
|
| 35 |
pass
|
| 36 |
|
| 37 |
@tool(args_schema=AddCommentInput)
|