Skip to main content

StreamGraph

StreamGraph

StreamGraph in Nstream AI is a dynamic, graph-based execution framework designed for real-time data processing and AI-driven decision-making in streaming applications. It enables users to define complex streaming workflows using a declarative YAML-based approach, integrating AI models, vector databases, and event-driven data sources to process, analyze, and act on high-throughput data streams. Built on a Kubernetes-native architecture, StreamGraph ensures scalability, fault tolerance, and adaptive data processing, making it ideal for applications such as fraud detection, market sentiment analysis, RAG pipelines, and predictive maintenance. By seamlessly combining streaming analytics with AI inference, StreamGraph transforms raw event streams into actionable intelligence in real-time.

Sample YAML Configuration

apiVersion: streams.nstream.ai/v1
kind: StreamGraph
metadata:
name: "STREAMGRAPH_NAME"
spec:
graphName: "GRAPH_NAME"
graphConfig:
graphNodes:
- nodeName: "NODE_NAME"
nodeInput:
nodeConnector: "INPUT_CONNECTOR"
nodeRef: "NODE_REFERENCE"
nodeContext:
nodeKnowledgeBase: "KNOWLEDGEBASE_NAME"
knowledgeSearchLimit: "SEARCH_LIMIT"
nodeInference:
modelName: "MODEL_NAME"
modelFinetuningName: "FINETUNER_NAME"
nodePreprocessing:
inputTableName: "INPUT_TABLE_NAME"
query: "SELECT fields FROM {{INPUT_TABLE_NAME}} WHERE conditions"
promptTemplate: "SYSTEM_CONTEXT: Contextual background. USER_QUESTION: Specific question or directive."
outputDataConnector: "OUTPUT_CONNECTOR"

StreamGraph YAML Configuration Parameters

KeyDescriptionExample
apiVersionDefines the API version for the configurationstreams.nstream.ai/v1
kindIdentifies the type of resource being configuredStreamGraph
nameUnique name for the StreamGraph instancestream-graph
graphNameDesignation for the StreamGraph instancestream-graph
nodeNameName of the node within the graphanalytic_node
nodeConnectorSpecifies the connector for node inputevent-source-connector
nodeKnowledgeBaseKnowledge base used for node contextdemo-node-1-kb
modelNameModel used for inference at this nodellama3-8b-instruct
modelFinetuningNameFinetuner associated with the modeldemo-node-1-finetuner
inputTableNameTable name for preprocessing queriessource_table
querySQL query for data preprocessingSELECT datetime, event_data FROM {{source_table}}
promptTemplateTemplate providing context for user queries"SYSTEM_CONTEXT: - USER_QUESTION: " -
outputDataConnectorConnector for outputting data from the graphdemo-sink-connector