Skip to content

About

Hands-on LangGraph workflows exploring typed state, graph nodes and edges, temperature conversion, and local LLM question answering with Ollama.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

LangGraph Workflow Portfolio

A collection of hands-on Jupyter notebooks exploring how to model tasks as stateful workflows with LangGraph. The examples progress from deterministic Python transformations to local-LLM question answering, sequential generation, parallel computations, and structured essay evaluation.

This repository is a learning and portfolio project. It demonstrates workflow design and orchestration patterns; it is not a production application or a validated HR, weather, or academic assessment system.

What this project demonstrates

  • Defining workflow state with Python TypedDict
  • Building, compiling, invoking, and visualizing LangGraph workflows
  • Passing state between deterministic Python and LLM-backed nodes
  • Sequencing LLM calls and combining parallel branches
  • Using a state reducer to collect parallel evaluation scores
  • Requesting structured LLM output with Pydantic
  • Running language models locally through Ollama

Workflow portfolio

Notebook Workflow Concepts
1 - Temperature conversion Celsius input → Fahrenheit conversion → temperature label Typed state, Python nodes, sequential graph edges
2 - Simple LLM Q&A Question → locally generated answer LLM-backed node, state updates, Ollama
3 - Prompt chaining Topic → outline → blog draft Sequential LLM calls, intermediate state, prompt context
4 - Employee analytics Employee data → parallel calculations and project evaluation → summary Parallel graph branches, state merging, deterministic business rules
5 - Essay evaluation Essay → parallel rubric evaluations → consolidated feedback and average score Parallel LLM calls, Pydantic structured output, state reducers

1. Temperature conversion

Converts Celsius to Fahrenheit and assigns a label in a two-node graph:

flowchart LR
    Start([START]) --> Convert[convert_temp]
    Convert --> Label[label_weather]
    Label --> End([END])
Loading

The sample input is 23 °C, which converts to 73.4 °F. See known limitations for an issue in the current label conditions.

2. Simple LLM question answering

A single-node graph sends a question to a local Ollama model and returns the answer in workflow state. The notebook's example asks who created eFootball Mobile.

3. Prompt chaining

The first node creates an outline from a topic; the next uses both the topic and outline as context to draft a blog post. The example topic is “Rise of AI in Kenya.”

flowchart LR
    Start([START]) --> Outline[create_outline]
    Outline --> Blog[create_blog]
    Blog --> End([END])
Loading

4. Employee analytics

Three independent nodes calculate yearly salary, calculate a bonus, and assess project completion. Their results join at a summary node. The sample rules calculate yearly salary as monthly salary × 12, bonus as two months of salary, and label five or more completed projects “Excellent.”

flowchart LR
    Start([START]) --> Salary[calculate_yearly_salary]
    Start --> Bonus[calculate_bonus]
    Start --> Projects[project_evaluation]
    Salary --> Summary[summary]
    Bonus --> Summary
    Projects --> Summary
    Summary --> End([END])
Loading

5. Essay evaluation

Three parallel nodes assess language quality, depth of analysis, and clarity of thought. Each uses a Pydantic schema to return feedback and a score from 0 to 10. A reducer collects the scores; a final node produces overall feedback and calculates their arithmetic mean.

flowchart LR
    Start([START]) --> Language[evaluate_language]
    Start --> Analysis[evaluate_analysis]
    Start --> Clarity[evaluate_thought]
    Language --> Final[final_evaluation]
    Analysis --> Final
    Clarity --> Final
    Final --> End([END])
Loading

The Q&A, prompt-chaining, and essay-evaluation notebooks use the local qwen3.5:2b model through ChatOllama. Their results depend on the local model and its responses.

Tech stack

Getting started

Prerequisites

  • Python 3.11 (used for the current project environment)
  • Jupyter Notebook or JupyterLab
  • Ollama for the LLM-backed notebooks

Install

Create and activate a virtual environment, then install the project dependencies:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m pip install notebook

On macOS or Linux, activate the environment with source .venv/bin/activate instead.

Install and start Ollama, then download the model used by the LLM notebooks:

ollama pull qwen3.5:2b

Launch Jupyter and run a notebook's cells from top to bottom:

jupyter notebook

The temperature-conversion and employee-analytics notebooks do not require Ollama. The Q&A, prompt-chaining, and essay-evaluation notebooks require the Ollama service and model to be available locally.

Current limitations

  • The temperature notebook checks fahrenheit >= 50 before a later 50 <= fahrenheit < 77 condition, making that later branch unreachable. As a result, the sample 73.4 °F is labeled Cold. This is a learning example, not a validated weather classification.
  • Employee bonus and project-status rules are illustrative heuristics, not compensation or performance recommendations. The input includes working days, which the current calculations do not use.
  • LLM-generated answers and evaluations are not independently validated and should not be treated as authoritative assessments.
  • The repository currently consists of interactive notebooks; it does not include an application interface or an automated test suite.

Repository contents

.
├── 1_Temperature_Conversion_workflow.ipynb
├── 2_Simple_QA_LLM_Workflow.ipynb
├── 3_Prompt_Chaining_Workflow.ipynb
├── 4_Employee_analytics_Workflow.ipynb
├── 5_Essay_workflow.ipynb
├── README.md
└── requirements.txt

About

Hands-on LangGraph workflows exploring typed state, graph nodes and edges, temperature conversion, and local LLM question answering with Ollama.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages