assistant-ui-langgraph-fastapi Demonstration Project

repository·main·Indexed 42 days ago

https://github.com/yonom/assistant-ui-langgraph-fastapi

A demonstration project integrating LangGraph, assistant-stream, and FastAPI to build an AI agent with a real-time streaming backend and a Next.js/assistant-ui frontend. The architecture utilizes Python 3.11, FastAPI for the server, and LangGraph's create_react_agent for agent orchestration.

Tokens
548
Snippets
4
Records
7
Agent score
3%

What's inside assistant-ui-langgraph-fastapi

  1. Overview of assistant-ui-langgraph-fastapi

    main

    This project is a demonstration of an AI agent architecture that integrates several key technologies:

    • LangGraph: Orchestrates the agent logic.
    • FastAPI: Serves as the backend server.
    • assistant-stream: Enables real-time response streaming from the backend to the frontend.
    • assistant-ui & Next.js: Provides a modern, responsive chat interface.

    The architecture is split into a backend/ directory (FastAPI + LangGraph) and a frontend/ directory (Next.js client).

  2. API Endpoint Configuration

    main

    The server exposes the LangGraph agent at a specific route. In the default configuration, the route is /api/chat. This endpoint is integrated into the FastAPI app instance using the add_langgraph_route utility, which connects the assistant_ui_graph to the web server.

    add_langgraph_route(app, assistant_ui_graph, "/api/chat")