[KongchangAI]
· 3 min read· 1,779 words

Building Enterprise-Grade Agents from Scratch: A Deep Dive into LangChain 1.0's Core Capabilities

Building Enterprise-Grade Agents from Scratch: A Deep Dive into LangChain 1.0's Core Capabilities

A complete guide to AI Agent fundamentals and LangChain 1.0's key upgrades for enterprise Agent development.

AI Agents are software programs that autonomously perceive environments, make dynamic decisions, and call tools to complete tasks — representing a fundamental shift from hard-coded logic to LLM-driven semantic reasoning. An Agent's performance ceiling is directly determined by the underlying model's reasoning capability. On the framework side, LangChain 1.0 introduces a unified `create_agent` interface, migrates the Agent layer to LangGraph, and adds middleware, standardized output, and structured output — significantly reducing multi-model adaptation and engineering overhead.

In the wave of AI application deployment, Agents (AI Agents) have evolved from a technical concept into a standard building block for enterprise applications. Whether it's office automation, enterprise intelligent assistants, or complex business process orchestration, the underlying mechanism is always Agent-driven. This article is based on a systematic Agent tutorial from Bilibili, covering the core concepts of Agents, the evolution of software paradigms, and the key upgrades in LangChain 1.0 — the current mainstream development framework.

What Exactly Is an Agent?

An Agent, also known as an AI Agent, is essentially an autonomously running software program. It perceives its environment, collects data, makes decisions based on that data, executes tasks, and ultimately achieves predefined goals.

If you've used coding tools like Codex, or the early viral sensation Manus (nicknamed "Crayfish" in Chinese communities), you'll find this familiar — you just hand it a task, and it handles everything: gathering information, breaking down steps, and calling tools automatically. Ask it to check tomorrow's weather or complete a series of operations, and humans only need to issue the instruction.

Of course, current Agents also have notable pain points. The tutorial mentions that one major criticism of early Manus was its extremely high Token consumption, driving up costs. Another issue is security. These are real-world constraints that must be considered when developing Agents.

Shift to Semantic-Driven

The Evolution of Software Paradigms: From Web Apps to the Agent Era

To understand the significance of Agents, it helps to view them within the broader context of software paradigm evolution.

The Web App Era: Early internet was dominated by portal websites and browser-based applications, with information exchange happening through hyperlinks and static web pages — Taobao in its early days is a classic example.

The Mobile Internet Era: With the proliferation of smartphones, apps became the dominant form. Ordering food, hailing a ride, shopping — all required separate standalone apps.

The AI Agent Era: We are now entering this stage. The tutorial makes a bold prediction — in the future, the vast majority (perhaps 99%) of software will be powered by large language models. These systems possess autonomous decision-making capabilities, marking a shift from hard-coded logic to semantic-driven reasoning.

The core distinction lies here: the Web and mobile eras operated on "deterministic logic," where business logic was preset by product managers and engineers through hard-coded rules covering all known scenarios. The AI Agent era operates on "generative reasoning," with large models at the core, making dynamic judgments based on context, constraints, and goals.

For example, platforms like Taobao and Ant Group have already launched conversational ordering and AI health assistant products. Say "order me a bubble tea," and it will automatically search nearby shops, filter options, and place the order — a vivid demonstration of semantic reasoning replacing hard-coded logic.

Software Paradigm Evolution

How Agents Work: Core Mechanisms and Capabilities

A complete Agent execution cycle can be broken down into four stages:

  • Perceive the environment: Collect user input and external context
  • Reason and plan: Break down and plan complex tasks based on prompt strategies and model capabilities
  • Execute actions: Call external tools or APIs to complete specific operations
  • Return observations: Evaluate feedback and decide whether to start the next iteration

Take "turn a piece of copy into a video" as an example: the Agent first decomposes the task — how long is the copy, how long should the video be, what voice style to use; then it recognizes it can't generate audio on its own and needs to call an external tool; after generating the audio, it checks whether the task is complete and continues processing the visuals. The entire process is a multi-round iterative loop.

Correspondingly, Agents have four core capabilities: planning, memory, tools, and execution. Memory is divided into long-term and short-term. Tools are especially critical — the tutorial vividly puts it: an Agent without external tools is just a "dwarf in action," unable to check weather, book tickets, or read local files.

Agent Core Capabilities

The LLM as the Foundation of Agent Capability

It's worth emphasizing the absolutely central role of large language models in Agents. The LLM provides the most critical reasoning layer and directly determines the performance floor of an Agent.

This also explains why the Agent concept was proposed long ago but only became truly popular recently — it's not that the idea changed, but that model capabilities have caught up. When a model is strong enough, even a rough architecture can maintain a baseline experience; when model capability is lacking, prompt engineering or architectural optimization can rarely break through that ceiling.

On model selection: in the closed-source camp, there's Claude, GPT, and Gemini; in the open-source camp, DeepSeekAd leads the way. The tutorial notes that domestic Chinese models have become quite competitive — DeepSeek, Kimi, GLM, and others can now go toe-to-toe with foreign models. For products targeting the Chinese market, domestic models are typically the first choice, since using foreign models often involves regulatory compliance and reporting processes.

The LLM's role as a "reasoning engine" within an Agent manifests at two levels: first, task decomposition and planning — given an ambiguous natural language instruction, the model must break it down into a sequence of executable sub-steps; second, tool-calling decisions — determining which tool to call for the current sub-task, what parameters to pass, and interpreting the tool's return value to decide whether to continue iterating. This capability technically relies on "Function Calling" or "Tool Use" interfaces — major model providers specifically reinforce this capability during training, enabling the model to output tool-calling instructions in structured JSON format rather than free-form text. This is why older versions of LangChain needed to distinguish between models that "support function calling" and those that don't: earlier models without this capability could only simulate tool calling through prompt engineering, with far lower stability and accuracy than natively supported models.

Mainstream Development Frameworks and LangChain 1.0

The main Agent development frameworks currently available include:

  • LangChain: The tutorial considers this the must-learn first-choice framework for Agent development
  • LlamaIndex: Rich in data processing components, primarily used for RAG, but can also build Agents
  • Langflow: Visual and low-code, also leaning toward RAG use cases

LangChain has undergone a major iteration from 0.x to 1.x. Version 0.3 was long criticized for its chaotic API design and lack of Agent-first architecture. According to the tutorial, the timeline is: 1.0 was released last October, followed by 1.1 and 1.2 in November and December respectively — a very high update frequency, with noticeable differences already between 1.0 and 1.2.

LangChain 1.0's Six Core Upgrades

  1. Unified Agent Interface: create_agent is now the universal entry point for creating agents, ending the confusion caused by over a dozen different creation methods in older versions. The old approach also had inconsistent requirements depending on model capabilities (e.g., whether function calling was supported), making onboarding and maintenance costly.
  2. Middleware System: Introduces an aspect-oriented middleware mechanism that supports fine-grained, non-invasive control over business workflows.
  3. Standardized Output: Unifies the return format across different LLM providers, so switching between DeepSeek, OpenAI, and Gemini no longer requires individual adapters.
  4. Structured Output: Supports custom schemas, enforcing the model to return structured data that can be parsed and decomposed.
  5. Core Framework Upgrade: The Agent layer is rebuilt on top of LangGraph, dramatically improving capability and extensibility.
  6. Legacy API Migration: The Chain functionality from 0.x has been moved to a separate module and will be gradually deprecated — watch for compatibility warnings when using it.

Core Framework Upgrade

LangGraph is the underlying graph computation framework designed by the LangChain team specifically for complex Agent workflows. Its core idea is to model the Agent's execution flow as a directed graph: each node represents a processing step (such as calling a model or executing a tool), and each edge represents a state transition condition. Compared to the old chain-based structure, which could only execute linearly, LangGraph natively supports loops (Agents iterating until a task is complete), conditional branching (choosing different paths based on model output), and multi-Agent collaboration and other complex topologies. After LangChain 1.0 migrated the Agent layer to LangGraph, developers can both use create_agent to enjoy high-level abstraction and simplicity, and directly manipulate the graph structure when fine-grained control is needed — this is the fundamental reason why 1.0's extensibility has improved so dramatically.

RAG (Retrieval-Augmented Generation) is another concept frequently mentioned alongside Agents. Its core idea is: before the model generates a response, it first retrieves relevant document chunks from an external knowledge base and injects them into the context, compensating for the model's knowledge cutoff limitations and reducing hallucinations. LlamaIndex and Langflow lean toward RAG, while LangChain emphasizes tool calling and multi-step reasoning beyond RAG. In practice, the two are often combined — using RAG to provide domain knowledge and Agent to orchestrate multi-turn task workflows.

Quickly Building an Agent with create_agent

The most immediately apparent improvement in the new version is that creating an Agent requires just a few lines of code, passing four parameters: model, tool list, system prompt, and middleware configuration (middleware is optional and can be omitted).

The tutorial demonstrates a working example: import create_agent from langchain, use DeepSeek as the model, configure two tools — one for weather lookup (a simulated implementation in the demo, not connected to a real third-party API) and one calculator (executing expressions internally via eval). The system prompt is set to: "You are a practical life assistant. Prioritize using tools to solve user problems. Be concise and accurate."

Then two tasks are given to the Agent: "What's the weather like in Beijing?" and "Calculate 256 times 18 for me." When running, the Agent automatically calls get_weather to return weather information, then calls the calculator to complete the arithmetic.

The tutorial also notes that since the example does not use streaming output, the Agent waits until all results are processed before returning everything at once, resulting in a longer response time. Enabling streaming output achieves the "see results as they arrive" experience. Additionally, DeepSeek returns Markdown format by default, which explains the formatting of the output.

Summary

This tutorial paints a clear big picture of Agent technology: from conceptual definitions and software paradigm evolution, to working mechanisms and core capabilities, all the way down to hands-on practice with LangChain 1.0. For anyone looking to get started with Agent development, two threads are key — the LLM's foundational role in determining the performance ceiling, and LangChain 1.0's unified development paradigm centered on create_agent. The rest — planning, memory, tools, execution — all unfold progressively within this framework as practical content.

#AI Agent#LangChain 1.0#create_agent#LangGraph#Agent development framework#large language model#RAG#function calling
Share:

Related articles