new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

LangChain · Deep Agents · all subjects

best practices

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.

Best practice: filter node_modules from file tree

Filter node_modules from the file tree when fetching. Nobody wants to browse thousands of dependency files.

Best practice: persist threadId in sessionStorage

Persist threadId in sessionStorage so page reloads reconnect to the same thread and sandbox instead of creating new ones.

Best practice: sync files on every tool call

Sync files on every relevant tool call, not just when the run finishes. Watch for write_file, edit_file, delete (Python only), and execute tool messages and refresh immediately.

Best practice: use sandbox auth proxy for secrets

Keep secrets out of the sandbox. Use the sandbox auth proxy instead of environment variables or file uploads for API keys.

Best practice: add guardrails for autonomous agents

Configure rate limits, error handling, and data privacy middleware for autonomous coding agents before launch.

Strategies for multimodal-heavy workloads

For multimodal-heavy workloads: store images, screenshots, and charts in a filesystem backend or external object store, then pass file paths or URLs through messages; prefer references over base64-encoded image blocks in long-running conversations; use subagents for image-heavy inspection so the main agent receives a compact text result; tune summarization thresholds or provide a custom token counter when your provider charges many tokens for images.

Best practice for tool outputs with large media

When a tool produces images or other large binary data, save the artifact to a backend and return a concise text description plus a path or URL. This keeps message history smaller and works better with context compression.

Suggested models for Deep Agents eval suite

Models that perform well on the Deep Agents eval suite: Google provides `gemini-3.1-pro-preview` and `gemini-3.6-flash`; OpenAI provides `gpt-5.5` and `gpt-5.4`; Anthropic provides `claude-opus-4-8`, `claude-opus-4-7`, and `claude-opus-4-6`. Passing these evals is necessary but not sufficient for strong performance on longer, more complex tasks.

Open-weight models in Deep Agents

Open-weight models `GLM-5.2`, `Kimi-K2.7 Code`, and `MiniMax-M3` are available through providers. In Python, they are accessible via Baseten, Fireworks, OpenRouter, and Ollama. In JavaScript, they are accessible via OpenRouter and Ollama.

Give your agent this brain