r/LangChain • u/Lazy_Eggplant8795 • 23h ago
Discussion I built a banking agent reference architecture where the LLM has no write path to money — not "guarded," just no tool
r/LangChain • u/Lazy_Eggplant8795 • 23h ago
r/LangChain • u/protrener • 13h ago
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.
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.
r/LangChain • u/sarmabkp_1 • 4h ago
r/LangChain • u/Last_Operation2527 • 14h ago
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:
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 • u/throwawayforthegroom • 17h ago
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 • u/External_Ad_11 • 17h ago
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 • u/rexShail • 5h ago

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:
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.