MCPcopy Create free account
hub / github.com/serverless/examples / create_agent

Function create_agent

aws-bedrock-agentcore/python/strands-browser/agent.py:48–84  ·  view source on GitHub ↗

Create a Strands agent with browser capabilities. Returns: Configured Strands Agent instance

()

Source from the content-addressed store, hash-verified

46
47
48def create_agent():
49 """
50 Create a Strands agent with browser capabilities.
51
52 Returns:
53 Configured Strands Agent instance
54 """
55 # Conversation manager to handle token limits
56 conversation_manager = SlidingWindowConversationManager(
57 window_size=25,
58 per_turn=True
59 )
60
61 return Agent(
62 model=MODEL_ID,
63 tools=[browser_tool.browser],
64 conversation_manager=conversation_manager,
65 system_prompt="""You are an intelligent research assistant with web browsing capabilities.
66
67Your capabilities:
68- Navigate to websites and extract information
69- Analyze financial data from stock market websites
70- Research topics by visiting multiple sources
71- Extract structured data from web pages
72
73Guidelines:
741. Use the browser tool efficiently - aim for 2-3 interactions per task
752. Extract specific data points with actual numbers
763. Summarize findings clearly with sources
774. Handle errors gracefully and try alternative approaches
78
79For financial analysis, focus on:
80- Current prices and trends
81- Key metrics (P/E, Market Cap, Volume)
82- Recent news and market sentiment
83- Analyst recommendations""",
84 )
85
86
87@app.entrypoint

Callers 1

invokeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected