Back to ChatHub
ChatHub

Natural Language Queries

19 views

title: Natural Language Queries category: ChatHub tags: chat, natural-language, ai, nlp, queries priority: Normal

Natural Language Queries

ChatHub supports full natural language interaction -- you can ask questions, request data, and issue commands in plain English. Behind the scenes, an LLM-first routing architecture interprets your intent and directs your message to the appropriate handler.

How LLM-First Routing Works

Every natural language message you send to ChatHub follows a multi-tier processing pipeline. Understanding this architecture helps you write queries that produce the best results.

The 3-Tier Fallback System

Tier Engine Description Speed
Tier 1 LLM Intent Parsing Your message is sent to Anthropic Claude, which analyzes intent, extracts entities, and returns a structured routing decision ~1-2 seconds
Tier 2 NaturalLanguageParser A regex-based fallback that pattern-matches against 18 keyword categories Instant
Tier 3 Command CanHandle() Each registered command evaluates whether it can handle the input and returns a confidence score Instant

When you send a message:

  1. Tier 1 (LLM): The message is sent to the configured LLM (Anthropic Claude). The model analyzes your intent, extracts relevant entities (names, types, filters), and returns a structured response with a routing_type field.
  2. Tier 2 (Regex): If the LLM is unavailable or returns low confidence, the NaturalLanguageParser applies pattern matching across 18 keyword categories to identify intent.
  3. Tier 3 (Commands): If neither tier produces a match, each registered IChatCommand evaluates the input via its CanHandle() method and returns a match confidence score (default 0.5). The highest-confidence command handles the request.

Tip: Slash commands (e.g., /search, /list) bypass all three tiers entirely and go straight to the CommandDispatcher. Use them when you want guaranteed, instant routing.

Routing Types

The LLM returns one of three routing types that determine how your message is handled:

Routing Type Behavior Example
command Routes to a specific slash command with extracted parameters "Show me members of Domain Admins" routes to /members Domain Admins
question Streams an AI-generated answer using RAG (Retrieval-Augmented Generation) "What is the best practice for service account management?"
greeting Returns a friendly response with environment snapshot and suggestion chips "Hello" or "Good morning"

The 18 Keyword Categories

The NaturalLanguageParser (Tier 2) recognizes patterns across these keyword categories for intent classification:

Category Example Keywords Maps To
Search "find", "search", "look up", "locate" /search
List "list", "show all", "display" /list
Details "details", "info about", "tell me about" /details
Members "members of", "who is in" /members
Groups "groups for", "belongs to", "member of" /groups
Enable "enable", "activate", "turn on" /enable
Disable "disable", "deactivate", "turn off" /disable
Password "reset password", "password reset" /resetpw
Edit "change", "modify", "update", "set" /edit
Insights "insights", "analyze", "risk" /insights
Briefing "briefing", "summary", "overview" /briefing
Sync "sync", "synchronize", "import" /sync
Audit "audit", "audit log", "who changed" /audit
Report "report", "generate report" /report
Policy "policy", "compliance", "violation" /policy
Review "review", "access review", "certify" /review
Tag "tag", "label", "classify" /tag
Help "help", "how do I", "what can you do" /help

Writing Effective Natural Language Queries

Be Specific

The more context you provide, the more accurate the routing and results.

Less Effective More Effective
"show users" "Show me disabled user accounts in the IT department"
"find admin" "Find all users who are members of Domain Admins"
"list computers" "List computers that haven't logged in for 90 days"
"check policy" "Check the password expiration policy compliance status"

Use Natural Phrasing

ChatHub understands conversational English. You do not need to structure queries in a specific format.

All of these work:

  • "Who are the members of the VPN Access group?"
  • "Show me who's in VPN Access"
  • "List members of VPN-Access-Group"
  • "I need to see the VPN Access group membership"

Combine Criteria

You can include multiple conditions in a single query:

Show me users in the Finance department who haven't logged in for 60 days
Find disabled service accounts that are members of privileged groups
List computers running Windows Server 2019 in the Seattle OU

Ask Follow-Up Questions

ChatHub maintains conversation context. After receiving results, you can ask follow-up questions:

  1. You: "Show me members of Domain Admins"
  2. ChatHub: (displays member list)
  3. You: "Which of those haven't logged in recently?"
  4. ChatHub: (filters the previous results by login activity)

Natural Language to Command Routing Examples

Here are examples of how natural language messages are routed to underlying commands:

Natural Language Input Routed To Parameters
"Find John Smith" /search query: "John Smith"
"Show me all security groups" /list type: groups, filter: security
"Who is in the HR team group?" /members group: "HR team"
"What groups does jane.doe belong to?" /groups user: "jane.doe"
"Disable the contractor account temp-user-01" /disable account: "temp-user-01"
"Give me a security briefing" /briefing (none)
"What's the risk score for john.smith?" /insights object: "john.smith"
"Run the Q1 access review" /review campaign: "Q1"
"Show me the audit trail for yesterday" /audit query: "last:1d"

Follow-Up Suggestion Chips

After every response, ChatHub displays clickable suggestion chips -- contextually relevant follow-up queries based on what you just asked. This helps you explore related data without typing.

How Suggestions Are Generated

After This Query Type Suggested Follow-Ups
User search "Show their group memberships", "Check their risk score", "View last login"
Group membership "Show nested groups", "Find inactive members", "Check group risk"
Briefing "Show inactive admin accounts", "List expiring passwords", "View open violations"
Insights "Show details", "Compare to peers", "View audit history"
Greeting "What needs my attention?", "Show me a briefing", "Find stale accounts"

Note: Greeting responses intentionally suggest natural language phrases like "What needs my attention?" rather than slash commands like "/insights", making the experience more conversational.

Using Suggestion Chips Effectively

Suggestion chips are designed to guide you through an investigative workflow. A typical session might look like:

  1. Start with a briefing: "Good morning"
  2. Click: "What needs my attention?"
  3. Review the flagged items
  4. Click: "Show me inactive admin accounts"
  5. Review the list
  6. Click: "Disable account temp-admin-02"

Streaming Responses

When ChatHub routes your query as a question type (Tier 1), the response is streamed in real time using SignalR. You see text appearing progressively as the AI generates its answer, similar to a live conversation. This is powered by the RAG pipeline, which retrieves relevant data from your synced directory before generating the response.

Troubleshooting Natural Language Queries

Issue Cause Solution
Query returns generic response Intent was not recognized Be more specific or use a slash command
Wrong command was triggered Ambiguous phrasing Rephrase with clearer intent keywords
Slow response time LLM processing latency Use slash commands for instant results
"I don't understand" response All three tiers failed to match Try rephrasing or check /help for available capabilities

Next Steps

Tags: chat natural-language ai nlp queries

Was this article helpful?

Related Articles

Using the AI Chat (ChatHub)
The /briefing Command
ChatHub Advanced Features