Why We Rebuilt LangChain’s Chatbot and What We Learned
LangChain replaced chat.langchain.com's chunk-and-embed vector retrieval with tool-calling agents that search structured sources directly: full doc pages via Mintlify's API, a scan-titles-then-read pattern over the Pylon knowledge base, and ripgrep/tree/file-read tools over the codebase. A fast createAgent with Claude Haiku 4.5 handles most docs questions in 3-6 tool calls and under 15 seconds. A Deep Agent with separate docs, knowledge-base and code subagents handles implementation questions in 1-3 minutes, with each subagent filtering its results so the orchestrator's context stays small. The rebuild removed constant reindexing, kept document structure intact and produced verifiable citations down to line numbers, with LangSmith traces used to tune prompts and cut wasted tool calls.
Related posts
- Context Engineering (Agent Memory) for AI Agents Starts with Retrieval
LangChain mediumAdeptAgent retrieval fails in three ways: inefficient searching, too much context at once, and irrelevant or stale context. The fix is to keep searches small and keep raw results out of the main agent's context window. Deep Agents does this with glob/grep before reads, paged read_file (100 lines by default with offset/limit), and automatic offloading of tool results over ~20k tokens to files with a preview. For custom RAG tools, the recommended pattern is "retrieve, offload, delegate": write results to files, return only paths, and have parallel subagents read each file and return key facts with sources and dates. Other advice covers using grep with synonyms before semantic search, agentic rather than single-shot retrieval, skills for progressive disclosure, and treating retrieved text as untrusted.
- How to build evidence-grounded agent memory with OpenWiki and Graphs
LangChain mediumAdeptA compiled, source-linked wiki (OpenWiki) used as agent memory raised accuracy on cross-document questions from 0.10 to 0.52 versus keyword search alone on a synthetic 111-document insurance corpus scored against a 972-fact ledger, and cut cost per correct answer from about $0.55 to $0.19. Citation consistency stayed low, so the team added a lightweight evidence graph that materializes wiki citations and document references as typed edges (cites, supersedes, refers_to) between paragraphs, claims and pages, navigated by locate and expand tools. The graph built in under a second with no model calls and, over the wiki alone, improved accuracy 27%, doubled citation consistency, cut median latency 40% and cost per correct answer 58%. For simple single-passage lookups, search alone was equally accurate and faster, so compiled memory pays off only with repeated cross-source reasoning.
- Open-source LLMs as LangChain Agents
Hugging Face mediumAdeptOpen-source LLMs can now serve as reasoning engines for tool-using ReAct agents, with Mixtral-8x7B outperforming GPT-3.5 out of the box on a mixed benchmark drawn from HotpotQA, GSM8K and GAIA, graded by GPT-4-as-a-judge. The ReAct loop works by prompting for a Thought plus a JSON tool call or a Final Answer, then parsing the output, running the tool and appending the Observation to the prompt. Agents are built in LangChain with the new ChatHuggingFace wrapper. Llama2-70b and Zephyr-7b perform poorly. About 10% of Mixtral's GAIA failures come from malformed tool arguments, so fine-tuning for function calling is the recommended next step. Giving models a calculator lifts zero-shot GSM8K scores, though only 20 questions were tested.
- Building Deep Research: How we Achieved State of the Art
Hugging Face mediumAdeptTavily's deep research agent reached state of the art on DeepResearch Bench while using 66% fewer tokens than LangChain's Open Deep Research, mainly through context engineering. Each tool output is distilled into a short reflection, and only past reflections are passed to the tool-calling model. Raw sources come back only for the final write-up. This turns token growth from quadratic (n·m(m+1)/2) into linear (n·m) across m iterations. Other lessons: keep orchestration simple so future model gains carry through, deduplicate sources through global state, expose a small toolset, design for failure modes, and treat LLM-as-judge evals as directional feedback rather than the optimization target.
- How we built LangChain’s GTM Agent
LangChain mediumAdeptLangChain's GTM agent, built on Deep Agents, triggers on new Salesforce leads, runs do-not-send checks, researches the prospect across Salesforce, Gong, LinkedIn and Exa, and posts a relationship-aware email draft with reasoning to Slack for rep approval. A weekly account-intelligence job uses per-account subagents with constrained tools and structured output schemas, run in parallel. Rep edits are diffed by an LLM into per-rep style memories stored in PostgreSQL, and evals combine rule-based assertions with an LLM judge in CI. The team reports a 250% lift in lead-to-opportunity conversion and about 40 hours saved per rep each month.