Date & Time Integration

Date & Time Integration

The Date & Time integration provides your agent with awareness of the current date, time, and timezone. This is critical for any agent that needs to schedule appointments, check deadlines, or simply know "now".

Usage

Enable the integration when initializing your agent:

agent = Agent(
    # ...
    date_time=True
)

Functionality

When enabled, this integration:

  1. Injects Logic: A lightweight tool or context injector that allows the agent to query the current time.
  2. Timezone Support: By default, it uses the server's local time. You can override this using the TIMEZONE environment variable.

Configuration

Set the timezone in your .env file to ensure the agent speaks in the correct time for your users.

TIMEZONE=America/New_York

How logic works

The agent typically receives the current datetime in the system prompt context, ensuring that queries like "is today a weekend?" or "schedule for next Tuesday" are calculated correctly relative to the actual current moment.