r/LangChain • • 7h ago

Projects ChatOpenAI(model="gpt-5-mini") stops working Friday. Made a checker that finds these in a repo

Thumbnail
gallery
3 Upvotes

OpenAI shuts down gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-pro, o3 and o3-pro on Friday 11 Dec (https://developers.openai.com/api/docs/deprecations). Calls with those IDs fail after that.

In agent code the ID is rarely in one place. It's the default in a ChatOpenAI(...) call, an env fallback like os.getenv("LLM_MODEL", "gpt-5-mini"), a cheaper model for a sub-agent, a YAML config. We searched public GitHub today: 249 repos matched, and reading them by hand, 46 org-owned repos really send a retired ID, mostly through defaults like those.

So we built a checker (I'm one of the two people who made it, at a hackathon today). Point it at a public repo and it lists every file and line, with OpenAI's replacement. There's also a GitHub Action that fails CI on them, and a fix script that swaps the IDs and writes the PR description: https://github.com/koopatroopa787/deadline-check

The same scan covers Anthropic, Gemini, Bedrock and Azure model retirements too, plus Node/Python and npm package end-of-life. All 900+ dates are searchable on the site, each linked to the vendor page it came from.

Limits: it matches model IDs written as strings, so a name assembled at runtime won't be caught. If you know other places these hide in LangChain or LangGraph projects, I'd like to add them.


r/LangChain • • 2h ago

Projects OpenAI retires six model families on December 11. What to check in a LangGraph repo

1 Upvotes

OpenAI retires six model families on December 11: gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-pro, o3 and o3-pro. If a graph pins any of those, the first thing that breaks is usually a node you forgot had its own model.

Places the model version hides in a LangGraph setup:

  • the default in ChatOpenAI(...) or init_chat_model(...)
  • env fallbacks, including the second argument nobody reads
  • per node overrides in a config dict or a state field
  • a cheaper model for the router, grader or judge node
  • eval datasets and golden outputs recorded against one model
  • prompt templates that name the model in the system message

The expensive failure is the quiet one. Some providers reroute a retired alias to a newer model, so requests keep succeeding and the output shape stays similar. You find out from a diff in quality, often from a user.

Price and token limit changes arrive the same way, and the dates are scattered across the OpenAI deprecations page, Anthropic docs, and Google split between AI Studio and Vertex.

Disclosure: I maintain a free public calendar of these changes, no login and no paywall, and I am putting the link in a comment instead of making this a link post. Not selling anything.

What else in your setup carries a model version? I keep finding new places.


r/LangChain • • 8h ago

Question | Help A weird guardrail failure mode we hit in production: our prompt-leak detector kept blocking completely valid answers

Thumbnail reddit.com
2 Upvotes

r/LangChain • • 5h ago

Resources How do you prevent AI agents from getting stuck in infinite tool-calling loops?

Thumbnail
medium.com
1 Upvotes

Ever had an AI agent call the same tool 10 times, each time with a slightly different query, without getting any closer to the answer?

That's the agent loop problem.

I experimented with cyclic graphs using:

  • Parallel tool execution
  • Independent verification gates
  • 80% completeness threshold
  • Targeted refinement
  • Hard iteration limits and tool circuit breakers

The goal: agents that can self-correct without running forever.

Here's the architecture and implementation:

https://medium.com/@anishvv212002/stop-agent-loops-how-to-build-cyclic-graphs-that-dont-get-stuck-51e4bbffb5bf

A few things I'd like to discuss:

  1. Do you use hard iteration limits or let the LLM decide when to stop?
  2. Do you use a separate evaluator or rely on the reasoning model's self-evaluation?
  3. How do you handle agents that keep retrying tools when the results are incomplete?

PS: Used AI to paraphrase the post.

Do like the post if you like it and follow me on GitHub. Thank you!!


r/LangChain • • 20h ago

Discussion Should AI agents get their own identity and permissions like a regular user?

8 Upvotes

Most agents run with the full access of the app or service account they sit on, which is usually far more than they need. If one gets manipulated, it can do anything that account can do.

Is anyone giving agents their own scoped identities and audit trails? Or is that too much overhead for now?


r/LangChain • • 21h ago

Discussion When you route easy requests to a smaller model, how do you actually measure the quality you lose?

3 Upvotes

AWS announced smart routing in Amazon Bedrock on Dec 1 (gated preview). The idea is the familiar one: inside a model family, send hard requests to the large frontier model and simple ones to a cheaper model. Their headline is comparable quality at up to 50% lower cost versus always using the largest model in the family, based on early results. They haven't said which tasks or what quality metric that "comparable" is based on.

That gap is the part I keep coming back to, because most of us end up building some version of this ourselves in LangChain or LangGraph, usually with a classifier or a cheap model deciding the route. The cost side is easy to measure. The quality side is not, especially for agents where a weak answer at step 2 quietly breaks step 5.

Questions for people running routing in production:

  • What's your quality signal? Human-graded samples, an LLM judge, task success at the end of the chain, or user corrections?
  • Do you evaluate the router itself (how often it sent a hard request to the small model), or only end-to-end outcomes?
  • Do you route per request, or per step inside an agent loop? Per-step routing sounds cheaper but seems harder to debug.
  • What share of traffic actually ended up on the small model once you were happy with quality? Curious whether 50% savings is realistic or optimistic.
  • Anything you route that you later pulled back to always-large because the failures were too expensive?

Interested in concrete setups more than vendor numbers.


r/LangChain • • 16h ago

Tutorial Notes on LangChain and LangGraph with a diagram per concept and runnable code (tools, RAG, agents)

0 Upvotes

I wrote a set of notes on LangChain and LangGraph where every concept gets a diagram first and code second.

What is in it:

- Runnables, pipe, RunnableParallel and RunnablePassthrough, explained with pictures

- Tool calling: u/tool, bind_tools and the full loop with ToolMessage

- RAG: document loaders, text splitters, embeddings, Chroma, and a RAG chatbot with history

- LangGraph: state and reducers, conditional edges, fan-out and fan-in, loops, memory, human in the loop, conditional RAG

All code is in one repo, one folder per topic, each with requirements.txt and .env.example. It runs on free API keys.

Notes: https://genai-notes.vercel.app

Code: https://github.com/dhruv608/genai-notes

If something is wrong or outdated, please tell me and I will fix it.

More lessons are coming (GraphRAG, advanced agents and more). ⭐ Star the repo to keep it for revision and to get the updates.


r/LangChain • • 1d ago

Discussion Visualizing how stale RAG memory leaks EUR 14,200 silently (and how a 0.15 ms zero-dep Python gate catches it before send)

1 Upvotes

After seeing several production RAG agents fail silently around month 3, the root cause was rarely the vector store itself. It was memory blending: an expired/resolved incident row gets retrieved alongside an open ticket for the same client, and the LLM smoothly merges both into a confident wrong reply.

We visualized the exact failure mode and the deterministic Python gate we put in front of delivery:

  1. Scoped metadata: Every retrieved row carries source_id, entity scope, and valid_until / status=resolved.
  2. Inline source citations: The LLM only proposes a draft citing exact row IDs (e.g. [ref#402]).
  3. Deterministic post-check (~0.15 ms p50): A zero-dependency Python verifier validates citation existence, scope match, expiration window, and numeric polarity before delivery. If any check fails, auto-send halts with HALLUCINATION_BLOCKED -> ABSTAIN and routes the exact stale row ID to human review.

The model proposes. The code decides.

Curious how others here handle temporal/scope contradictions in long-running RAG systems: strict metadata pre-filtering only, LLM-as-a-judge, or deterministic post-checks in code?


r/LangChain • • 1d ago

Question | Help LangSmith vs Langfuse for AI agent observability , what makes you choose one over the other?

Post image
3 Upvotes

r/LangChain • • 1d ago

Question | Help How do you manage user-specific configurations in LangGraph agents?

4 Upvotes

I'm exploring architectures where the same LangGraph agent serves multiple users with different tools, data sources and configurations.

For those who've implemented something similar, how do you structure the application without maintaining separate copies of the agent?

What limitations have you encountered as the system grew?


r/LangChain • • 1d ago

Projects How we designed a dual-service LangGraph workflow where the LLM never sees raw table values

9 Upvotes

We’re building Litmus during a 36-hour hackathon to solve a recurring headache with AI data assistants: most tools either send raw, sensitive CSV/Excel rows directly to an LLM, or skip temporal leakage checks when automating forecasting.

Instead of giving the agent direct access to the data, we split the system into two isolated services:

  • Private Data Service: Handles ingestion, Bronze → Silver → Gold transformations (DuckDB, Polars, Pandera), and time-series forecasting (LightGBM, StatsForecast) locally with no unrestricted internet access.
  • Agent Service (LangGraph): Owns planning, human-in-the-loop checkpoints, and an outbound policy gate. The LLM only ever receives aliases, schema metadata, and approved summaries—never raw values.

Key safeguards in our design:

  • Controlled Disclosure (Privacy Shield): Payload auditing and canary testing across the workflow so sensitive values stay inside the private data plane.
  • Leakage-Aware Modeling: Enforces temporal splits and dynamic feature controls during Gold dataset construction, not as an afterthought.
  • Evidence-Grounded Reports: Every insight links back to the exact local computation that generated it (or gets explicitly flagged as a hypothesis).
  • Human Checkpoints: Users can inspect, roll back, or stop after any stage (Prepare, Analyze, or Model) via a Streamlit review UI.

Happy to drop the GitHub repo and full threat model docs in the comments if anyone wants to review the architecture!


r/LangChain • • 2d ago

Discussion LangGraph is my state machine. The part that made it safe wasn't the graph.

12 Upvotes

I'm building a reference architecture for agent-assisted banking on LangGraph — and I'll be upfront: the graph is doing exactly what it's for. Deterministic control flow around non-deterministic LLM calls. That part works.

The case I care about is the hard one: an LLM in front of a system where a wrong output moves money. Not "could be a risk" — a wrong output is the failure. A hallucinated amount, an invented account, a transfer that "succeeded" when it didn't.

The reframe that mattered: LangGraph gives you the spine, but the spine isn't what makes the money case safe. The graph routes steps; it doesn't, by itself, stop the model from being the thing that decides a write. What makes it safe is the set of boundaries around the graph.

The ones that actually hold:

  • The model's tool surface is read-only. No transfer() node it can invoke — not a guarded one, none. The write is a separate path taken by a human in the app — an interrupt, not a tool call.
  • Money ops are declared agent_callable: false in a versioned contract the model never sees — enforced in code and CI, not a sentence it reads and forgets. The graph routes around these; it can't call them.
  • Values are rendered from the system of record, never generated. If the read fails, the state is "unavailable," not "let me guess."
  • Abstention is a typed terminal state — READY / NEEDS_MORE / ABSTAIN — not a confidence score I invent. I've left the threshold blank on purpose until it's calibrated; I'd rather ship "I don't know" than a fake 0.85.

Notice these are all state, transitions, and gates — exactly the kind of determinism LangGraph is built for. So this isn't "instead of LangGraph." It's LangGraph in the hardest domain, with the boundaries made explicit.

Where I'd genuinely like to hear from this sub — you've all fought these:

  • How do you model "the model can't call this" in a graph? A node it's refused, a filtered-out tool, a precondition gate? I keep landing on a versioned contract checked in CI — what's cleaner?
  • Human-in-the-loop on the irreversible actions only: interrupt() inline vs. a separate confirmation path outside the graph? Approval fatigue is real once a human's on every step.
  • The audit question: is a checkpointer (PostgresSaver) enough to "show an auditor exactly what the agent was allowed to do, and when" — or do you layer something on top? I suspect checkpoint history is the trail; want to know if that holds in practice.

r/LangChain • • 1d ago

Tutorial We built relay-anywhere to control a remote desktop from your phone’s browser

Thumbnail
github.com
1 Upvotes

r/LangChain • • 2d ago

Discussion Multimodal agent memory is harder than image search once facts change across turns

2 Upvotes

Most multimodal retrieval pipelines stop at matching a prompt against an image caption. Trouble starts ten turns later when an earlier screenshot conflicts with a newer instruction.

Multimodal Memory debuted as a new track in the Agent Memory Leaderboard (AML) Cycle 2 release, published on November 19. During evaluation, the platform delivers original images alongside captions while keeping downstream answering and grading fixed. Six columns span three areas:

  • cognition: Retrieval plus Relational Reasoning across visual and text clues
  • evolution: Temporal Reasoning plus Continual Learning as context shifts
  • alignment: Personalization plus Evidence Governance

Four entries appear on the Cycle 2 Multimodal Commercial Products table. MemoraX ranks first at 53.68 overall, posting 66.73 on Retrieval, 53.87 on Relational Reasoning, and 48.40 on Continual Learning. memorysum-vl, listed under Shopee, ranks second at 42.35 overall, posting 50.14 on Retrieval, 44.06 on Relational Reasoning, and 36.30 on Continual Learning.

Organization names only reflect submitting group background, and Multimodal scores are not comparable with Textual numbers.

Finding an old screenshot is step one; tracking how visual context updates across sessions is what defines multimodal memory.

In multimodal agent pipelines, what breaks first: cross-turn visual reasoning, stale image state, or evidence governance?


r/LangChain • • 2d ago

Question | Help what LLM observability platforms you use?

8 Upvotes

hi everyone

wanted to know what observability platform you are using for your AI agent.

I built an open source tool that checks the agent writes against the real systems (did the DB row charge or calendar event actually happen?) and posts the result as a score to Langfuse.

Im looking to add more integrations with observability systems, and wanted to know what most people actually use. Langfuse, LangSmith, Braintrust, Arize Phoenix, Datadog, plain OpenTelemetry or something else?

would love to hear what you are running and why :)


r/LangChain • • 2d ago

Discussion Engineers or teams running agents in production, what is ur most recent real agent failure?

16 Upvotes

Im trying to understand how engineering teams actually investigate failures in production AI agents, some of those incidents are behavioral not like an error in the execution. The workflow gets executed successfuly but the output is completly wrong

I think many engineering teams are using tracers like langsmith/langfuse but I think they are not enough for some failures like this, investigating with those will take up so much time and they lack of many informations (I think)

If you use an observability tool that helps you with those behavioral failures can you name it down please


r/LangChain • • 2d ago

Discussion multi agent setups not ahead in 74% of matched comparisons.. so what is coordination buying?

3 Upvotes

saw an audit of 516 multi agent configurations across 9 studies, once the single agent gets the same samples or compute the multi agent system is not ahead in 74% of the comparisons, and a plain baseline matches or beats it in 36% and 53 of the 123 setups that beat a single greedy pass went nonpositive once the baseline was sampled properly.

My take is this isn't an argument against running more than one agent. It's an argument that the coordination has to earn it's cost, if the second agent is just another voice on the same task then you paid for an ensemble and called it a team, what that kind of audit can't really measure is the case where the agents aren't interchangeable at all. different repos, different owners, different tools, one of them able to reach something the other can't. that's most of my setup and none of the benchmark configs look like it.

to be fair the authors call it descriptive for the corpus they assembled, not a general claim about coordination, next thing i want to try is band ai for the handoffs between agents that aren't interchangeable. one setup won't prove much either way.

Curious where a second agent has actually paid for itself in other people's setups.


r/LangChain • • 3d ago

Question | Help Which LLM do you use for each node in your LangGraph agents, and why?

Post image
2 Upvotes

Do you keep one model for every node? Or do you mix models and keep the strong one only for the reasoning? I'm asking because I'm doing user discovery with indie developers. I'd like to understand what you expect from models for your use cases, and what holds you back when you pick one.

Drop your setup in the comments.

Example:
Use case: support agent
GPT-6 Luna for simple tasks like subscription questions
Claude Opus 5.5 for technical issues and where the agent has to investigate or make a judgment call


r/LangChain • • 3d ago

Question | Help LangChain vs LangGraph for a support agent: when is create_agent no longer enough?

Thumbnail reddit.com
2 Upvotes

r/LangChain • • 3d ago

Projects What I learned building a GraphRAG that reads documents as rendered pages (open source, benchmarks vs RAG-Anything, LightRAG, GraphRAG)

Thumbnail
reddit.com
1 Upvotes

r/LangChain • • 3d ago

Discussion How would you want a zero-code mode to verify tool calls straight from existing Langfuse traces?

3 Upvotes

hey everyone

I built an open-source verification layer of agents.
it reads the external systems your agent writes to and checks that the records exist and match what was expected

I opened an issue for a zero-code mode after talking with several developers and realising that it would help them see the value before changing one line of code.

I want your help here with some ideas of what you would want this to look like, how I should approach this, and what would make you see value in it.

Today you need to add a decorator to every tool, yes its a small change but it's still a change.

The idea so far is a mode where Verilays reads tool calls from existing Langfuse traces instead of from a decorator, and runs the same checks

I would love to hear suggestions :)


r/LangChain • • 3d ago

Tutorial Built an open-source e-commerce RAG widget that syncs Google Shopping XML into SQLite and blocks invented promo codes with Clef-Flash (13s demo)

2 Upvotes

r/LangChain • • 3d ago

Question | Help Suggestions for better Lang graph workflow

2 Upvotes

Hi everyone! I am working on building my product and I need suggestions to users on how can i first of all make the existing workflow better and optimal and then how can i scale it for future requirements. Below is my agent's interpretation of what I have right now and what I need. Thank you in advance.

Today the agent runs in a chat bar inside the app. Each message makes one pass through a graph and gets one reply, so there is at most one action per message.
Before the run: the agent loads the recent chat history, any unfinished email draft or meeting booking, and the user's time zone.
Flow

  • Domain Router: word matching runs first. If nothing matches, a small model labels the message email, calendar or general.
  • Email / Calendar Planner: a model with that lane's tools picks one action. It can also ask a follow-up question or hand the message back to the router.
  • Executor: no AI here. It runs the action on the mail or calendar provider and keeps half-finished drafts or bookings for the next turn.
  • Result Interpreter: fixed text for common results, otherwise a model writes the reply. A safety net stops it claiming a failure when the action actually worked.
  • General Decider: sends the message to one of four places:

    • Responder: chat, writing or code. It has tools for tasks, web search and the knowledge base.
    • Knowledge Retriever: questions about our own documents.
    • Time-Based Recall: "what did we discuss yesterday?"
    • Past-Session Recall: "what did we say in the Budget chat?"
Router → Email/Calendar Planner → Executor → Interpreter → End
                                ↘ Responder → End
                                ↘ back to Router
Router → General Decider → Responder / Retriever / Recall → End

Design constraint: speed for voice. The voice bot uses the same engine for its answers, so every model call adds delay the user can hear. That's why routing uses word matching wherever it can and only calls a model when matching can't decide. Common results get fixed text for the same reason.
Limits today: one change per message, and recall only covers the current chat.
Where it's heading

  • Screen-aware: the chat answers from whatever screen the user is on, such as "summarise this" or "what's overdue here?"
  • Task-aware: it helps with the task the user is doing right now, such as filling a form, drafting next to an open item, or suggesting the next step.
  • More skills: new lanes and tools plug into the same router, so the chat bar becomes the main way to get things done in the app.
  • Multiple chat sessions (later): several parallel conversations, each with its own context, that the user can switch between.

r/LangChain • • 3d ago

Question | Help what systems your agents writes to often?

1 Upvotes

I am builidng an open-source tool for the verification layer of AI agents.
The tool knows to search in the systems that the agent writes to (like postgres or google calendar) and say whether the agent claim is correct or not based on the record that exists there and what it expected to be.

right now I am looking to add new integrations to more systems and I would love to hear what systems the agent you build writes to often.

I thought about adding mongoDB, Stripe and Calendly

but I will happily change my mind if you say otherwise and I will see that theres more demand to other systems


r/LangChain • • 4d ago

Discussion Why running an AI agent test once is mathematically meaningless

2 Upvotes

If you test traditional software once and the assertion passes, it passes. If you test an AI agent once and it passes, you have learned almost nothing.

On a 1/1 green test run, the 95% Wilson confidence lower bound is just 20.7%. A workflow that fails 30% of the time in production still passes on the first try 7 times out of 10.

And in multi-step agents, a single "green" output often hides real production bugs:

  1. Two orders, one intent: A write tool times out on the client after the server already processed it. The agent sees no error, retries, and silently creates a duplicate order.
  2. 200 OK with an empty [] payload: A lookup tool swallows an upstream error and returns []. The agent treats "no error" as "done" and writes a confident answer built on nothing.
  3. Activity without progress: An agent loops through tool calls for hours without changing the actual goal state—every step counter says it's working while burning tokens.
  4. Silent reasoning exhaustion: A reasoning model burns its entire token budget thinking and returns empty text (finish_reason: "length"), looking like a provider outage.

When teams ship agents with tool calls, a single-run final-text check misses all four:

  • Blocker gates (write idempotency + read-back, explicit ok | empty | error | unknown tool statuses, Zod schemas) need 100% deterministic passes on every PR.
  • Capability gates need multi-run sampling (N ≥ 3 to 5) gated on the 95% Wilson lower bound, not a lucky 1/1 pass.

How is your team currently deciding whether an agent change is "good enough" to deploy?

Are you asserting on the tool trajectory and running multi-sample evals in CI, or still relying on local vibe checks?

Thanks in advance for any hints and best practices. Much appreciated.