Work

tchat

A small LangChain conversational interface

Year
2023
Language
Jupyter Notebook
Stars
1
Topics
langchain openai python chatbot

Overview

A small Python project exploring conversational interfaces with LangChain. It wires an OpenAI chat model with conversation memory and a thin orchestration layer so the assistant can keep context across turns. Mostly a learning sandbox for prompt patterns, memory back-ends, and the bits of LangChain that matter in practice.

Features

  • Conversational chat loop wired to OpenAI chat completions
  • LangChain memory back-end keeps multi-turn context across user messages
  • Prompt templates separated from orchestration so they can be swapped per use case
  • Notebooks document each piece of the stack for incremental learning

Why it exists

A sandbox, not a product

The intent here was to learn the moving parts of LangChain in a real conversation loop: when memory matters, when it hurts, how prompt templates compose, and what the orchestration layer actually buys you over calling the OpenAI SDK directly.

Tech stack

Modelling
OpenAI GPT LangChain Conversation memory
Language
Python Jupyter

Architecture

graph LR
  U["User<br/>message"] --> LC["LangChain<br/>Orchestrator"]
  LC --> MEM["Conversation<br/>Memory"]
  MEM --> LC
  LC --> P["Prompt<br/>Template"]
  P --> OAI["OpenAI<br/>Chat API"]
  OAI --> RESP["Response"]
  RESP --> LC
  LC --> U
  classDef io fill:#0a0a0a,stroke:#666,color:#fff
  classDef core fill:#1e1e1e,stroke:#444,color:#ddd
  class U,RESP io
  class LC,MEM,P,OAI core
Architecture: tchat