Skip to content

NLP Agent Creation

Users describe what they want in plain English. The system extracts the intent, maps it to tools and a schedule, and presents a review screen before creating anything.

sequenceDiagram
  participant User
  participant UI as AgentBuilder UI
  participant BE as Backend :8080
  participant AIS as AI Service :9300
  participant LLM as Groq LLM

  User->>UI: "Monitor payment errors\nand alert me daily"
  UI->>AIS: POST /api/v1/agent-builder/parse\n{description: "..."}
  AIS->>LLM: System prompt + user description
  LLM-->>AIS: Structured JSON (name, tools, schedule, alert)
  AIS-->>UI: Parsed agent config

  UI->>User: Review screen\n(editable fields)
  User->>UI: Adjust schedule → "Every 4 hours"\nClick Confirm

  UI->>BE: POST /api/v1/agents\n{...finalConfig}
  BE-->>UI: Agent created {id: 42}
  UI-->>User: "Agent created!\nFirst run in 4 hours."

POST /api/v1/agent-builder/parse accepts a free-text description and returns a draft agent config.

{
"description": "Every morning, check if there were any payment timeout errors overnight and send me a summary"
}
{
"name": "Overnight Payment Timeout Monitor",
"description": "Checks for payment timeout errors from the previous night and summarizes findings",
"systemPrompt": "You are a monitoring agent for the Logrite platform. Your job is to check for payment timeout errors that occurred overnight (between midnight and 8am). Search the payment_queries logs for timeout-related errors, count occurrences, identify the most affected payment methods or endpoints, and provide a concise summary with recommendations.",
"toolsAllowed": ["semantic_search", "opensearch_query"],
"schedule": "0 8 * * *",
"scheduleLabel": "Every day at 8:00 AM",
"alertCondition": null,
"suggestedQuery": "Find payment timeout errors from last night (midnight to 8am)",
"confidence": 0.92
}

The AI Service uses a structured extraction prompt:

You are an agent configuration extractor for Logrite, a log analysis platform.
Given a user's description of what they want an AI agent to do, extract:
1. name: Short, descriptive agent name (max 60 chars)
2. description: One sentence explaining the agent's purpose
3. systemPrompt: Full system prompt the agent will use when executing
4. toolsAllowed: Array of tools from: ["semantic_search", "opensearch_query", "get_scan_results", "analyze_logs"]
5. schedule: Cron expression (or "manual" if no schedule mentioned)
6. scheduleLabel: Human-readable schedule description
7. alertCondition: {metric, operator, threshold} or null
8. suggestedQuery: The first query the agent should ask on each run
9. confidence: Float 0.0-1.0 confidence in your extraction
Respond ONLY with valid JSON matching this schema.
Available indexes: payment_queries, external_service_calls, database_queries, exceptions
Available tools: semantic_search (neural log search), opensearch_query (aggregations/filters),
get_scan_results (compliance scan data), analyze_logs (AI analysis)
User description: {userDescription}

The AgentBuilder UI presents the parsed config in an editable form before creation:

┌─────────────────────────────────────────────┐
│ Review Your Agent │
│ │
│ Name: [Overnight Payment Timeout Monitor ] │
│ │
│ Schedule: [Every day at 8:00 AM ▼] │
│ │
│ Tools allowed: │
│ ✅ semantic_search │
│ ✅ opensearch_query │
│ ☐ get_scan_results │
│ ☐ analyze_logs │
│ │
│ System prompt: │
│ [You are a monitoring agent... (editable)] │
│ │
│ Alert condition: None │
│ │
│ [Cancel] [Create Agent →] │
└─────────────────────────────────────────────┘
ConfidenceUI Behavior
≥ 0.85Parsed config shown with green indicator
0.60–0.84Parsed config shown with yellow warning — “Please review carefully”
< 0.60Low confidence banner — “We couldn’t confidently parse this. Please fill in manually.”

“Check periodically” → Defaults to hourly, user must confirm.

“Alert me about problems” → Shows tool browser for manual selection.

“Monitor errors” → Prompts: “Which service? payment, database, external calls, or all?”

“Do everything” → Returns error: “Please describe a specific monitoring task.”