Welcome to AI Workflow Repo! This repository is designed as a hands-on tutorial for learners who want to understand and experiment with modern AI agent workflows using LangChain, LangGraph, and popular transformer-based models.
Here, you'll find practical code samples, notebook workflows, and step-by-step guides to help you learn about:
- Building chatbots with transformer models
- Designing chains and workflows for AI agents
- Using structured outputs and output parsers
- Implementing stateful and stateless conversational agents
- Leveraging retrievers for information extraction
- Clone the repo:
git clone https://github.com/harsh-mahobia/psychic-couscous.git cd psychic-couscous - Install dependencies (see each example for specific requirements, usually
langchain,transformers, etc.) - Run any script or notebook directly; no strict config is required for most examples.
LangChain lets you build sophisticated AI agents by connecting models, prompts, and output parsers.
See LangChain/python.py for a basic example using HuggingFace's Inference API to count letters in a string.
Learn to build chains combining prompts, models, and parsers.
Check out LangChain/Chains/simple_chain.py for a chain that generates facts about animals.
Explore output parsing with JSON and string formats in LangChain/OutputParser/json.py.
Try different chatbot architectures:
LangChain/transformers/main.py: BlenderBot-powered CLI chatbot.LangChain/Messages/cli_chatbot2.py: Stateful chatbot with role-based messaging.LangChain/Messages/cli_chatbot3.py: Error-handling and improved history.
Learn to use Python TypedDict for structured model outputs:
Understand how retrievers work for fetching data from various sources:
LangChain/RAG/retrievers/note.txt: Notes and examples of retriever types.
Explore graph-based agent workflows:
- BMI Calculator (Sequential):
- Notebook example: Step-by-step graph workflow using an LLM for BMI calculation.
- No LLM BMI workflow: Pure Python workflow.
- Cricket Match Stats Calculator (Parallel):
- Notebook example: Calculates strike rate, boundary percent, and more using parallel graph nodes.
-
Text Splitters:
LangChain/RAG/text_splitters/code-based.py
Learn how to split code into chunks for processing. -
Runnable Lambda Example:
LangChain/Runnables/usecase/lambda.py
A simple example of a lambda runnable for word counting.
- Learn more about LangChain
- Explore LangGraph
- HuggingFace Transformers
This repository is a tutorial resource—feel free to fork, experiment, and submit issues or suggestions for improvement!
MIT License
Happy Learning! Dive into the code, experiment, and build your own agents 🚀