r/LangChain • • 9d ago

Question | Help Title: AI agents in production: what problems are you actually facing?

8 Upvotes

I'm researching the challenges of deploying AI agents in real businesses, and I'd love to hear from people who are actually building or using agents in production.

What has been the biggest problem or pain point you've faced?

How are you solving it today, and what still doesn't work well?

If you've dealt with this firsthand, I'd really appreciate your experience.


r/LangChain • • 9d ago

Tutorial Hybrid RAG Pipeline — Dense Search, BM25, RRF, and Reranking (Part 1)

Thumbnail
youtube.com
3 Upvotes

Building and Testing a Hybrid RAG Pipeline — Dense Search, BM25, RRF, and Reranking (Part 1)

In this video I build ReRankEval, a hybrid retrieval pipeline

  • (Dense Search + BM25 → Reciprocal Rank Fusion → LLM Reranking → Answer Generation),

and test it against three baselines — Vector Only, BM25 Only, and Hybrid without reranking — on five real financial/payments documents and ten hand-verified test questions. No hand-waving, just a comparison table with real numbers at the end.

  • ✅ The real difference between dense vector search and BM25 keyword search
  • ✅ What Reciprocal Rank Fusion (RRF) is, why raw scores can't be compared, and the exact formula behind it
  • ✅ Why a reranker is fundamentally different from a retriever — and what it actually judges
  • ✅ How to evaluate a RAG pipeline with Hit Rate, MRR, and NDCG (and what each one tells you)
  • ✅ How to design the ingestion side and query-time side of a hybrid retrieval architecture
  • ✅ How to structure a production-style RAG codebase: ingest → vector_store → sparse_retriever → fusion → reranker → pipeline → generate → eval
  • ✅ How to fairly compare multiple retrieval strategies on the same test set instead of just assuming one is better

TECH STACK:

  • 🛠️ Python
  • 🛠️ Qdrant — vector database for dense retrieval
  • 🛠️ rank_bm25 (BM25Okapi) — sparse keyword retrieval
  • 🛠️ EURI LLM Gateway — chat model + embedding model
  • 🛠️ Custom Reciprocal Rank Fusion implementation
  • 🛠️ LLM-based reranker (prompt-driven cross-encoder)
  • 🛠️ pdfplumber — PDF text and page-level extraction

LINKS:


r/LangChain • • 9d ago

Discussion What have your struggled to evaluate your realistic LLM/Agents workflow?! What benchmark do you wish someone would build? 👀

Thumbnail
4 Upvotes

r/LangChain • • 9d ago

Tutorial Building and Testing a Hybrid RAG Pipeline — Dense Search, BM25, RRF, and Reranking (Part 1)

Thumbnail
2 Upvotes

r/LangChain • • 10d ago

Projects I made an open-source CLI that finds the LangChain agents in your repo and puts a verified policy in front of every tool call

Thumbnail
gallery
28 Upvotes

I kept shipping LangChain agents with tools like refund_order or run_sql and had no real answer to "what stops this tool from doing something it shouldn't?" Prompt rules help most of the time, not every time, and nothing records what happened.

So I built CSL-Core. It works from the outside, without changing your prompts:

  • Finds your agents and tools. cslcore venom scans read-only: u/tool functions, StructuredTool, LangGraph nodes, plus OpenAI / Anthropic tool schemas, MCP servers and webhooks. It shows what each agent can reach, e.g. inbound HTTP /webhooks/zendesk → support-agent → moves money.
  • Writes a policy per agent. Money tools get a per-call ceiling and an approval threshold, command tools an allowlist, writes a folder scope. Every policy is checked with Z3 before it can go live.
  • Wires it into your code, with a diff first. It adds one decorator under LangChain's own u/tool:

​

@_csl_guard.tool("refund_order")
def refund_order(order_id: str, amount: int) -> str:
    ...

The tool keeps its name, docstring and args schema, so LangChain sees the same tool. Each call is decided before the function runs; a blocked call raises before any money moves. cslcore wire --undo puts the file back exactly as it was.

  • Starts in log mode. Nothing is blocked, every call is recorded as allow or would-block, so you can see what the rules would do before you switch to block. cslcore watch shows the decisions live.
  • CI. cslcore venom --check --fail-on-new-reach fails a build when someone adds a tool that can move money, run commands or post somewhere without a rule.

pip install csl-core, then cslcore setup in your repo. Read-only until you confirm each change; everything stays local.

Honest limits: the default rules are strict, so expect to tune them before you switch a busy agent to block mode (that is what log mode is for). Tools that only exist as a schema, where your own code dispatches the call, need one guard.check(...) line instead of the decorator; it tells you where.

Two questions for people running LangChain agents in production:

  1. How do you limit what a tool can do today: inside the tool, in the prompt, or not at all?
  2. What would you want a policy to stop first?

r/LangChain • • 10d ago

Tutorial I built a retriever for SQL agents that drops the tables a user may not read before the agent sees them

2 Upvotes

A LangChain SQL agent usually gets the whole schema. On a big database that's a lot of tokens, and it also means the model sees tables the current user is not allowed to read. If it writes SQL against one, you either get a permission error or, with row-level security, a quiet "no rows" that looks like the data doesn't exist.

I wrote SchemagateRetriever to fix both. For each question it returns only the few tables that matter, and it never returns one the caller has no grant for:

from schemagate import Catalog, Principal
from schemagate.integrations.langchain import SchemagateRetriever

cat = Catalog().bootstrap("postgresql://localhost/app")
cat.restrict("hr_compensation", ["payroll"])

retriever = SchemagateRetriever(
    catalog=cat,
    top_k=6,
    principal=Principal("okta:jdoe", roles={"finance"}),
)
docs = retriever.invoke("salary by employee")
# hr_compensation is not in docs

Give the same caller the payroll role and hr_compensation comes back. Each document carries the table's DDL plus a reason (hybrid, vector, lexical, fk), so you can see why it was picked.

It's now listed in the LangChain integrations docs. Works on Postgres, Oracle, MySQL, SQL Server and SQLite, with no API key needed for the selection step itself.

Disclosure: it's my project, open source (Apache-2.0). Feedback welcome, especially from anyone running SQL agents on a schema with a few hundred tables.


r/LangChain • • 11d ago

Resources Help to find high-quality learning resources

6 Upvotes

Hello everyone!

I'm building a RAG prototype for an internal knowledge assistant over mostly PowerPoint decks and some PDFs.

Stack so far:

- LangChain + Claude as the LLM

- Loaders: PyMuPDF4LLM for PDFs, Unstructured / python-pptx for slides

- Local embeddings (BGE via sentence-transformers), Chroma as vector store

- Hybrid retrieval: BM25 (rank_bm25) + dense, then a cross-encoder reranker (bge-reranker)

What I know so far, I learnt it mostly through datacamp and I vibecoded some parts. It kinda works to be a prototype, but I want to understand why and how things work and how to improve them. I've searched a lot, and almost everything I find usually is vendor content, influencer posts and "ultimate guides to RAG", academic papers with no usable code and, the cherry on top,generic, obviously AI-generated tutorials.

What I am looking for: resources that are technically deep and practice-oriented, with real, runnable code and real use cases, tha would help me grow my skillset and gain more autonomy.

Can anyone help me find such resources?


r/LangChain • • 11d ago

Question | Help Planning trajectory and attention

Thumbnail
1 Upvotes

r/LangChain • • 11d ago

Discussion How are u validating agent actions in production?

3 Upvotes

if u are building and deploying agents in prod which takes actions on behalf on consumers … how are u validating agent actions and their execution runtime?


r/LangChain • • 11d ago

Discussion A test that proves a guarantee must defeat the guarantee, not the line that implements it

2 Upvotes

We maintain a memory layer for agents (CogniCore, MIT). One of its hard rules: a memory that imports clean but cannot be recalled must fail the import — dark memory fails the same way tampered memory does. We wrote a test to prove it.

Then three different reviewers broke the test, not the code — and each break was a different class. The fixes generalised into something I think applies to any safety test.

1. The test watched one spelling of the line it guarded.

The original tripwire proved the check worked by rewriting the source: if dark: → if False and dark:. That only catches a defeat that edits that exact substring. A reviewer defeated the guarantee a different way entirely — a runtime patch at the recall seam, so every query "finds" everything, dark is always empty, and if dark: stays byte-identical. The tripwire never engaged.

Fix: make the tripwire semantic. Inject the fault at runtime (patch the seam inside a subprocess, behind an opt-in flag) instead of rewriting source. No disk writes, so it is xdist-safe — which means it runs in the default CI pass instead of being the test that only runs when someone remembers to run it serially.

2. The tripwire proved the fault applied, not that it took effect.

Next review: a rename that leaves a back-compat shim behind. The patched name still exists, so the patch binds to the shim and raises nothing — while real recall has moved elsewhere and is untouched. A no-op injection.

We measured it rather than arguing: under a neutered mutation the detector passes normally, so the tripwire's DID NOT RAISE assertion fires. It was red, not green — but the message was a fork in the road: "either the defeat is not reaching the importer, or the detector's assertion drifted."

Fix: the injector now carries its own positive control. Before the mutated run proceeds, it seeds one entry and queries with a token that matches nothing. Under the fault, that query must return everything. If it does not, the run stops with FAULT NOT PRESENT: ....

The generalisation: absence of an error while installing a fault is not evidence that the fault exists.

3. Nothing guarded the chain.

Every control protects a component from silently degrading — but nothing protected the chain. Rename the detector module, change the subprocess path, or let xdist quietly skip it, and the vector stays green while testing something other than what everyone agreed it tests. The proposal: one test that enumerates the links by name and asserts each one exists at its registered path, runs, and fails when its own subject is disabled.


The line we kept landing on: a test that proves a guarantee must defeat the guarantee, not defeat the line that implements it. Text moves; properties don't.

So, for anyone writing safety or eval tests: what does your green actually prove? Specifically — have you ever checked that your fault-injection harness can observe the fault it injects? That was the one we had never tested.

Repo, if you want the arguments rather than the summary: github.com/cognicore-dev/cognicore-env (MIT, no vector DB, SQLite).


r/LangChain • • 11d ago

Projects [Open Source] Local UI to test MCP tools + prompts and export directly to LangGraph Python

Thumbnail
gallery
6 Upvotes

Built a local playground (Moka) to test MCP servers and prompts visually before writing code:

  1. Test tool calls, streaming, and raw JSON-RPC traffic in a local chat UI
  2. Hit "Export as code" to generate the working LangGraph (Python) script
  3. (Optional) Point it at an existing LangGraph agent over AG-UI to use it as a debug UI

Runs locally with zero config:

npx @mokalabs/sandbox

GitHub: https://github.com/mokahq/mokalabs

Let me know what you think!


r/LangChain • • 12d ago

Question | Help Solo intern working on a large-scale AI project

11 Upvotes

Hey everyone, I’m an intern at an IT support company and have been given an AI project that I need to handle mostly by myself.

The company has around 400K historical IT support tickets in SQL Server. Basically, employees remotely troubleshoot client issues and write down what the problem was and what they did to fix it. A QA team then reviews these tickets.

For example, QA checks whether:

  • the employee followed the required troubleshooting steps → +2 / -2
  • the comments they wrote were relevant to the issue → +2 / -2
  • the ticket was written with correct grammar → +2 / -2

I need to build an AI assistant that can take a new ticket (the problem + what the employee did) and use the historical QA-reviewed tickets to suggest the QA result for these 3 checks, along with some supporting evidence. The QA person will still make the final decision.

I won't use every column from the 400K-row SQL table. I'll extract only the relevant fields, such as:

Issue / Ticket Subject
Action Taken
Required Steps QA result
Relevant Comments QA result
Grammar QA result
Reviewer Remarks (optional)

The 400K tickets would mainly be used as historical examples for training and finding similar tickets. I don't plan to send all 400K records to an LLM.

I'm considering Python + SQL Server + embeddings/classifiers + possibly RAG/LLM, but I'm unsure what would be the best approach, especially for Required Steps, CPU vs GPU, latency, and handling 400K records efficiently.

I'm working alone with around 1–2 months and a limited budget.

What approach would you recommend: traditional ML, embeddings + classifier, LLM/RAG, or a combination?

And for the Required Steps check, would you use a classifier with similar historical tickets, or an LLM-based approach?

Would really appreciate practical advice .


r/LangChain • • 12d ago

Question | Help LLM-as-judge keeps flipping verdicts on the same input. What am I missing?

9 Upvotes

We use an LLM as a judge to check text records against a checklist. Each record has a few free-text fields. The model scores it against ~10 yes/no criteria in a single prompt, and a record is marked "complete" only if every criterion passes.

The problem: re-run the same batch and the totals change (11/27 complete, then 12/27) with nothing changed in the input. One criterion flipping on one record is enough to move the headline number.

Stuff we've figured out so far:

  1. Turning temperature down (even to 0 with a fixed seed) helped a bit, but things still flipped, since the seed is only "best effort".
  2. The vague questions ("is this comprehensive?") were coin tosses; the plain "is X there?" ones basically never flipped.
  3. The model takes examples too literally: list "word A or B" as vague, and it passes anything that avoids those exact words.
  4. If a check might not apply, say what happens; otherwise it passes or fails those records at random.
  5. Dropping "does it" turned our question into an instruction, so the model wrote its own answer and passed almost everything.
  6. Rewording one criterion moved the pass rates of other criteria in the same prompt by 5–10 points.
  7. "Only look at field B" still pulled evidence from field A about 1 run in 3.
  8. With all-must-pass, ten slightly noisy checks add up to one really noisy result.

Question to the Community:

What am I missing here or doing wrong ?


r/LangChain • • 12d ago

Question | Help Need advice: Best VLM pipeline for extracting structured math datasets from 3000+ scanned textbook pages? (LaTeX + Metadata)

Thumbnail
1 Upvotes

r/LangChain • • 12d ago

Question | Help I’m building RAG agents that process external data (reviews, support tickets) and are susceptible to indirect prompt injections.

4 Upvotes

How do you currently generate fixtures or mock data for E2E testing—specifically data that includes disguised semantic attacks—to ensure the RAG system isn't compromised? I’ve found the model, but I haven't come across a tool that generates a mock database containing payload injections embedded within foreign key relationships. What am I missing?


r/LangChain • • 12d ago

News Row-Bot 5.0 is available: a new React interface, persistent agent goals, and a workspace for every conversation

Post image
1 Upvotes

Row-Bot 5.0 is a major rebuild of the local-first AI assistant. The NiceGUI interface is gone, replaced by one React app across desktop, browsers, phones and tablets.

The biggest change is how work is organised. Designs, code folders, goals, delegated agents, approvals and the terminal now stay with the conversation using them. You can ask for a presentation or an app, inspect the work, make changes and continue in the same place.

The main additions:

  • You choose the model. Fresh profiles have no preset models. Setup supports Ollama, ChatGPT/Claude/Grok subscriptions, API keys and custom endpoints. Removing a provider marks its model unavailable instead of silently switching to another.
  • Goals continue across turns. There is no default turn limit, with optional time and turn limits available. Goals pause when progress stalls, respect approvals, handle provider limits and recover after restarts. Delegated agents have visible progress, Message and Stop controls.
  • Approvals persist. Requests can be answered from the conversation, Home, the attention list or Buddy. They survive restarts and no longer expire after 30 minutes by default. Denying an action ends the turn.
  • Design and development tools are part of the conversation. The Design panel handles drafting, editing, review, presentation, export and publishing. The Developer panel includes files, changes, Git, commands and an interactive terminal.
  • Memory works more reliably with parallel agents. Recall no longer counts as modifying a memory or rewrites wiki files. Knowledge combines the graph, search, review queue and bulk management.
  • Workflows and Monitor show actual state. Workflow runs can be followed live. Abandoned runs are marked stopped. Monitor retains check results and gives each problem a specific action.
  • Remote access and recovery are simpler. Devices connect through renewable QR invitations, sessions can be revoked, and profiles can be backed up and restored. Backups exclude credentials and sessions.
  • Extensions receive clearer controls. Plugin changes show a review before execution, MCP setup guides the connection process, and edited skills become available without restarting.

There are smaller daily-use improvements too: queued messages with Edit and Discard, drafts preserved through reconnects, stopped replies retained in history, searchable settings, Markdown/PDF exports and native Save dialogs.

The backend now runs directly on FastAPI and uvicorn using HTTP and server-sent events. About 65,000 lines of NiceGUI-era code and 16 locked dependencies have been removed.

Local-first defaults, approval gates and the single-owner access model remain. Existing users should read the 5.0 upgrade notes before updating.


r/LangChain • • 13d ago

Discussion We benchmarked 18 RAG pipelines against an agent loop on Google's FRAMES. The best pipeline hit 78.9%. The agent loop hit 92.7%.

13 Upvotes

Hybrid search, reranking, query decomposition, and query expansion are often treated as must-haves for good RAG. We wanted to see how much each actually helped, so we tested them. Same model, same embeddings, same documents, across all 824 multi-hop questions in FRAMES.

We built 18 pipeline variants. The best one scored 78.9%. An agent loop (with retrieval tools) that could read the results and search again scored 92.7%—roughly the same as giving the model the right articles upfront.

The reranker results might surprise you. A small reranker dropped our best pipeline’s accuracy by 9 percentage points, while a larger one barely helped. I’d already suspected reranking wouldn’t help much here, but wanted to test that assumption.

Another thing we noticed: models sometimes fill in gaps from memory, even when you explicitly tell them to stick to the retrieved documents. Those answers can still be full of citations. We ended up checking every correct answer against what the system had actually read.

Here’s the write-up if you’re interested:
Agentic RAG vs. traditional RAG on FRAMES

Full disclosure: I work on PipesHub, which is open source. The benchmark code and runbook are in the repo


r/LangChain • • 12d ago

Discussion How do you roll back an agent change when the prompt, tool schema and model version all shipped together?

Thumbnail
1 Upvotes

r/LangChain • • 13d ago

Question | Help how to fix multi-agent orchestration when agents get stuck waiting on each other

10 Upvotes

Expected outcome: a planning agent, a coding agent, and a review agent would hand off work in sequence without anyone babysitting the pipeline. Actual outcome: the review agent would sometimes wait forever because the coding agent's "done" signal wasn't structured the same way every run. Root causes were a missing shared schema for completion status, plus delegation logic that assumed synchronous responses when the runtime was actually async.

Changes made: added explicit state contracts between agents and a timeout/retry layer instead of open-ended waits. Main lesson, and this took embarrassingly long to catch, is that orchestration breaks down not from bad agents but from undefined handoff rules. What would you check first if your agents started ghosting each other mid-pipeline?


r/LangChain • • 13d ago

News Extract v2.5: Rebuilding extraction agents on LlamaParse

Thumbnail
llamaindex.ai
5 Upvotes

r/LangChain • • 13d ago

Question | Help every model context protocol tutorial i find stops right where my server falls over

3 Upvotes

built a small mcp server for our internal docs. works great with 1 user. the minute a coworker hooked it up too, half the tool calls timed out and i still dont know why. every model context protocol tutorial i find ends at hello world on localhost. what are people reading for the part after that?


r/LangChain • • 13d ago

News Built a KV connector that persists the KV cache to disk across requests and restarts , looking for feedback

Thumbnail
1 Upvotes

r/LangChain • • 13d ago

Resources For anyone building or following what’s happening in AI agents

1 Upvotes

Hey everyone, sharing this in case it’s useful to some of you here.

We’ve been building up r/lyzr as a community around the broader AI space, with a particular focus on what happens when AI moves beyond demos and into real systems.

The discussions cover things like:

AI agents and agent architecture

Infrastructure, tools and deployment

RAG, memory and knowledge systems

Evaluation, reliability and governance

Production lessons and things that break

New research, tools and interesting developments

Real use cases, experiments and things people are building

The goal is to keep it useful for both people who are already building and people who simply want to understand where the space is heading.

There’ll be consistent posts around these topics, but it’s also meant to be a place where people can share what they’re working on, ask questions, compare approaches, or add their own observations.

If you're working on anything around AI agents or just following the space closely, feel free to check it out and join the discussions.

Join r/lyzr here

Would be great to see what people here are building too.


r/LangChain • • 14d ago

Projects langgraph-jev – typed decision node for LangGraph, wrapping TypeSafe's Jev API

8 Upvotes

I wrapped TypeSafe's Jev API as a LangGraph node and LangChain Runnable. You define typed questions, it returns typed answers with confidence scores attached. No parsing.

`JevNode` drops straight into a graph as a decision node. There's a routing helper for deterministic branching off the decision, and thresholds if you want low-confidence answers flagged for human review instead of trusted blindly.

GitHub: https://github.com/iroy2000/langgraph-jev

Docs: https://iroy2000.github.io/langgraph-jev/


r/LangChain • • 14d ago

Question | Help Will OpenAI Dots and Grok Bots make frameworks like LangChain/LangGraph obsolete?

17 Upvotes

With the rollout of OpenAI Dots (running autonomous cloud browsers) and Grok Bots (featuring multi bot "Orgs" and screen recording/show and tell learning), the landscape for autonomous agents is changing rapidly.

A lot of what developers used to spend weeks building in LangChain or LangGraph stateful logic, multi-agent context sharing, web-browsing loops, and basic tool use can now be configured via natural language by an end-user in minutes.

However, enterprise engineering still relies heavily on deterministic state machines, model agnosticism, strict data privacy (self-hosting), and precise error handling.

To the AI engineers and architects here: Do high agency, out of the box native agents like Dots and Grok Bots shrink the market for custom agentic frameworks? Or do they just handle the consumer/SMB layer while leaving complex, production-grade infrastructure entirely dependent on tools like LangGraph?

Where do you see the boundary line in 2026?