Skip to content

GetStream/chat-ai-samples

Repository files navigation

Stream Chat AI Integration Examples

Integrating Stream Chat with AI

This repo contains sample projects that integrate our UI components for building AI chat assistants, as well as server-side integrations with Vercel's AI SDK and Langchain:

  • Our UI components (available on iOS, Android, React, and React Native) work well with Stream Chat, but can also be used standalone. These components facilitate the development of AI assistants such as ChatGPT, Grok, Gemini, and others.
  • NodeJS packages - stream-chat-js-ai-sdk and stream-chat-langchain - which provide seamless integrations with Vercel’s AI SDK and LangChain, respectively. Stream Chat delivers the realtime layer and conversational memory, while the AI SDK and LangChain each offer a clean interface to multiple LLMs and support more advanced AI workflows. Additionally, we provide an example that uses a single backend server (NodeJS or Python) to manage the lifecycle of agents and handle the connection to external providers.

Architecture Overview 🏗️

Here’s an overview of the general approach you can take to integrate Stream Chat with different LLMs.

Stream Chat AI Integration Architecture

The customer app can use our AI components to build the chat assistant’s UI faster:

  • streaming message view with advanced rendering support (markdown, code syntax highlighting, charts, tables)
  • standalone composer with different options such as agent modes and photo picker
  • speech to text component
  • conversation suggestions
  • converstation history
  • and much more.

Your backend can use one of the provided packages to facilitate the integration with popular AI SDKs, such as Langchain and Vercel’s AI SDK. Or, in case you don’t want to depend on these packages, you can use our standalone NodeJS and Python examples, that show you how to integrate with Stream Chat’s server-side client and various LLMs (OpenAI and Anthropic are provided as examples).

Choose Your Platform

To get started building with AI and Stream, simply pick the example most suited to your application and follow the step by step instructions outlined in each:

For your backend integration, you can try out one of these options:

Quick Links 🔗

Prerequisites ✅

Before you begin, you'll need:

  • A Stream API Key (Register for free)
  • Credentials of the LLM you want to use in your integration (OpenAI, Anthropic, xAI and others)
  • Optional mem0 key for memory and context across conversations

AI Guides 📚

These guides explore more of how AI can be used across our SDKs and products.

Community Writing 📝

Check out what the community has built using Stream.

What Creators Are Building 🚀

Explore real-world apps built by developers using Stream SDKs, featured on YouTube.

Contributing 🤔

We welcome contributions that improve functionality or fix issues:

  1. Fork the repository
  2. Create a feature branch
  3. Implement your changes
  4. Add tests if applicable
  5. Submit a PR with a clear description/changes

Sample App Submissions

We encourage you to try the tutorials and submit new sample apps 🥳

  • How can I submit a sample app?
    • Open a pr with a proper description and we'll review it as soon as possible.

Bug Reports 🕷

  • Open an issue with:
    • Clear steps to reproduce
    • Add screenshots/videos if possible
    • Expected behavior
    • Actual behavior
    • Platform/environment details

Releases

No releases published

Packages

No packages published

Contributors 12