Skip to content

Vrundali-R/langchain-runnable-chains

Repository files navigation

LangChain Runnable Chains

A collection of practical LangChain workflow implementations built using Groq LLMs and LangChain's runnable architecture.

This project explores different chaining patterns such as sequential pipelines, branching logic, parallel execution, and structured output parsing using real-world examples.


What's Included

Simple Chain

Basic prompt → model → parser workflow for generating AI responses.

Sequential Chain

Multi-step workflow where the output of one chain becomes the input for another.

Parallel Chain

Runs multiple tasks simultaneously and combines the results into a single output.

Branching Chain

Uses conditional routing to generate different responses based on sentiment classification.


Tech Stack

  • Python
  • LangChain
  • Groq API
  • Pydantic
  • Runnable Chains
  • Prompt Templates

Project Structure

langchain-runnable-chains/
│
├── chains/
│   ├── simple_chain.py
│   ├── sequential_chain.py
│   ├── parallel_chain.py
│   └── branching_chain.py
│
├── screenshots/
│
├── .env.example
├── .gitignore
├── requirements.txt
└── README.md

Setup

Clone the repository

git clone https://github.com/your-username/langchain-runnable-chains.git

Move into the project directory

cd langchain-runnable-chains

Install dependencies

pip install -r requirements.txt

Environment Variables

Create a .env file and add:

GROQ_API_KEY=your_groq_api_key

Running the Examples

Example:

python chains/simple_chain.py

You can similarly run:

  • sequential_chain.py
  • parallel_chain.py
  • branching_chain.py

Concepts Covered

  • Runnable chains
  • Prompt pipelines
  • Output parsers
  • Structured responses
  • Parallel execution
  • Conditional branching
  • Chain visualization
  • LLM workflow orchestration

Screenshots

Add terminal outputs or chain graphs inside the screenshots/ folder and reference them here.

Example:

![Chain Output](screenshots/demo.png)

Author

Vrundali Rahangdale

About

LangChain workflow implementations using Groq, runnable chains, branching, parallel execution, and structured output parsing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages