new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

LangChain · Agents · all subjects

agent building fundamentals

9 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Define a Managed Deep Agent in Python

Use the `define_deep_agent` function from the `managed_deepagents` module to create a Managed Deep Agent. The function accepts parameters including name, model, tools, middleware, subagents, permissions, interrupt_on, and response_format. Example: `from managed_deepagents import define_deep_agent` followed by `agent = define_deep_agent(name="research-assistant", model="openai:gpt-5.5")`.

Define a Managed Deep Agent in JavaScript

Use the `defineDeepAgent` function from the `managed-deepagents` module to create a Managed Deep Agent. Export the agent as a named export. The function accepts parameters including name, model, tools, middleware, subagents, permissions, interruptOn, and responseFormat. Example: `import { defineDeepAgent } from "managed-deepagents"` followed by `export const agent = defineDeepAgent({ name: "research-assistant", model: "openai:gpt-5.5" })`.

Agent definition file location and export

In Python, the agent definition lives in `my-agent/agent.py` and must be exported as a named `agent`. In JavaScript, the agent definition lives in `my-agent/agent.ts` or `my-agent/agent.tsx` and must be exported as a named `agent`.

Agent name parameter requirements

The `name` parameter is required and must be a static string that starts with a letter and contains only letters, numbers, underscores, or hyphens, such as `"research-assistant"`. MDA uses the name as the LangGraph assistant ID and the default LangSmith deployment name. The deployment name can be overridden with `mda deploy --name` without changing the agent definition.

Agent definition parameters table - Python

Python `define_deep_agent` parameters: `name=` sets the agent and default deployment name (required); `model=` selects the chat model (required); `tools=` adds tools the agent can call; `middleware=` adds behavior around model calls, tool calls, and the agent lifecycle; `subagents=` defines specialized agents for delegated tasks; `permissions=` controls path-level access for filesystem tools; `interrupt_on=` pauses before selected tool calls for human approval; `response_format=` defines a structured output schema.

Agent definition parameters table - JavaScript

JavaScript `defineDeepAgent` parameters: `name` sets the agent and default deployment name (required); `model` selects the chat model (required); `tools` adds tools the agent can call; `middleware` adds behavior around model calls, tool calls, and the agent lifecycle; `subagents` defines specialized agents for delegated tasks; `permissions` controls path-level access for filesystem tools; `interruptOn` pauses before selected tool calls for human approval; `responseFormat` defines a structured output schema.

Five stages of agent development lifecycle

The agent development lifecycle consists of five stages: Build, Test, Deploy, Monitor, and Govern. These stages form a cyclical process for developing agents end-to-end, with an Engine at the center connecting the stages.

Build stage uses Deep Agents framework

In the Build stage of the agent lifecycle, agents are defined using Deep Agents framework. The documentation references Deep Agents/overview for details on this stage.

Lifecycle is framework-agnostic

While the agent lifecycle walkthrough uses Deep Agents as an example framework, each stage of the lifecycle (Build, Test, Deploy, Monitor, Govern) is framework-agnostic. Users can bring their own stack and adopt only the stages they need, or use LangSmith as an all-in-one platform.

Give your agent this brain