LangStream Documentation
Langstream.aiLangStream GitHub RepoChangelog
  • LangStream Documentation
  • ❤️Langstream.ai
  • ⭐LangStream GitHub Repo
  • 📜Changelog
  • about
    • What is LangStream?
    • License
  • Get Started
  • installation
    • LangStream CLI
    • Docker
    • Minikube (mini-langstream)
    • Kubernetes
    • Build and install from source
  • Building Applications
    • Vector Databases
    • Application structure
      • Pipelines
      • Instances
      • Configuration
      • Topics
      • Assets
      • Secrets
      • YAML templating
      • Error Handling
      • Stateful agents
      • .langstreamignore
    • Sample App
    • Develop, test and deploy
    • Application Lifecycle
    • Expression Language
    • API Gateways
      • Websocket
      • HTTP
      • Message filtering
      • Gateway authentication
    • API Reference
      • Agents
      • Resources
      • Assets
  • LangStream CLI
    • CLI Commands
    • CLI Configuration
    • Web interface
  • Integrations
    • Large Language Models (LLMs)
      • OpenAI
      • Hugging Face
      • Google Vertex AI
      • Amazon Bedrock
      • Ollama
    • Data storage
      • Astra Vector DB
      • Astra
      • Cassandra
      • Pinecone
      • Milvus
      • Solr
      • JDBC
      • OpenSearch
    • Integrations
      • Apache Kafka Connect
      • Apache Camel
    • LangServe
  • Pipeline Agents
    • Agent Messaging
    • Builtin agents
      • Input & Output
        • webcrawler-source
        • s3-source
        • azure-blob-storage-source
        • sink
        • vector-db-sink
        • camel-source
      • AI Agents
        • ai-chat-completions
        • ai-text-completions
        • compute-ai-embeddings
        • flare-controller
      • Text Processors
        • document-to-json
        • language-detector
        • query
        • query-vector-db
        • re-rank
        • text-normaliser
        • text-extractor
        • text-splitter
        • http-request
      • Data Transform
        • cast
        • compute
        • drop
        • drop-fields
        • merge-key-value
        • unwrap-key-value
      • Flow control
        • dispatch
        • timer-source
        • trigger-event
    • Custom Agents
      • Python sink
      • Python source
      • Python processor
      • Python service
    • Agent Developer Guide
      • Agent Types
      • Agent Creation
      • Configuration and Testing
      • Environment variables
  • Messaging
    • Messaging
      • Apache Pulsar
      • Apache Kafka
      • Pravega.io
  • Patterns
    • RAG pattern
    • FLARE pattern
  • Examples
    • LangServe chatbot
    • LlamaIndex Cassandra sink
Powered by GitBook
On this page
  • Globals
  • Manifest
  • streamingCluster
Edit on GitHub
  1. Building Applications
  2. Application structure

Instances

This is a declaration of what infrastructure will support the “streaming” and “compute” of the pipeline. Streaming refers to what messaging platform the topics will be created in. Compute refers to where the agents will run the pipeline steps.

instance:
  globals:
    tableName: "vsearch.products"
  streamingCluster:
    type: "kafka"
    configuration:
      admin:
        bootstrap.servers: kafka-gcp-useast4.dev.streaming.datastax.com:9093
        security.protocol: SASL_SSL
        sasl.jaas.config: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${ secrets.astra-token.tenant }' password='token:${ secrets.astra-token.token }';"
        sasl.mechanism: PLAIN
        session.timeout.ms: "45000"
  computeCluster:
    type: "kubernetes"

Globals

Within instance.yaml, use "globals" to define values for parameters across your application.

For example, this instance defines topicName as a global parameter with the value "input-topic":

instance:
  globals:
    topicName: "input-topic"
    otherTopicName: "${OTHER_TOPIC_NAME:-default-topic-name}"

The second global otherTopicName uses an alternate declaration method where the value is loaded from a dotenv file containing a OTHER_TOPIC_NAME="value" line. The :- characters allow you to designate a default value - in this case, default-topic-name.

The topicName parameter can now be referenced wherever you need it, perhaps in your application's pipeline.yaml file:

topics:
  - name: "${globals.topicName}"
    creation-mode: create-if-not-exists
    deletion-mode: delete
  - name: "${globals.otherTopicName}"
    creation-mode: create-if-not-exists
    deletion-mode: delete

You can also use these parameters when creating assets, as in CREATE TABLE IF NOT EXISTS ${globals.vectorKeyspace}.${globals.vectorTable}.

Manifest

Root
Node
Type
Description

instance

Top-level node

globals

object

A set of name:value pairs that should be applied to all clusters.

Example:

tableName: "vsearch.products"

streamingCluster

object

The settings of the messaging platform use to stream data. See the ref below for more.

computeCluster

object

The settings of the cluster where agents process data. See the ref below for more.

streamingCluster

Label
Type
Description

type

string

The type name of messaging platform to be used. Refer to the instance clusters area for supported types.

configuration

object

Configurations of the streaming platform. Refer to the instance clusters area for supported configuration.

DataStax Astra users

To use your Astra streaming tenant as the streaming cluster with LangStream, enable the Starlight for Kafka feature. Doing so will provide you with the needed bootstrap and security information to use the kafka type.

PreviousPipelinesNextConfiguration

Last updated 1 year ago

Read more about enabling Starlight for Kafka in Astra Streaming in the and also in the . Learn more about the Starlight for Kafka project .

documentation
learning site
here