ReCentAutomaยถ
ReCentAutoma is an agentic module implementation in Bridgic that provides a goal-oriented, guidance-enabled long-running autonomous agent. It enables developers to build intelligent systems that can autonomously plan and execute multi-step tasks using tools, with built-in memory management and goal tracking.
Introductionยถ
ReCentAutoma serves as a specialized agentic module in Bridgic, designed to provide a goal-oriented, guidance-enabled implementation for long-running autonomous agents. It addresses the fundamental challenges of building intelligent systems that can autonomously plan, execute, and adapt over extended interactions.
When to Use ReCentAutomaยถ
ReCentAutoma is suitable when you need to develop an application with autonomous capabilities and dynamic tool usage. In many cases, developers also need:
- Efficient memory management: As tasks span multiple steps and tool calls, conversation history grows. ReCentAutoma's built-in ReCENT memory managemnt algorithm automatically compresses history when needed, preventing context explosion.
- Natural language goal definition: ReCentAutoma accepts
goalas a first-class input, so you can state your objectives directly in natural language. - Customized task guidance: You can provide an optional
guidanceinput to further constrain or direct the agent's behavior, enabling more control across the execution.
These capabilities are well-supported in ReCentAutoma, making it ideal for building autonomous agents that need to:
- Dynamically make decisions at runtime to select tools for each step
- Autonomously execute multiple steps during a long-time task
- Automatically maintain alignment with the initial goal throughout the entire execution process
How Does ReCentAutoma Workยถ
ReCentAutoma leverages GraphAutoma's core featuresโdynamic topology and dynamic routingโto implement an enhanced ReAct (Resoning and Acting) loop. It incorporates the innovative ReCENT (Recursive Compressed Episodic Node Tree) memory management algorithm, which triggers memory compression when necessary, effectively addressing two long-standing challenges in autonomous agents:
- Context Explosion: As conversation history grows linearly, the context window eventually overflows. ReCENT automatically compresses episodic memory when thresholds are reached, maintaining a compact yet informative context.
- Goal Drift: Without explicit goal management, agents tend to deviate from original objectives during extended execution. ReCentAutoma maintains goal and guidance as persistent, non-compressible nodes, ensuring the agent stays focused on the original task.
Quick Startยถ
Let's explore ReCentAutoma through practical examples. We'll start with a simple weight management assistant using custom tools, then move to a more advanced browser automation agent using MCP integration.
First of all we have to initialize an LLM instance:
import dotenv
import os
from bridgic.llms.openai import OpenAILlm, OpenAIConfiguration
dotenv.load_dotenv()
_api_key = os.environ.get("OPENAI_API_KEY")
_api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
_model_name = os.environ.get("OPENAI_MODEL_NAME", "gpt-4o-mini")
# Initialize LLM (you can replace this with your own LLM instance)
llm = OpenAILlm(
api_base=_api_base,
api_key=_api_key,
configuration=OpenAIConfiguration(model=_model_name),
timeout=60,
)
Example 1: Building a Weight Management Assistant with Custom Toolsยถ
In this example, we'll create custom tools for BMI calculation and ideal weight calculation, then use ReCentAutoma to build a weight management assistant that can help users understand their health metrics.
from bridgic.core.automa import RunningOptions
from bridgic.core.agentic.recent import ReCentAutoma, StopCondition
# Define custom tools for weight management
async def calculate_bmi(weight_kg: float, height_m: float) -> str:
"""
Calculate Body Mass Index (BMI) from weight and height.
Parameters
----------
weight_kg : float
Weight in kilograms. Must be a positive number.
height_m : float
Height in meters. Must be a positive number.
Returns
-------
str
A formatted string containing the BMI value and its interpretation. BMI categories:
- Underweight: < 18.5
- Normal: 18.5 - 24.9
- Overweight: 25 - 29.9
- Obese: >= 30
"""
if weight_kg <= 0 or height_m <= 0:
return "Error: Weight and height must be positive numbers."
bmi = weight_kg / (height_m ** 2)
if bmi < 18.5:
category = "Underweight"
elif bmi < 25:
category = "Normal"
elif bmi < 30:
category = "Overweight"
else:
category = "Obese"
return f"BMI: {bmi:.2f} ({category}). Weight: {weight_kg} kg, Height: {height_m} m."
# Create an agent with the custom tools (setting debug=True to see more details)
weight_assistant = ReCentAutoma(
llm=llm,
tools=[calculate_bmi],
stop_condition=StopCondition(max_iteration=5, max_consecutive_no_tool_selected=1),
running_options=RunningOptions(debug=True),
)
person_weight = 82
person_height = 1.70
person_name = "John Smith"
person_gender = "male"
result = await weight_assistant.arun(
goal=(
f"Calculate a person's BMI and provide personalized suggestions for effective weight management."
f"\n- Name: {person_name}"
f"\n- Gender: {person_gender}"
f"\n- Weight: {person_weight} kg"
f"\n- Height: {person_height} m"
),
guidance=(
"First calculate the BMI of the person and then give out a suggestion about the weight management."
),
)
print(result)
[ReCentAutoma]-[ReCentAutoma-751ecd6b] is started. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [initialize_task_goal] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__automa__] triggers [initialize_task_goal] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ฏ Task Goal Calculate a person's BMI and provide personalized suggestions for effective weight management. - Name: John Smith - Gender: male - Weight: 82 kg - Height: 1.7 m First calculate the BMI of the person and then give out a suggestion about the weight management. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [initialize_task_goal] triggers [observe] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ Observation Iteration: 1 Achieved: False Thinking: The BMI has not yet been calculated for John Smith, and no personalized weight management suggestions have been provided. Consequently, there are significant gaps between the current state and the task goal, as both required outputs are incomplete. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ง Tool Selection Tool 1: calculate_bmi id: tool_ae193be845224084986f1e56b arguments: {'weight_kg': 82, 'height_m': 1.7} [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [tool-<calculate_bmi>-<tool_ae193be845224084986f1e56b>] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [select_tools] triggers [tool-<calculate_bmi>-<tool_ae193be845224084986f1e56b>] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [collect_results-<abe2a140>] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [tool-<calculate_bmi>-<tool_ae193be845224084986f1e56b>] triggers [collect_results-<abe2a140>] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ฉ Tool Results Tool 1: calculate_bmi id: tool_ae193be845224084986f1e56b result: BMI: 28.37 (Overweight). Weight: 82 kg, Height: 1.7 m. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [collect_results-<abe2a140>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ Observation Iteration: 2 Achieved: False Thinking: The BMI has been calculated as 28.37, indicating that John is overweight. However, personalized suggestions for effective weight management still need to be provided. Therefore, gaps remain in the completion of the task goal, specifically in offering actionable weight management advice. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-751ecd6b] ๐ง Tool Selection (No tools selected) LLM Response: Now that the BMI has been calculated as 28.37, which classifies John as overweight, the next step is to provide personalized weight management suggestions based on this BMI classification. Since there are no specific tools listed for providing suggestions, I will proceed to formulate some general weight management advice based on his BMI. ### Suggested Weight Management Tips for John Smith: 1. **Healthy Eating**: Focus on a balanced diet rich in fruits, vegetables, lean proteins, and whole grains. Limit processed foods, sugars, and saturated fats. 2. **Regular Exercise**: Aim for at least 150 minutes of moderate-intensity aerobic exercise each week, along with strength training exercises on two or more days a week. 3. **Monitor Portion Sizes**: Being mindful of portion sizes can help manage calorie intake. 4. **Stay Hydrated**: Drink plenty of water throughout the day and limit sugary beverages. 5. **Set Realistic Goals**: Aim for gradual weight loss (0.5 to 1 kg per week) for sustainable results. 6. **Consult a Professional**: If possible, consult with a dietitian or a fitness expert for personalized guidance and support. With this information, the task goal is now complete. [ReCentAutoma]-[ReCentAutoma-751ecd6b] [__dynamic_step__] driving [finalize_answer] [ReCentAutoma]-[ReCentAutoma-751ecd6b] [select_tools] triggers [finalize_answer] [ReCentAutoma]-[ReCentAutoma-751ecd6b] is finished. ### Comprehensive Final Answer **Personal Information:** - **Name:** John Smith - **Gender:** Male - **Weight:** 82 kg - **Height:** 1.7 m **BMI Calculation:** - **BMI Result:** 28.37 - **Weight Status:** Overweight **Personalized Weight Management Suggestions:** 1. **Dietary Changes:** - Aim for a balanced diet rich in fruits, vegetables, whole grains, and lean proteins. - Reduce intake of processed foods, sugary beverages, and high-fat snacks. - Consider portion control to prevent overeating. 2. **Regular Physical Activity:** - Incorporate at least 150 minutes of moderate aerobic activity each week, such as brisk walking, swimming, or cycling. - Include strength training exercises at least two days a week to build muscle mass and boost metabolism. 3. **Monitor Progress:** - Keep a food diary to track daily food intake and physical activity. - Weigh yourself regularly (e.g., once a week) to monitor progress without becoming discouraged by day-to-day fluctuations. 4. **Consult a Professional:** - Consider speaking with a healthcare provider or a registered dietitian for a personalized plan tailored to Johnโs specific needs and goals. 5. **Set Realistic Goals:** - Aim for gradual weight loss (about 0.5-1 kg per week) to achieve long-term success without feeling deprived. By following these suggestions, John Smith can work towards achieving a healthier weight and improving overall well-being.
Example 2: Building a Browser Automation Agent with Playwright MCP Serverยถ
This example demonstrates how to integrate ReCentAutoma with MCP (Model Context Protocol) to create a browser automation agent. We'll use the Playwright MCP server to enable the agent to interact with browsers like Chrome autonomously to achieve the user-defined goal.
This example demonstrates how to combine ReCentAutoma with MCP (Model Context Protocol) Integration to build a browser automation agent for retrieving the latest gold prices from the official website of the Hong Kong Gold Exchange.
Steps overview:
- Connect to the Playwright MCP server via stdio transport for browser automation capabilities.
- Register the connection using a dedicated Connection Manager to manage browser operations in isolation.
- Create a
ReCentAutomaagent loaded with browser automation tools. - Let the agent autonomously navigate to the Hong Kong Gold Exchange website and extract the needed information.
If youโre new to MCP, please check the MCP Quick Start for setup and usage instructions.
import os
import tempfile
from bridgic.core.automa import RunningOptions
from bridgic.core.agentic.recent import ReCentAutoma, ReCentMemoryConfig, StopCondition
from bridgic.protocols.mcp import (
McpServerConnectionStdio,
McpServerConnectionManager,
)
temp_dir = os.path.realpath(tempfile.mkdtemp())
print(f"โ Using temporary directory: {temp_dir}")
# Connect to Playwright MCP server
# Note: This requires Node.js and npx to be installed
playwright_connection = McpServerConnectionStdio(
name="connection-playwright-stdio",
command="npx",
args=[
f"@playwright/mcp@latest",
f"--output-dir={temp_dir}",
f"--viewport-size=1920x1080",
f"--save-video=1920x1080",
],
request_timeout=60,
)
# Register the connection with a dedicated manager
McpServerConnectionManager.get_instance("browser-use").register_connection(playwright_connection)
# Establish the connection and verify connection and list available tools
playwright_connection.connect()
print(f"โ Connected to Playwright MCP server: {playwright_connection.name}")
print(f" Connection status: {playwright_connection.is_connected}")
# List tools
tools = playwright_connection.list_tools()
print(f"โ Found {len(tools)} available browser tools")
# Create a browser automation agent with Playwright MCP tools
browser_agent = ReCentAutoma(
llm=llm,
tools=tools,
memory_config=ReCentMemoryConfig(
llm=llm,
max_node_size=8,
max_token_size=1024*32,
),
stop_condition=StopCondition(max_iteration=20, max_consecutive_no_tool_selected=1),
running_options=RunningOptions(debug=True),
)
# Use the agent to search for information on Google
search_query = "The latest price of gold"
result = await browser_agent.arun(
goal=(
f"Find the recent gold prices on Hong Kong Gold Exchange website."
),
guidance=(
"Do the following steps one by one:\n"
"1. Navigate to https://hkgx.com.hk/en\n"
"2. Hover on the 'Market & Data' button to show more button options\n"
"3. Click the 'History Price' button to access the historical price page\n"
"4. Since the current date was selected, only need to select the option of RMB-denominated kilo gold\n"
"5. Click the search button and have a look at the recent gold price trends\n"
"6. Close the browser and give out a summary of recent gold price trends\n"
),
)
print("Final Result:\n\n")
print(result)
# Close the connection when done
playwright_connection.close()
print(f"\nโ Connection closed: {not playwright_connection.is_connected}")
โ Using temporary directory: /private/var/folders/9t/5r9fms9s5q33p6xty_0_k1mw0000gn/T/tmpspv3qdhb โ Connected to Playwright MCP server: connection-playwright-stdio Connection status: True โ Found 22 available browser tools [ReCentAutoma]-[ReCentAutoma-7708d76f] is started. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [initialize_task_goal] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__automa__] triggers [initialize_task_goal] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฏ Task Goal Find the recent gold prices on Hong Kong Gold Exchange website. Do the following steps one by one: 1. Navigate to https://hkgx.com.hk/en 2. Hover on the 'Market & Data' button to show more button options 3. Click the 'History Price' button to access the historical price page 4. Since the current date was selected, only need to select the option of RMB-denominated kilo gold 5. Click the search button and have a look at the recent gold price trends 6. Close the browser and give out a summary of recent gold price trends [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [initialize_task_goal] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 1 Achieved: False Thinking: No observation history or stage summaries are provided in the conversation. Therefore, I have no information on whether the steps to navigate the Hong Kong Gold Exchange website, access the historical prices page, select RMB-denominated kilo gold options, and review recent gold prices have been performed. Without this information, I cannot confirm if the recent gold prices were found or if the browser was closed and a summary given. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_navigate id: tool_c9910ae1b63e44fab7722d7d7 arguments: {'url': 'https://hkgx.com.hk/en'} [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_navigate>-<tool_c9910ae1b63e44fab7722d7d7>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_navigate>-<tool_c9910ae1b63e44fab7722d7d7>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<61f4034c>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_navigate>-<tool_c9910ae1b63e44fab7722d7d7>] triggers [collect_results-<61f4034c>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_navigate id: tool_c9910ae1b63e44fab7722d7d7 result: meta=None content=[TextContent(type='text', text='### Ran Playwright code\nawait page.goto(\'https://hkgx.com.hk/en\');\n### Page\n- Page URL: https://hkgx.com.hk/en\n- Page Title: HKGX\n### Snapshot\n```yaml\n- generic [active] [ref=e1]:\n - banner:\n - banner [ref=e2]:\n - generic [ref=e3]:\n - link "logo" [ref=e4] [cursor=pointer]:\n - /url: /en;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n - img "logo" [ref=e5]\n - generic [ref=e6]:\n - generic [ref=e7] [cursor=pointer]:\n - link "Contact Us" [ref=e9]:\n - /url: /en/contact;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n - link "downloadZone" [ref=e11]:\n - /url: /en/download/downloadtheform;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n - generic [ref=e12]: ็ฎ | ็น | Eng\n - generic [ref=e13]:\n - img "user" [ref=e14]\n - generic [ref=e15]: Member Login\n - li... [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<61f4034c>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 2 Achieved: False Thinking: The initial step of the task, namely navigating to the Hong Kong Gold Exchange website (https://hkgx.com.hk/en), has been successfully completed. However, no further actions have been performed such as hovering on 'Market & Data', clicking on 'History Price', selecting RMB-denominated kilo gold, searching, or reviewing the recent gold price trends. Thus, the recent gold prices have not been gathered or summarized yet. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_hover id: tool_3352bb794f5a439a954784486 arguments: {'ref': 'e23'} [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_hover>-<tool_3352bb794f5a439a954784486>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_hover>-<tool_3352bb794f5a439a954784486>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<54f40f16>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_hover>-<tool_3352bb794f5a439a954784486>] triggers [collect_results-<54f40f16>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_hover id: tool_3352bb794f5a439a954784486 result: meta=None content=[TextContent(type='text', text='### Ran Playwright code\nawait page.getByRole(\'link\', { name: \'Market & Data\' }).hover();\n### Page\n- Page URL: https://hkgx.com.hk/en\n- Page Title: HKGX\n### Snapshot\n```yaml\n- <changed> generic [active] [ref=e1]:\n - banner:\n - banner [ref=e2]:\n - generic [ref=e3]:\n - ref=e4 [unchanged]\n - generic [ref=e6]:\n - ref=e7 [unchanged]\n - list [ref=e16]:\n - ref=e17 [unchanged]\n - listitem [ref=e21] [cursor=pointer]:\n - ref=e23 [unchanged]\n - generic [ref=e134]:\n - link "Open outcry" [ref=e135]:\n - /url: /en/marketdata/openoutcry;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n - generic [ref=e136]: Open outcry\n - link "GTP" [ref=e138]:\n - /url: /en/marketdata/gtp;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n - generic [ref=... [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<54f40f16>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 3 Achieved: False Thinking: So far, I have navigated to the Hong Kong Gold Exchange website and hovered over the 'Market & Data' button, revealing additional options including 'Price History'. However, I have not yet clicked the 'Price History' button, selected the RMB-denominated kilo gold option, clicked the search button, or reviewed the recent gold prices and trends. No summary of recent gold price trends has been provided yet. Therefore, the recent gold prices on the site have not been accessed or summarized to fulfill the task goal. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_click id: tool_1fd8b5486d85407293ac916d8 arguments: {'ref': 'e148'} [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_click>-<tool_1fd8b5486d85407293ac916d8>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_click>-<tool_1fd8b5486d85407293ac916d8>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<2953a6f5>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_click>-<tool_1fd8b5486d85407293ac916d8>] triggers [collect_results-<2953a6f5>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_click id: tool_1fd8b5486d85407293ac916d8 result: meta=None content=[TextContent(type='text', text='### Ran Playwright code\nawait page.getByRole(\'link\', { name: \'Price History\' }).click();\n### Page\n- Page URL: https://hkgx.com.hk/en/marketdata/pricehistory;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n- Page Title: HKGX\n### Snapshot\n```yaml\n- generic [active] [ref=e1]:\n - banner:\n - banner [ref=e2]:\n - generic [ref=e3]:\n - link "logo" [ref=e4] [cursor=pointer]:\n - /url: /en\n - img "logo" [ref=e5]\n - generic [ref=e6]:\n - generic [ref=e7] [cursor=pointer]:\n - link "Contact Us" [ref=e9]:\n - /url: /en/contact\n - link "downloadZone" [ref=e11]:\n - /url: /en/download/downloadtheform\n - generic [ref=e12]: ็ฎ | ็น | Eng\n - generic [ref=e13]:\n - img "user" [ref=e14]\n - generic [ref=e15]: Member Login\n - list [ref=e16]:\n - listitem [ref=e17] [cursor=... [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<2953a6f5>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 4 Achieved: False Thinking: I have navigated to the Hong Kong Gold Exchange website, hovered over 'Market & Data', and clicked the 'Price History' button to go to the historical price page. On the Price History page, I see options to select the product and date, including the option for 'RMB Kilo Gold'. However, I have not yet selected this option or clicked the search button to retrieve recent gold prices. I also have not reviewed the price trends or closed the browser and summarized the results. Therefore, some steps remain to fully achieve the task goal. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_select_option id: tool_f907e9c341ba43938db2c604d arguments: {'ref': 'e65', 'values': ['RMB Kilo Gold']} Tool 2: browser_click id: tool_74afc176c10f4dd79037b1302 arguments: {'ref': 'e66'} [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_select_option>-<tool_f907e9c341ba43938db2c604d>, tool-<browser_click>-<tool_74afc176c10f4dd79037b1302>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_select_option>-<tool_f907e9c341ba43938db2c604d>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_click>-<tool_74afc176c10f4dd79037b1302>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<6adb8285>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_select_option>-<tool_f907e9c341ba43938db2c604d>] triggers [collect_results-<6adb8285>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_select_option id: tool_f907e9c341ba43938db2c604d result: meta=None content=[TextContent(type='text', text='### Ran Playwright code\nawait page.locator(\'#selectCategory\').selectOption([\'RMB Kilo Gold\']);\n### Page\n- Page URL: https://hkgx.com.hk/en/marketdata/pricehistory;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n- Page Title: HKGX\n### Snapshot\n```yaml\n- <changed> generic [ref=e52]:\n - ref=e53 [unchanged]\n - generic [ref=e56]:\n - generic [ref=e57]:\n - ref=e60 [unchanged]\n - combobox [ref=e65]:\n - option "99 Tael Gold"\n - option "HK Kilo Gold"\n - option "RMB Kilo Gold" [selected]\n - option "999.9 Gold contract"\n - ref=e66 [unchanged]\n - generic [ref=e67]:\n - generic [ref=e96]: RMB Kilo Gold Please review the following table\n - table [ref=e98]:\n - rowgroup [ref=e99]:\n - row "Date Open High Low Close Benchmark Price" [ref=e100]:\n - columnheader "Date" [ref=e101]\n - columnheader "Open" [ref=e102]\n - columnheader "High" ... Tool 2: browser_click id: tool_74afc176c10f4dd79037b1302 result: meta=None content=[TextContent(type='text', text="### Ran Playwright code\nawait page.getByRole('button', { name: 'Search' }).click();\n### Page\n- Page URL: https://hkgx.com.hk/en/marketdata/pricehistory;jsessionid=-61AZx-98mAc68CPzVmJWQDoLCFCndodIRgoH6qe\n- Page Title: HKGX\n### Snapshot\n```yaml\n\n```", annotations=None, meta=None)] structuredContent=None isError=False [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<6adb8285>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 5 Achieved: False Thinking: I have navigated to the Hong Kong Gold Exchange website, hovered over 'Market & Data', clicked the 'Price History' link, selected 'RMB Kilo Gold', and clicked the search button. The recent gold price data for RMB-denominated kilo gold is visible and includes values for dates around January 2026. However, I have not yet provided a summary of the recent gold price trends or closed the browser. Therefore, the final task steps remain to be completed. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_evaluate id: tool_95d81e5be7b54796be84866b4 arguments: {'function': "() => {\n const rows = Array.from(document.querySelectorAll('table tr'));\n const prices = rows.slice(1, 6).map(row => {\n const cells = row.querySelectorAll('td');\n return {\n date: cells[0]?.textContent.trim(),\n open: cells[1]?.textContent.trim(),\n high: cells[2]?.textContent.trim(),\n low: cells[3]?.textContent.trim(),\n close: cells[4]?.textContent.trim(),\n benchmarkPrice: cells[5]?.textContent.trim(),\n };\n });\n return prices;\n}"} [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_evaluate>-<tool_95d81e5be7b54796be84866b4>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_evaluate>-<tool_95d81e5be7b54796be84866b4>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<3a1c1d46>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_evaluate>-<tool_95d81e5be7b54796be84866b4>] triggers [collect_results-<3a1c1d46>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_evaluate id: tool_95d81e5be7b54796be84866b4 result: meta=None content=[TextContent(type='text', text='### Result\n[\n {\n "date": "2026-01-26",\n "open": "1121.43",\n "high": "1142.14",\n "low": "1120.03",\n "close": "-",\n "benchmarkPrice": "1134.15"\n },\n {\n "date": "2026-01-23",\n "open": "-",\n "high": "0.00",\n "low": "0.00",\n "close": "-",\n "benchmarkPrice": "-"\n },\n {\n "date": "2026-01-22",\n "open": "1077.35",\n "high": "1105.64",\n "low": "1068.54",\n "close": "1105.24",\n "benchmarkPrice": "1073.00"\n },\n {\n "date": "2026-01-21",\n "open": "1065.21",\n "high": "1093.60",\n "low": "1063.93",\n "close": "1080.88",\n "benchmarkPrice": "1084.50"\n }\n]\n### Ran Playwright code\nawait page.evaluate(\'() => {\\n const rows = Array.from(document.querySelectorAll(\\\'table tr\\\'));\\n const prices = rows.slice(1, 6).map(row => {\\n const cells = row.querySelectorAll(\\\'td\\\');\\n return {\\n date: cells[0]?.textContent.trim(),\\n ... [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<3a1c1d46>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 6 Achieved: False Thinking: I have successfully navigated to the Hong Kong Gold Exchange website, accessed the Price History page, selected RMB-denominated kilo gold, and retrieved recent gold price data for several dates in January 2026. I extracted key details like open, high, low, and benchmark prices. However, I have not yet closed the browser or provided a summary of the recent gold price trends as required. Therefore, the primary data has been gathered but the final summarization and closure steps remain. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection Tool 1: browser_close id: tool_34e03cbac741453eb6ff33e7a arguments: {} LLM Response: I have obtained the recent gold price data for RMB-denominated kilo gold from the Hong Kong Gold Exchange website. The next logical step is to close the browser and provide a summary of the recent gold price trends as per the task goal. Tools to use next: 1. Close the browser using functions.browser_close. 2. Provide a summary of the recent gold price trends based on the extracted data. I will proceed with closing the browser first. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [tool-<browser_close>-<tool_34e03cbac741453eb6ff33e7a>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [tool-<browser_close>-<tool_34e03cbac741453eb6ff33e7a>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [collect_results-<ed448c42>] [ReCentAutoma]-[ReCentAutoma-7708d76f] [tool-<browser_close>-<tool_34e03cbac741453eb6ff33e7a>] triggers [collect_results-<ed448c42>] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ฉ Tool Results Tool 1: browser_close id: tool_34e03cbac741453eb6ff33e7a result: meta=None content=[TextContent(type='text', text='### Result\nNo open tabs. Navigate to a URL to create one.\n### Ran Playwright code\nawait page.close()', annotations=None, meta=None)] structuredContent=None isError=False [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] [collect_results-<ed448c42>] triggers [observe] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ Observation Iteration: 7 Achieved: False Thinking: The assistant successfully navigated to the Hong Kong Gold Exchange website, accessed the Price History page under the 'Market & Data' menu, selected the RMB-denominated kilo gold option, clicked search, and retrieved recent gold price data including open, high, low, and benchmark prices for several recent dates. The browser was then closed. However, the assistant did not explicitly provide a summarized overview of the recent gold price trends before closing the browser. Therefore, although the core data retrieval steps were completed, the final summarization step is missing. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [select_tools, compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [select_tools] [ReCentAutoma]-[ReCentAutoma-7708d76f] [observe] triggers [compress_memory] [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐งญ Memory Check Compression Needed: False [ReCentAutoma]-[ReCentAutoma-7708d76f] ๐ง Tool Selection (No tools selected) LLM Response: The browser has been successfully closed, and I have the recent gold price data extracted. No further browsing actions are needed. Next, I will provide a summary of the recent gold price trends for RMB-denominated kilo gold based on the extracted data. This step does not require a tool and can be done directly in the response. Summary of recent gold price trends: - On 2026-01-26, the benchmark price was 1134.15 with an open price of 1121.43 and a high of 1142.14. - On 2026-01-22, the benchmark price was 1073.00 with an open price of 1077.35, high of 1105.64, low of 1068.54, and close of 1105.24. - On 2026-01-21, the benchmark price was 1084.50 with an open price of 1065.21, high of 1093.60, low of 1063.93, and close of 1080.88. - Data for 2026-01-23 was incomplete or missing. Overall, the recent gold prices showed some fluctuation but a general upward trend between January 21 and January 26, 2026. [ReCentAutoma]-[ReCentAutoma-7708d76f] [__dynamic_step__] driving [finalize_answer] [ReCentAutoma]-[ReCentAutoma-7708d76f] [select_tools] triggers [finalize_answer] [ReCentAutoma]-[ReCentAutoma-7708d76f] is finished. Final Result: Based on the information gathered from the Hong Kong Gold Exchange (HKGX) website (https://hkgx.com.hk/en), here is a summary of the recent gold price trends for RMB-denominated kilo gold: 1. Navigational Steps: - Accessed the HKGX homepage. - Hovered over the 'Market & Data' menu to reveal additional options. - Selected and clicked on the 'Price History' option to open the historical prices page. - Chose the "RMB Kilo Gold" product option for the current date range. - Clicked the search button to retrieve recent historical price data. 2. Recent Gold Price Data for RMB-denominated Kilo Gold (Selected Dates in January 2026): | Date | Open | High | Low | Close | Benchmark Price | |------------|----------|----------|----------|----------|-----------------| | 2026-01-26 | 1121.43 | 1142.14 | 1120.03 | - | 1134.15 | | 2026-01-23 | - | 0.00 | 0.00 | - | - | | 2026-01-22 | 1077.35 | 1105.64 | 1068.54 | 1105.24 | 1073.00 | | 2026-01-21 | 1065.21 | 1093.60 | 1063.93 | 1080.88 | 1084.50 | 3. Observations and Trends: - The benchmark price on January 26, 2026, was 1134.15 RMB per kilo, reflecting an increase compared to previous dates. - From January 21 to January 26, prices opened around 1065 to 1121 RMB and showed upward movement with highs reaching above 1142 RMB. - Some missing or zero values around January 23 possibly indicate non-trading days or unavailable data. - Overall, there is a general upward trend in the benchmark prices and daily highs over the few recorded days in late January 2026. In conclusion, the RMB-denominated kilo gold prices on the Hong Kong Gold Exchange have shown an upward trend in the past few days of January 2026, with the latest benchmark price around 1134.15 RMB per kilo as of January 26, 2026. This reflects strengthening price momentum within this timeframe. If you need gold price data for other denominations, dates, or require ongoing updates, you can use the HKGX Price History page to explore as needed. โ Connection closed: True
In this example, the agent autonomously uses a browser to navigate to the Hong Kong Gold Exchange website and search for the gold price. The entire execution process is fully recorded during the execution of ReCentAutoma (as shown above).
Because we launched the Playwright MCP Server with the --save-video option, a recording of the session is saved after execution. The entire browser operation can be viewed in the following video:
Build a Multi-Agent System with ReCentAutomaยถ
Bridgicโs component-based architecture makes it a natural choice for building Multi-Agent systems.
Because ReCentAutoma itself is an Automa (and also a Worker), it can be flexibly nested and combined with other automas. This allows you to create hierarchical agentic systems, where each agent manages its own goals, tools, and memory independently. There are two common methods for building a Multi-Agent system:
- Utilizing a
ReCentAutomainstance as a nested worker, allowing for flexible and customized dynamic routing - Integrating
ReCentAutomaas a kind of tool, enabling intelligent and context-aware parameter filling
More articles on this topic will be published in the near future.