Skip to main content
The Workspace feature allows you to configure your agent using an Agents.md file stored in a designated folder. When a workspace is set, the agent reads the configuration file and includes it in the system prompt, and can generate a dynamic greeting message at the start of each session.

Overview

When you set a workspace path on an Agent:
  1. Configuration Loading: The agent reads the Agents.md file from the workspace folder and includes it in the system prompt
  2. Session Greeting: You can call execute_workspace_greeting() to generate a personalized greeting based on the configuration

Example

from upsonic import Agent, Task

# Create an agent with workspace
agent = Agent(
    "openai/gpt-4o",
    workspace="/path/to/my_agent_folder",
    session_id="user_session_001"
)

# Execute the workspace greeting (optional, for new sessions)
greeting = agent.execute_workspace_greeting()
print(greeting)

# Run tasks - the Agents.md content is included in the system prompt
task = Task("What can you help me with?")
result = agent.do(task)
print(result)

The AGENTS.md File

Create an AGENTS.md file in your workspace folder to define your agent’s behavior. We provide a ready-to-use template with memory management, safety rules, group chat guidelines, and more.

AGENTS.md Template

Get the full AGENTS.md template you can copy and customize for your workspace.
The content of this file is automatically injected into the agent’s system prompt wrapped in <AgentConfiguration> tags.

Integration with Interfaces

When using Upsonic interfaces (Telegram, Slack, WhatsApp), the workspace greeting is automatically called when a user resets their session with the /reset command. The greeting response is sent to the user, providing a fresh start with a personalized introduction.