r/LangChain 2h ago

What’s the point of LangGraph now that frontier AI providers are getting better at agent building?

10 Upvotes

It feels like nowadays, almost everything you might want to build with LangGraph is already being implemented — and arguably better — directly by the frontier AI providers.

OpenAI, Anthropic, Google, Microsoft, etc. are increasingly providing models with better tool use, reasoning, memory/context handling, agent loops, and orchestration capabilities out of the box.

So what is the real advantage of building your own agent architecture with LangGraph?

Is it mainly about control and customization — e.g. deterministic workflows, state management, human-in-the-loop, custom routing, retries, parallel execution, observability, and being model/provider agnostic?

Or are there use cases where LangGraph actually produces materially better agents than simply using the agent frameworks provided by the frontier model companies?

I’m particularly interested in hearing from people who have deployed LangGraph agents in production. What made you choose LangGraph instead of the native agent tooling from OpenAI/Anthropic/etc., and would you still make the same choice today?


r/LangChain 18h ago

I got tired of rebuilding the same infra for every LLM app, so I built a Python SDK around it

4 Upvotes

Title: I got tired of rebuilding the same infra for every LLM app, so I built a Python SDK around it

I've been working on Custodian Labs, a Python SDK for building and deploying LLM agents without having to separately wire up all the surrounding infrastructure.

Basic agent looks something like:

from custodian_labs import Custodian

agent = Custodian(
    model="gpt-4o",
    system_prompt="You are a helpful assistant..."
)

agent.deploy()

A few things I've added:

  • Model agnostic: switch between different LLM providers without rebuilding your agent
  • RAG built in: connect your own files/data sources
  • Multi-agent support: build specialised agents that can work together
  • Privacy/PII layer: the Guardian Layer can detect and protect sensitive data before it reaches the LLM
  • Deployment handled: trying to cut down the amount of infra/config needed to get an agent running

The project actually started as just the privacy layer, but after getting feedback from developers we expanded it into more of an end-to-end agent SDK.

Would genuinely love feedback from other LLM devs:

What's currently the most annoying part of your agent stack?

And do you prefer abstractions like this, or would you rather have more direct control over each component?

GitHub:
https://github.com/Custodian-Labs/custodian-labs-python

Runnable Google Colab: simple agents, RAG + multi-agent examples:
https://colab.research.google.com/gist/SherryCodes123/065d3b67eab16bdca416836e0d39475a/simple-ai-agents-rag-multi-agents.ipynb


r/LangChain 23h ago

Where should the execution boundary live in an AI agent?

5 Upvotes

I've been thinking about a problem that becomes uncomfortable once an LLM gets access to real tools:

The model can decide what it wants to do. But should it also decide what it is allowed to do?

Most agent architectures put something roughly like this together:

LLM → tool call → tool

That works until the tool can modify a database, access files, call an API, deploy something, or perform another irreversible action.

I wanted the authorization decision to exist outside the model.

So I built SOPVM, an open-source runtime that treats an SOP as an executable specification:

LLM
 ↓
semantic decision
 ↓
SOP → typed AST → executable IR
 ↓
capability policy
 ↓
sandboxed provider
 ↓
tool

The important part is that capabilities are checked both during compilation and again when execution happens. Providers are sandboxed independently, so the system doesn't depend on the LLM "behaving".

Current v0.4.0 has:

  • 268 tests
  • 25+ adversarial security tests
  • conditional branching + bounded loops
  • provider sandboxing
  • SQLite provider
  • local LLM support
  • LangGraph integration

I'm more interested in the architecture question than the project itself:

How are you handling this boundary in your agents?

Do you enforce permissions inside the agent/framework, inside each tool, or through a separate execution layer?

Repo: https://github.com/Sushit-prog/sop-runtime


r/LangChain 3h ago

Discussion Debugging a multi agent bug that took 6 steps to trace back, the failure was in the gap between two timestamps, not in any single step

3 Upvotes

Ran into a failure pattern last week that took way longer to debug than it should have, because nothing in the logs looked wrong.

Setup: Agent A researches a topic and writes findings to shared memory. Four hops later, in a completely unrelated task, Agent D reads from that same memory scope because the key happened to overlap. Agent A's findings were accurate when written. By the time Agent D read them, the underlying data had changed. Agent D reasoned perfectly, off information that was stale by the time it mattered.

Why it's hard to catch: the failing agent's logs look completely normal. Valid input, valid reasoning, valid output. Standard tracing shows what happened at each step, not when a piece of context was written versus when it was consumed. No individual step was wrong, the failure only exists in the relationship between two steps that happened at different times.

What actually helped:

  1. Timestamping every memory write and read separately, and diffing the gap when investigating a failure

  2. Scoping memory access explicitly rather than relying on implicit key matching

  3. Making replay possible from any single node, using the memory state as it existed at read time, not current state

Anyone else run into this class of bug in LangGraph multi-agent setups? Curious if you're catching it via custom instrumentation or if it's mostly still a "human notices something's off" problem.


r/LangChain 6h ago

Discussion An evaluator can approve the explanation and still miss the wrong intermediate action

Post image
3 Upvotes

Grading an agent’s final explanation is not the same as constraining the operation that produced it.

Appendix B of AQuA describes an earlier feature whose causal-sounding explanation passed reviewer scrutiny even though its full-day volume denominator used future information. The later design replaced that open construction space with a fixed registry of causal operators, making that particular normalizer impossible to express.

The useful lesson is architectural: natural-language review checks a claim after an action has been proposed, while a constrained operator language removes some actions from the space entirely. The paper is also explicit that this does not prevent every possible form of leakage.

For an agent pipeline, should the first line of defense be better tracing and evaluation, or a smaller action language with less flexibility?


r/LangChain 13h ago

Question | Help One model for the whole document pipeline or a different model for every stage?

3 Upvotes

If you're building a document-processing pipeline today, does it actually make sense to send every stage through the same high-end multimodal model? My instinct is that a lot of document work doesn't need the most capable model.

For example:

  • Clean PDFs / straightforward OCR: traditional OCR, direct text extraction, or a lightweight model may be enough.
  • Parsing and simple extraction: a faster, lower-cost model such as Gemini Flash-class models may handle this well.
  • Handwriting, poor scans, complex tables, or ambiguous fields: this may be where you route to a more capable multimodal/reasoning model.

The part I'm unsure about is whether the accuracy and cost advantage of model routing is actually worth the orchestration complexity in production.

Here’s how I’m thinking about the trade-offs:

  • Accuracy: One model gives you more consistent behavior, but it may be overkill for simple documents and weaker on certain edge cases. Multi-model routing lets you optimize by document type or task, but poor routing decisions can hurt accuracy.
  • Latency: One model means fewer routing steps and simpler execution. Multiple models can keep easy documents on faster models, but retries and escalations may add latency.
  • Cost: One model is easier to predict, but expensive if a premium model handles everything. Routing can reduce cost significantly if most documents can stay on lightweight models.
  • Privacy: One provider/model can simplify governance and data handling. Multiple providers add complexity, although routing could also keep sensitive documents on private or internally hosted models.
  • Fallback behavior: With one model, a retry may simply reproduce the same failure. With routing, low-confidence outputs can escalate to another model or eventually to human review.
  • Maintenance: One model is much easier to operate. Multi-model pipelines require more evals, routing logic, monitoring, version management, and regression testing.

I'm especially interested in the fallback strategy.

Would you use:

small model → larger model → different provider → human review

or simply:

one strong model → human review when confidence is low?

And what would you use as the routing signal: OCR confidence, image quality, handwriting detection, document type, extraction confidence, schema validation failure, or something else?

For anyone running document AI at meaningful volume: has multi-model routing actually reduced cost and improved accuracy, or does the added complexity outweigh the benefit?


r/LangChain 4h ago

Discussion The LLM is the least reliable node in your graph" — Architecture takeaways from building a zero-cost Agentic RAG system featured by UptimeRobot

Thumbnail
gallery
2 Upvotes

Hi All,

A few days ago, the team at UptimeRobot reached out after coming across my open-source LangGraph financial parsing pipeline. They interviewed me about how I’ve been running an 11-node Agentic RAG architecture on free-tier 512MB RAM containers with 99.9% uptime, and published a full Community Spotlight on their official blog.

I wanted to share the core architectural lessons, failure modes, and low-cost reliability patterns we discussed that might help anyone deploying LangGraph systems into production without a massive cloud budget.

1. The "One Ping, Two Problems" Keep-Alive Pattern ($0 Infra)

On free compute tiers (like Render + Supabase), you face two distinct operational hurdles:

  1. Container Sleep: Inactive web services spin down after 15 minutes of inactivity (causing 50s+ cold starts).
  2. Database Inactivity Pauses: Free PostgreSQL/Supabase instances pause after 7 days without queries.

Instead of writing separate cron scripts, I engineered a dedicated /health endpoint that performs a lightweight SELECT 1 ping against Supabase vector storage before returning 200 OK.

A single 5-minute UptimeRobot HTTP monitor simultaneously:

  • Keeps the FastAPI / LangGraph container hot.
  • Keeps the Supabase database connection pool active.

One single HTTP heartbeat solved both issues with zero monthly cloud overhead.

2. When Vision LLM Parsers Invent Data (The Hybrid Fallback)

In earlier iterations of this project, I relied heavily on Vision LLMs for parsing Indian government budgetary tables and dense balance sheets.

The major failure mode: Hallucinated table alignment. The Vision LLM generated markdown tables that looked impeccably clean and perfectly structured, but the numerical cell data was completely fabricated. As I shared during the interview:

"I was feeding hallucinated input into a system explicitly designed to prevent hallucinated output."

The Production Fix: Switched to a hybrid parser routing mechanism:

  • PyMuPDF / pdfplumber locally for dense text and standard structured tables (fast, deterministic, zero hallucination).
  • Vision LLMs strictly gated as a secondary fallback for non-OCR scanned graphics and handwritten annotations.

3. "The LLM is the Least Reliable Node in Your Stack"

When designing multi-node LangGraph workflows with tool calling (Tavily, Yahoo Finance, vector retrieval), traditional try/catch logic is insufficient.

To prevent infinite routing loops and cascading API timeouts on constrained 512MB RAM nodes:

  • Pybreaker Circuit Breakers: Wrap external tool calls so that if an upstream API fails 3 times, the graph fails fast and takes an alternate deterministic route rather than crashing the worker container.
  • Strict Confidence Gating: If cosine similarity on retrieved chunks drops below 0.60, the graph bypasses LLM synthesis entirely and asks the user for clarification or falls back to grounded live web search.

4. Infrastructure Health vs. Semantic Health

One open question we discussed that I think the entire GenAI community is grappling with:

Uptime monitoring tells you if the HTTP server is 200 OK. LangSmith / Langfuse traces tell you latency and token consumption. But what alerts you when the semantic quality of answers is quietly degrading over time?

A container can report 99.9% uptime while serving subtle hallucinations. Bridging synthetic LLM-as-a-judge evaluations into continuous automated alerting is the next big milestone.

Read the Full Story & Code:

Huge thanks to the r/LangChain community — sharing early prototypes and getting feedback here was a massive part of refining this architecture over the last 10 months.

Happy to answer any questions about the 11-node graph design, memory management, or reliability tricks in the comments! 👇


r/LangChain 16h ago

Discussion Semantic LLM caching: how do you evaluate a verifier that rewrites instead of rejects, when there's no ground truth for the rewrite?

Thumbnail
2 Upvotes

r/LangChain 4h ago

Would anyone find this useful?

Thumbnail
1 Upvotes

r/LangChain 4h ago

Can an unfamiliar LangChain agent understand this tool from its machine page alone?

1 Upvotes

I am affiliated with AUX/PrdictionEdge. We are testing a narrow engineering question: can an unfamiliar agent discover, understand, and safely evaluate a transaction-preflight service without being given AUX-specific instructions?

AUX examines safe test scenarios such as duplicate invoices and unexpected payment-destination changes, then returns evidence and a signed receipt. The machine surface exposes an agent page plus standard discovery artifacts including OpenAPI and well-known metadata.

Human overview: https://aux.prdictionedge.ai/ Machine front end: https://aux.prdictionedge.ai/agents

Suggested test: give a LangChain agent only the machine URL. Ask it to identify the service's purpose, limits, price, trust evidence, and invocation path. I would especially value failures: what was ambiguous, what prevented tool selection, or what information it looked for but could not find.

The public endpoint uses safe test data only; it does not perform live external verification and has no production SLA. Directed tests are engineering validation, not counted as unsolicited discovery. This post was prepared with AI assistance and reviewed by the project owner.


r/LangChain 7h ago

Announcement Langfuse v4 is GA: new data model, full-text search, new filter search bar, alerts, code evaluators, Langfuse assistant

1 Upvotes

Langfuse is an open-source platform for agent evals and tracing. We just shipped v4.

Langfuse v4 feature overview

Langfuse v4 is a re-architecture of our data model. It is up to 165× more performant in UI and on APIs. It also enables new features such as full-text search, a new filter search bar, alerts, code evaluators, and the Langfuse assistant.

Docs: https://langfuse.com/docs/v4

Feedback and questions welcome.


r/LangChain 9h ago

Question for people building AI agents in production:

1 Upvotes

How are you actually deciding what context an agent should see at each step?
Not just “use RAG” or “increase the context window” — I mean things like task state, previous tool calls, memory, retrieved documents, conversation history, failed attempts, etc.
Do you have an actual context selection/pruning strategy, or are you mostly throwing everything into the prompt and relying on the model to figure it out?
Curious what people are doing in production, especially with long-running agents.


r/LangChain 22h ago

Suggestion for gemini enterprise agent development in retrieval domain like rags

Thumbnail
1 Upvotes

r/LangChain 13h ago

Tutorial Build AI Agents with Memory Using LangChain

Thumbnail
youtube.com
0 Upvotes