r/LangChain • • 16h ago

Discussion For teams running AI agents in production: what's still painful when debugging them?

10 Upvotes

I'm trying to understand how engineering teams actually investigate failures in production AI agents

I'm particularly interested in teams using tools like LangSmith, Langfuse, Braintrust, or custom observability setups

A few questions:

  1. When was the last time an agent behaved unexpectedly in production? What happened?
  2. How did you identify the root cause?
  3. Did your existing observability tools give you everything you needed, or did you have to investigate manually using application logs, database records, code changes, etc.?
  4. What part of the investigation took the most time?
  5. Is this a recurring problem, and has it caused meaningful engineering time or customer impact?

I'm interested in actual production experiences, not hypothetical feature requests

Also, if your existing tools already solve these problems well, I'd genuinely like to hear how


r/LangChain • • 18h ago

Question | Help how to add company research and people search to a LangChain agent without loading too many tools?

7 Upvotes

building a small b2b research chain in python this week and trying to keep the number of tools manageable. the agent needs to look up company information like employee count, recent funding and open job postings, then find employees by job title and seniority to identify the right marketing director or vp. after that, it looks up their business email and checks whether it's valid. giving the agent too many apiss and MCP tool seems to make tool selection harder, when several have similar parameters. trying Monid for some of these company data and contact lookups because the agent can search for the tool it needs instead of loading every integration upfront. curious how others are handling company data APIs, B2B people search and email verification in LangChain. do you use one tool interface or separate integrations for each data source?


r/LangChain • • 5h ago

Discussion Had to look up something in the docs and oh my god…

2 Upvotes

…it was genuinely not a experience??

I never thought there’d ever be a day I’d say that the LANGCHAIN docs were actually helpful, but they were so credit where credit is due.

The nav was still confusing, and the search seems still meh and linking a bunch of random pages, but their little chatbot thing understands my question and either answers me or points me exactly to the pages I want.

It wasn’t just a one time experience. I’ve probably used it like 15-20 times over the last few weeks and it’s truly been super helpful.

My only feedback is sometimes a page just reads like claude slop so just hire a human to rewrite a lot of those pages with that shiny series C :-)

Thanks Langchain team!

You’ve come a long way (but still have more to go)


r/LangChain • • 18h ago

Projects IR evals for your RAG retriever without any model calls

2 Upvotes

When a RAG answer is wrong, the cause is often retrieval: the right chunk never reached the model. An LLM judge that grades the final answer won't show you that, and you pay for a model call on every query.

Evret scores only the retriever. You give it queries and the doc IDs each query should return. It computes Hit Rate, Recall, MRR, nDCG, ERR, and RBP at k by comparing doc IDs, so it makes no model calls.

It works with Qdrant, Chroma, Weaviate, Milvus, Elasticsearch, LangChain, LlamaIndex, and Haystack.

🔗 GitHub: https://github.com/kaivid-labs/evret


r/LangChain • • 7h ago

Tutorial Your LLM is LYING to you. Here's how to fix it.

Thumbnail
youtube.com
1 Upvotes

I built a Hello World RAG App in Python

Normal LLM = Answers from training data (can hallucinate)

RAG LLM = Answers from YOUR documents

I asked it Saudi it didn't say Saudi Arabia.

It said "Contractor at Saudi Aramco" - because it read MY LinkedIn PDF.

This is how it works:

  1. Load PDF
  2. Split into Chunks
  3. Create Embeddings (Google Gemini)
  4. Store in ChromaDB
  5. Search Top 3 Chunks
  6. Send Context + Question to Groq LLM

Tech: Python + LangChain + ChromaDB + Groq + Gemini Embeddings

Save this for your next interview

Comment "RAG" and I'll send you the full code + next part.

Follow for AI Engineer series - Part 2 coming next.


r/LangChain • • 17h ago

Question | Help How do I make my existing RAG project into production?

Thumbnail
gallery
1 Upvotes

I have built a RAG on research papers,

Tech stack i have used :

Framework - Langchain

Ingestion - llamaparse and Pypdf as backup

Retrieval - Hybrid Search with dense semantic search (MongoDB Atlas Vector Search) with sparse keyword matching (BM25).

Then Reciprocal Rank Fusion(RRF) and Cohere Reranker on top of it.

Evals : offline evals currently, RAGAS (Faithfulness, Relevancy, Context Utilization) still figuring for online Evals (might move to LangFuse)

Models:

for embedding -

nvidia/nemotron-3.5-embed-1b

(Changing models based on their lifetime)

For Generation -

nvidia/nemotron-3.5-lightning-30b-a3b

llama-3.3-70b-versatile

Kept Groq model fallback on 500/400 ERRORS of Nvidia.

LOGGING : API server errors (majorly 503/429 etc) , timeouts, groq_fallbacks, bm25 fallbacks, last_error_time.

Also Built a test set of queries.

Along with if both generation model fails

Then will fallback to BM25 RESULTS.

I believe the results are good.

Also I feel gap to push this project into production.

Looking for good assistance.

Ps: will share repo later.


r/LangChain • • 22h ago

Discussion Google adk vs langgraph

Thumbnail reddit.com
1 Upvotes

r/LangChain • • 6h ago

Tutorial LangGraph vs CrewAI vs OpenAI Agents SDK: Which Framework to Pick

Thumbnail
acta.ai
0 Upvotes

r/LangChain • • 15h ago

Question | Help Most LLM apps silently break their own prompt cache. Here's what I found auditing 20 open-source ones (feedback wanted)

0 Upvotes

Disclosure: I'm the author of leanprompt, the free, Apache-2.0 tool I used for this. There's no paid version, no hosted service, no account.

Every LLM call resends the system prompt, the tool list and the history. Providers cache the part that didn't change, but only if it didn't change byte for byte, from the first token. I ran audits on open-source LLM apps (gpt-researcher, anything-llm, bilingual_book_maker, better-chatbot and others) and kept seeing the same few mistakes.

  1. Something volatile at the top of the prompt.
  2. A timestamp to the second on the first line of the system prompt means no call can ever reuse what follows it. In our example app that was an estimated 6.7M tokens per 1,000 calls the cache could have served.
  3. A history window that shifts every turn.
  4. Trimming the oldest message each turn changes the prefix, so every turn re-reads the whole conversation.
  5. No cache marks on Anthropic.
  6. Anthropic caches only where the client asks. On replayed coding-agent sessions, a client sending no marks got 0 tokens from cache over 29 turns. A client sending 3 marks got 92% of prompt tokens from cache on a single session.
  7. Caching that's off by default in a gateway.
  8. One app's default model ran through a gateway where caching has to be switched on explicitly.
  9. Cost meters that ignore cache fields.
  10. 3 of the first 4 apps metered their own spend from `input_tokens` and never read the cached-token fields, so their dashboards were wrong in either direction.
  11. Paying twice for output.
  12. Retrying a truncated answer from scratch, or sending a batch that the limit cuts off, re-buys tokens you already paid for. One of these fixes was merged upstream (bilingual_book_maker #590).

And one that went the other way. Moving the date to the end of the prompt, to protect the cache, cut correct date answers from 10/12 to 1/12 and didn't help the cache. So the rule isn't "move everything dynamic down"; meaning comes first, then cache.

Two smaller things: on a hybrid-thinking model, toggling thinking on and off between turns lost 47% of the reusable prefix. Tools built from an unsorted dict also change order between calls.

How it works: leanprompt is a set of skills for your coding agent (Claude Code, Codex, Cursor, OpenCode, anything that reads AGENTS.md). `/leanprompt audit` finds every LLM call in your app and ranks where it loses tokens. `fix` shows a diff and applies it on your yes. `measure` proves the change with a before-and-after number. The audit numbers are estimates from reading the code; `measure` is what turns them into measurements. Every figure in this post has a row in the evidence table with its source and limits.

npx leanprompt install

Repo: https://github.com/Podwarden/leanprompt

Audit logs - what we found in multi-star github projects: https://lmwarden.com/leanprompt/audits/

What I'm asking for: feedback. The rules are the part that matters, and they only get better from cases I haven't seen. The skills, rules and provider tables are CC BY 4.0, so whatever you teach them goes back to everyone who uses them, with credit if you want it. Most useful:

- a rule that's wrong or missing for your provider or engine (self-hosted vLLM or SGLang, Gemini, Bedrock, OpenRouter...)

- a finding that turned out to be a false positive on your code

- a cache or cost mistake you've hit that isn't on this list

- an audit that missed an LLM call, or ranked a small problem above a big one

Reply here, open an issue, or use the "lesson learned" form in the repo. It's fine in general terms, without sharing your code. Every report I can verify becomes a rule or a fix to one.