Skip to content

Your lightweight open-source personal agent.

feat: added runtime environment summary to system prompt

Shukfan Law22156d3a4088
diff --git a/nanobot/agent/context.py b/nanobot/agent/context.py
index f70103dcc..3c95b6624 100644
--- a/nanobot/agent/context.py
+++ b/nanobot/agent/context.py
@@ -2,6 +2,7 @@
import base64
import mimetypes
+import platform
from pathlib import Path
from typing import Any
@@ -74,6 +75,7 @@ Skills with available="false" need dependencies installed first - you can try in
from datetime import datetime
now = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")
workspace_path = str(self.workspace.expanduser().resolve())
+ runtime_summary = self._get_runtime_environment_summary()
return f"""# nanobot 🐈
@@ -87,6 +89,9 @@ You are nanobot, a helpful AI assistant. You have access to tools that allow you
## Current Time
{now}
+## Runtime Environment
+{runtime_summary}
+
## Workspace
Your workspace is at: {workspace_path}
- Memory files: {workspace_path}/memory/MEMORY.md
@@ -99,6 +104,19 @@ For normal conversation, just respond with text - do not call the message tool.
Always be helpful, accurate, and concise. When using tools, explain what you're doing.
When remembering something, write to {workspace_path}/memory/MEMORY.md"""
+
+ def _get_runtime_environment_summary(self) -> str:
+ system = platform.system()
+ system_map = {"Darwin": "MacOS", "Windows": "Windows", "Linux": "Linux"}
+ system_label = system_map.get(system, system)
+ release = platform.release()
+ machine = platform.machine()
+ python_version = platform.python_version()
+ node = platform.node()
+ return (
+ f"Runtime environment: OS {system_label} {release} ({machine}), "
+ f"Python {python_version}, Hostname {node}."
+ )
def _load_bootstrap_files(self) -> str:
"""Load all bootstrap files from workspace."""