NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::graph::IntentClassifierNode Class Reference

Node that classifies user intent via LLM and routes execution. More...

#include <node.h>

Inheritance diagram for neograph::graph::IntentClassifierNode:
[legend]
Collaboration diagram for neograph::graph::IntentClassifierNode:
[legend]

Public Member Functions

std::string get_name () const override
 Get the node's unique name within the graph.
 
 IntentClassifierNode (const std::string &name, const NodeContext &ctx, const std::string &prompt, std::vector< std::string > valid_routes)
 Construct an intent classifier node.
 
asio::awaitable< NodeOutputrun (NodeInput in) override
 v0.4 PR 9a: unified run — calls the LLM with the classification prompt, parses the result against valid_routes, writes the chosen route to __route__.
 

Detailed Description

Node that classifies user intent via LLM and routes execution.

Calls the LLM with a classification prompt, writes the detected intent to the "__route__" channel. Used with the "route_channel" condition for dynamic routing based on user intent.

Definition at line 274 of file node.h.

Constructor & Destructor Documentation

◆ IntentClassifierNode()

neograph::graph::IntentClassifierNode::IntentClassifierNode ( const std::string &  name,
const NodeContext ctx,
const std::string &  prompt,
std::vector< std::string >  valid_routes 
)

Construct an intent classifier node.

Parameters
nameUnique node name within the graph.
ctxNode context providing the LLM provider.
promptClassification prompt template sent to the LLM.
valid_routesList of valid intent route names the LLM can return.

Member Function Documentation

◆ get_name()

std::string neograph::graph::IntentClassifierNode::get_name ( ) const
inlineoverridevirtual

Get the node's unique name within the graph.

Returns
Node name string.

Implements neograph::graph::GraphNode.

Definition at line 292 of file node.h.

◆ run()

asio::awaitable< NodeOutput > neograph::graph::IntentClassifierNode::run ( NodeInput  in)
overridevirtual

v0.4 PR 9a: unified run — calls the LLM with the classification prompt, parses the result against valid_routes, writes the chosen route to __route__.

Streams per-token events when in.stream_cb is non-null.

Implements neograph::graph::GraphNode.


The documentation for this class was generated from the following file: