https://github.com/shamspias/threadedtalk
A FastAPI-based client for LangGraph SDK, enabling threaded conversations, message streaming, and conversation management.
https://github.com/shamspias/threadedtalk
agentic-ai langgraph-python langgraph-sdk
Last synced: about 1 month ago
JSON representation
A FastAPI-based client for LangGraph SDK, enabling threaded conversations, message streaming, and conversation management.
- Host: GitHub
- URL: https://github.com/shamspias/threadedtalk
- Owner: shamspias
- Created: 2025-03-13T14:28:44.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-13T15:27:11.000Z (2 months ago)
- Last Synced: 2025-03-13T16:22:09.776Z (2 months ago)
- Topics: agentic-ai, langgraph-python, langgraph-sdk
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **ThreadedTalk**
**ThreadedTalk** is a FastAPI-based application that serves as a client interface for a deployed **LangGraph agent**. It enables structured conversation handling, real-time streaming responses, and optimized cleanup of inactive conversations using **LangGraph SDK**.
## **Features**
✅ **LangGraph Integration** – Interacts with a deployed LangGraph agent for conversation management.
✅ **Threaded Conversations** – Each conversation is mapped to a unique thread ID stored in a database.
✅ **Message Streaming** – Supports both synchronous and streaming-based responses.
✅ **Conversation Management** – Create, retrieve, and delete conversations dynamically.
✅ **Optimized Cleanup** – Deletes inactive conversations based on a given timestamp.
✅ **Database Support** – Uses PostgreSQL/MySQL for persistent storage.## **API Endpoints**
### **1. Conversation API**
- `POST /conversation` – Create a conversation and get a thread ID.
- `POST /conversation/message` – Send a message to the LangGraph agent.
- `POST /conversation/stream` – Stream conversation responses from the LangGraph agent.### **2. Delete API**
- `DELETE /conversation/{conversation_id}` – Deletes a conversation and its associated thread.### **3. Cleanup API**
- `DELETE /conversation/cleanup?unused_since=` – Deletes inactive conversations before the specified timestamp.## **Installation**
### **Prerequisites**
- **Python 3.11+**
- **PostgreSQL/MySQL** (configured as per database settings)
- **LangGraph SDK** (installed via `requirements.txt`)### **Setup & Install Dependencies**
```sh
pip install -r requirements.txt
```
### Database Migration
Generate Initial Migration:```
alembic revision --autogenerate -m "Initial migration"
```
Apply Migrations:```
alembic upgrade head
```## **Running the Project**
```sh
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
```