Skip to main content

Settings

The Settings class manages user preferences and platform configuration.

Retrieving settings

import agentflow as af

settings = await af.Settings.get()

print(settings)
# {"default_agent": "MainAgent", "timezone": "America/New_York", ...}

Updating settings

await af.Settings.update({
    "default_agent": "SalesAgent",
    "timezone": "America/Chicago",
    "language": "en",
})

Resetting to defaults

await af.Settings.reset()

Viewing defaults

defaults = await af.Settings.get_defaults()
print(defaults)

Memory

The Memory class provides access to persistent memory blocks — structured data the agent retains across conversations to personalize responses.

Listing memory blocks

blocks = await af.Memory.list_blocks()

for block in blocks:
    print(f"{block['type']}: {block['content'][:80]}...")

Retrieving a block

block = await af.Memory.get_block("user_preferences")
print(block["content"])
# "Prefers concise answers. Uses metric units. Timezone: PST."

block = await af.Memory.get_block("learned_facts")
print(block["content"])
# "Works at Acme Corp. Reports to Jane Smith. Manages a team of 12."

Updating a block

await af.Memory.update_block(
    "user_preferences",
    content="Prefers concise answers. Uses metric units. Timezone: EST.",
)

Deleting a block

await af.Memory.delete_block("learned_facts")