Skip to content

johnkitaoka/simple-sse-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple SSE Agent

A real-time chat application demonstrating Server-Sent Events (SSE) with an AI agent backend.

Tech Stack

Frontend:

  • Next.js 14 with TypeScript, React 18, Server-Sent Events for real-time streaming

Backend:

  • Python with FastAPI, LangGraph for agent workflows

Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.8+

Setup

  1. Install frontend dependencies:

    npm install
  2. Install backend dependencies:

    cd backend
    pip install -r requirements.txt

Running the Application

  1. Start the backend server:

    cd backend
    python uvicorn app:app --reload --port 8000
  2. Start the frontend (in a new terminal):

    npm run dev
  3. Open your browser: Navigate to http://localhost:3000

Project Structure

├── app/                 # Next.js app directory
├── backend/            # FastAPI backend
│   ├── app.py         # Main FastAPI application
│   ├── graph.py       # LangGraph agent definition
│   └── requirements.txt
├── components/         # React components
└── package.json       # Frontend dependencies

API Endpoints

  • GET /agent?query=<your-question> - Stream AI agent responses via SSE

About

A simple full-stack agent application that streams updates from a LangGraph workflow over SSE, built with a React frontend and a FastAPI backend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors