Motivation
Specific Example
Process
Observability
@traceable(run_type="llm",
name="Overall Research",
project_name="Anthropic Deep Researcher")
Rapid Testing
pip install langgraphentrypoint decorator to a function that wraps your agent@entrypoint()
def wrap_agent_with_langgraph(input: dict) -> dict:
# Create and run research agent
agent = create_research_agent()
result = agent.research(input)
# Return structured result for LangGraph Studio
return {
"final_report": result['content'],
"metadata": result.get('metadata', {}),
"sources": result.get('sources', [])
}
LangGraph.json file{
"graphs": {
"wrap_agent": "./src/open_deep_research/non_langgraph/graph.py:wrap_agent_with_langgraph"
},
"python_version": "3.11",
"env": "./.env",
"dependencies": [
"."
]
}
pip install -U "langgraph-cli[inmem]"N_JOBS_PER_WORKER=1 langgraph dev
Configurationfrom open_deep_research.non_langgraph.configuration import Configuration
from typing_extensions import TypedDict
from langchain_core.runnables import RunnableConfig
from langchain_core.messages import convert_to_openai_messages
from langchain_core.messages import AnyMessage
class State(TypedDict):
messages: List[AnyMessage]
@entrypoint(config_schema=Configuration)
def wrap_agent_with_langgraph(input: State, config: RunnableConfig) -> dict:
"""
LangGraph entrypoint that wraps the DeepResearchAgent for Studio use.
This function extracts configuration from LangGraph Studio's UI and passes
it to the research agent, enabling users to customize research parameters
through the Studio interface.
Args:
input: Dict containing 'messages' list for the research query
config: LangGraph RunnableConfig with configurable parameters
Returns:
Dict with 'final_report' containing the research results
"""
# Extract LangGraph Studio configuration
configurable = Configuration.from_runnable_config(config)
# Convert LangGraph Configuration to ResearchConfig
research_config = ResearchConfig(
model=configurable.model,
writer_model=configurable.writer_model,
temperature=configurable.temperature,
max_tokens=configurable.max_tokens,
max_iterations=configurable.max_iterations,
max_searches_total=configurable.max_searches_total,
enable_clarification_qa=configurable.enable_clarification_qa,
clarification_timeout=configurable.clarification_timeout,
search_domains=configurable.search_domains,
search_location=configurable.search_location,
)
# Create and run research agent
agent = create_research_agent(research_config)
# LangChain Message format to OpenAI
openai_message_format = convert_to_openai_messages(input['messages'])
result = agent.research(openai_message_format)
# Return structured result for LangGraph Studio
return {
"final_report": result['content'],
"metadata": result.get('metadata', {}),
"sources": result.get('sources', [])
}