Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Project structure · AI and ML

Python AI agent with LangGraph project structure

Opens with credits

For Python developers moving from "call a model in a loop" to an agent that can pause, resume and be debugged. It starts from the official LangGraph template (langgraph.json, a src/agent package, unit and integration tests) and grows into a customer support agent with typed state, one file per node and tool, human approval before refunds, evals that score whole trajectories, tracing, auth and a deployable server image.

Curated by Tauseef FayyazIntermediate136 files and foldersPython 3.12, LangGraph 1.2, LangChain 1.4 (langchain-core 1.6)Checked October 2026
Explore the filesPick any file to see what it is, why it exists and when you add it.

How it grows

Each stage opens the explorer there

  1. 1Day 1What the scaffold and your first hour give you30 files and folders
  2. 2GrowingWhat a real app with features and tests adds+42 files and folders
  3. ProductionWhat running it for real users adds+30 files and foldersOpens with credits
  4. ExpertWhat a team needs to keep it healthy for years+34 files and foldersOpens with credits

How it is organised

  • graph.py only wires the graph. Nodes, tools, prompts, routing and state each live in their own module and are tested on their own.
  • State is small and typed. Messages append through a reducer; other fields are replaced. Large data stays in tools or a store, not in checkpoints.
  • Run settings (model name, limits, store name) go in the Context schema, not in code or state, so assistants can differ without a deploy.
  • Tools are the agent's hands: small outputs, clear docstrings, ownership checks on every id the model passes in, and write actions split from read actions.
  • Anything that moves money or cannot be undone pauses with interrupt() for a person. Side effects happen after the interrupt, never before.
  • Unit tests never call a model: fake chat models and fake APIs cover nodes, routing and tools. Integration tests and evals call real models and run on purpose.
  • Evals score trajectories (intent, tools called, approvals) as well as final answers, and every production failure becomes a new eval case.
  • Every run is traced. When an answer is wrong, the trace shows which node, prompt or tool caused it.
  • Let the LangGraph server handle persistence, threads and streaming in production; your code supplies the graph, auth and custom routes.

At the top of the project

Open one in the explorer for the full story

Learn more on Sefism

Roadmaps, cheat sheets and projects that go with Python AI agent with LangGraph.

See 12 more
Checked against 10 official sources, October 2026. If something has changed, the docs win.Show sources

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com