Workflow
LangChain
icon
Search documents
Introducing Open SWE: An Open-Source Asynchronous Coding Agent
LangChain· 2025-08-06 16:55
What's up everyone. It's Brace from Langchain and in this video I am extremely excited to announce our newest project openu. Open suite is an async cloud-based open source coding agent.What that means is you connect your GitHub account to open send it a task and it does the rest. It plans, executes the plan, writes code, runs tests, runs your different scripts, and then reviews the code before putting up a poll request to make sure it's all high quality code. And when it's done and it determines that everyt ...
Tracing Claude Code to LangSmith
LangChain· 2025-08-06 14:32
Setup and Configuration - Setting up tracing from Claude Code to Langsmith requires creating a Langsmith account and generating an API key [1] - Enabling telemetry for Claude Code involves setting the `CLOUD_CODE_ENABLE_TELEMETRY` environment variable to 1 [3] - Configuring the OTLP (OpenTelemetry Protocol) exporter with HTTP transport and JSON encoding is necessary for Langsmith ingestion [4] - The Langsmith Cloud endpoint needs to be specified for logs from Claude Code, or a self-hosted instance URL if applicable [5] - Setting the API key in the headers allows authentication and connection to Langsmith, along with specifying a tracing project [5] - Enabling logging of user prompts and inputs is done by setting the appropriate environment variable to true [6] Monitoring and Observability - Langsmith collects and displays events from Claude Code, providing detailed logs of Claude Code sessions [3] - Traces in Langsmith show individual actions performed by Claude Code, including model names, token usage, and latency [8] - Claude Code sends cost information associated with each request to Langsmith [8] - Langsmith's waterfall view groups runs based on timestamps, showing the sequence of user prompts and Claude Code actions [13] - Langsmith provides pre-built dashboards for monitoring general usage, including the total number of traces, token usage, and costs over time [14]
n8n Tracing to LangSmith
LangChain· 2025-08-05 14:30
AI Workflow Automation & Observability - N8N is an AI workflow builder that allows users to string together nodes into AI agents and set up external triggers for automated execution [1] - Langsmith is an AI observability and evaluation product designed to monitor the performance of AI applications [2] Integration & Setup - Connecting N8N to Langsmith requires generating a Langsmith API key and setting it in the N8N deployment environment [3][8] - Additional environment variables can be set to enable tracing to Langsmith, specify the trace destination, and define the project name [4] Monitoring & Debugging - Langsmith traces provide visibility into the workflow, including requests to OpenAI, model usage, latency, and token consumption [6] - Langsmith offers a monitoring view to track app usage, latency spikes, error rates, and LLM usage/spending [7]
What are Deep Agents?
LangChain· 2025-07-31 18:29
Deep Agent Characteristics - Deep agents utilize a planning tool to manage long-term tasks, enabling cohesive action over extended periods [3][5][9] - Sub-agents are employed to focus on specific areas, preserving context and allowing for specialized expertise, which can improve overall results [3][10][11][12][13][15] - A file system is used to offload context, preventing performance degradation of the LLM by storing and accessing information as needed [3][16][17][18] - Detailed system prompts, often hundreds or thousands of lines long, are crucial for guiding the agent's behavior and tool usage [3][21][22][23] Deep Agent Implementation - Deep agents operate using the same tool-calling loop as simpler agents, but are distinguished by their prompts and tools [3][4][5] - Planning tools can be simple, such as a "to-do write" tool that generates and modifies task lists within the model's context [7][8] - Sub-agents can have specialized expertise and different permissions, allowing for focused work and better results [13][14] - File systems allow agents to manage context by referencing files instead of directly including large observations in the LLM context [17][18] Deep Agent Benefits - Deep agents are capable of handling longer time horizon and more complex tasks compared to naive LLM implementations [4][5] - Sub-agents facilitate context preservation, preventing the main agent's context from being polluted by sub-tasks and vice versa [11][12] - Reusable sub-agents can be created and used across different agents, promoting efficiency and modularity [14]
Open Deep Research
LangChain· 2025-07-16 16:01
Agent Architecture & Functionality - The Langchain deep research agent is highly configurable and open source, allowing for customization to specific use cases [1] - The agent operates in three main phases: scoping the problem, research, and report writing [3] - The research phase utilizes a supervisor to delegate tasks to sub-agents for in-depth research on specific subtopics [4] - Sub-agents use a tool calling loop, which can be configured with default or custom tools (like MCP servers) for searching flights, hotels, etc [17][18] - A compression step is used by sub-agents to synthesize research findings into comprehensive mini-reports before returning to the supervisor, mitigating context window overload [21][23] - The supervisor analyzes findings from sub-agents to either complete research or continue with follow-up questions [25] - Final report generation is done in a single shot using all condensed research findings [5][27] Implementation & Configuration - The agent is built on Langraph and can be run locally by cloning the Open Deep Research repository [29] - Configuration involves setting API keys for models (default OpenAI) and search tools (default Tavily) [30] - Langraph Studio can be used for iterating and testing the agent with different configurations [32] - The agent is highly configurable, allowing users to choose between default or model provider native search tools, connect to MCP servers, and select models for different steps [33][34] Application & Output - The agent can be used for complex research tasks, such as planning a trip, by iteratively calling tools and searching the web [2] - The agent provides a final report with an overview, flight options, transportation options, accommodation options with booking links, a sample itinerary, and a list of sources [36] - Open Agent Platform provides a UI to configure and try out the research agent without cloning the code [37]
Context Engineering for Agents
LangChain· 2025-07-02 15:54
Context Engineering Overview - Context engineering is defined as the art and science of filling the context window with the right information at each step of an agent's trajectory [2][4] - The industry categorizes context engineering strategies into writing context, selecting context, compressing context, and isolating context [2][12] - Context engineering is critical for building agents because they typically handle longer contexts [10] Context Writing and Selection - Writing context involves saving information outside the context window, such as using scratch pads for note-taking or memory for retaining information across sessions [13][16][17] - Selecting context means pulling relevant context into the context window, including instructions, facts, and tools [12][19][20] - Retrieval-augmented generation (RAG) is used to augment the knowledge base of LLMs, with code agents being a large-scale application [27] Context Compression and Isolation - Compressing context involves retaining only the most relevant tokens, often through summarization or trimming [12][30] - Isolating context involves splitting up context to help an agent perform a task, with multi-agent systems being a primary example [12][35] - Sandboxing can isolate token-heavy objects from the LLM context window [39] Langraph Support for Context Engineering - Langraph, a low-level orchestration framework, supports context engineering through features like state objects for scratchpads and built-in long-term memory [44][45][48] - Langraph facilitates context selection from state or long-term memory and offers utilities for summarizing and trimming message history [50][53] - Langraph supports context isolation through multi-agent implementations and integration with sandboxes [55][56]
LangGraph Assistants: Building Configurable AI Agents
LangChain· 2025-07-02 14:45
Core Problem & Solution - Traditional agent development suffers from slow iteration cycles due to code modifications for each use case, hindering business teams' experimentation [1] - LangGraph Assistants solve this by separating agent architecture from configuration, enabling code reuse across different use cases and faster experimentation [2] Key Features & Benefits - **Customization:** Allows customization of prompts, models, and tools without altering the underlying code, enabling rapid experimentation [3] - **Deployment:** Facilitates quick deployment of agent variations, allowing developers to push configuration changes without code deployments and business teams to launch assistants rapidly [4] - **Control:** Offers programmatic control for developers to automate assistant lifecycles, manage configurations at scale, and integrate with CI/CD pipelines [5] - **Configuration:** Configuration allows specifying customizable details such as prompts, models, and tools, enabling the same graph to have different capabilities based on runtime configuration [7] - **Versioning:** Provides robust version control and rollbacks, allowing for A/B testing and safe experimentation with configuration changes [44][45][46] LangGraph Studio - LangGraph Studio is a visual agent IDE that allows users to visualize and test agents [14][15] - It enables instant experimentation with different agent configurations, whether debugging locally or pulling production deployments [22] - It simplifies the configuration of complex multi-agent systems by allowing individual nodes to be configured separately [31][32][33][34][35][36] LangGraph Platform - LangGraph Platform is Langchain's enterprise solution for developing, deploying, and managing AI agents [38] - It allows users to create production-ready versions of assistants and access them via API [40][41][42] - It provides a complete REST API specification for creating, managing, and updating assistants programmatically [42][54] SDK & API - LangGraph provides an SDK and API for programmatically creating, using, and managing assistants [47][54] - The SDK allows integration with existing applications and systems, enabling management of the complete lifecycle of agents and assistants from code [54]
How Prosper Cut QA Costs by 90% for Financial Services with LangGraph Agents
LangChain· 2025-07-01 16:44
Business Impact - Prosper Marketplace cut costs in its verification use case by over 90% using Langraph [9] - The cost per verification decreased from tens of dollars to cents [9] - The company moved from reviewing a sample of calls monthly to reviewing 100% of calls within minutes [10] Technological Implementation - Prosper Marketplace uses Langraph to automate QA verification process for customer calls [2] - The company needed a solution with complete ownership and control over data and deployment due to strict data compliance requirements [5] - Langraph's checkpoint system and interrupts simplified development, enabling focused optimizations and human-in-the-loop workflows [6][7] - Langraph allows quick adaptation and reuse of agents across different use cases, saving engineering time [10] Langraph Advantages - Langraph's checkpoint system makes development easier by allowing focused optimizations [6] - Interrupts facilitate building collaborative co-pilot style agents with natural language feedback [7][8] - Langchain team provides templates and examples to quickly get started with complex agents [11]
Building a multi-modal researcher with Gemini 2.5
LangChain· 2025-07-01 15:01
Gemini Model Capabilities - Gemini 2.5% Pro and Flash models achieved GA (General Availability) on June 17 [11] - Gemini models feature native reasoning, multimodal processing, million-token context window, native tools (including search), and native video understanding [12] - Gemini models support text-to-speech capabilities with multiple speakers [12] Langraph Integration & Researcher Tool - Langraph Studio facilitates the orchestration of the researcher tool, allowing visualization of inputs and outputs of each node [5] - The researcher tool utilizes Gemini's native search tool, video understanding for YouTube URLs, and text-to-speech capabilities to generate reports and podcasts [2][18] - The researcher tool simplifies research by combining web search and video analysis, and offers alternative ingestion methods like podcast generation [4][5] - The researcher tool can be easily customized and integrated into applications via API [9] Performance & Benchmarks - Gemini 2.5% series models demonstrate state-of-the-art performance on various benchmarks, including LM Marine, excelling in tasks like text, webdev, vision, and search [14] - Gemini 2.5% Pro model was rated the best in generating an SVG image of a pelican riding a bicycle, outperforming other models in a benchmark comparison [16][17] Development & Implementation - The deep researcher template using Langraph serves as a foundation, modified to incorporate native video understanding and text-to-speech [18] - Setting up the researcher tool involves cloning the repository, creating an ENV file with a Gemini API key, and running Langraph Studio locally [19] - The code structure includes nodes for search, optional video analysis, report creation, and podcast creation, all reflected visually in Langraph Studio [20]
How to Build an Agent with Auth and Payments - LangGraph.js
LangChain· 2025-06-30 17:28
Core Functionality & Architecture - The application provides a credit system for charging users based on LLM usage, allowing them to purchase Stripe subscriptions for more credits [1][2] - The codebase consists of five key areas: authentication, payments, credit infrastructure, chat agent, and user interface [3][4][5] - Authentication is implemented using Superbase, with JWT tokens protecting the Langraph agent via middleware [3][4][8] - Payments infrastructure is handled by Stripe, enabling users to buy subscriptions and receive credits [4][12][13] - Credit infrastructure, stored in Superbase, includes utility functions for adding, refreshing, and removing credits [4][14][15] Technical Implementation - The project is a monorepo with an 'agents' application (Langraph agent, middleware) and a 'web' application (UI, Stripe, Superbase, credits) [5][6] - Langraph middleware verifies Superbase JWT tokens to grant users permissions to interact with the graph [4][8] - Stripe integration includes utility functions for creating sessions, getting subscriptions, and managing user credits [12] - A webhook route processes Stripe events (subscription creation, updates, deletion) to update user data in Superbase [13] - The application uses providers to manage the state of authentication and credits on the client side [10][14] Data Flow & Security - Superbase JWT tokens are passed through the application to the Langraph middleware for authentication [4][18][19] - The thread and stream providers are key components for passing the JWT token to the Langraph client [18][19] - User credits are updated optimistically on the UI and finalized in the Superbase database [15][16] Resources & Documentation - The repository includes a credit system file outlining key files for the credit and authentication systems [20] - A detailed readme provides step-by-step instructions for setting up and running the application [21]