serverMemory

You can make your `Functions` step remember information between runs when it is used inside a Copilot with Memory enabled.

Why do we need memory

- Your function can read saved memory

- Your function can update saved memory

- Changes are saved after the function finishes

How it works

1. In your Copilot, enable a Gooey Memory tool.

2. Add a `Functions` workflow step/hook to that same bot.

3. Run the bot as usual.

If Memory is enabled on the bot, your function will automatically receive it.

Try these examples:

How to use it in JavaScript

Use the global GOOEY_MEMORY object.

How to use it in Python

Use the global `GOOEY_MEMORY` object.

Deleting a memory value (optional)

JavaScript:

Python:

Good use cases

- Save a user’s name

- Save a preferred language

- Save the last selected option

- Save the last topic discussed

- Save a last-seen timestamp

- Save simple flags like onboarding_complete = true

Important notes

- Memory is only available automatically when the function is run from a copilot with Memory enabled.

- Changes are saved after the function completes.

- This memory works best for “latest value” style data (for example, last seen time, preferences, or status flags).

Troubleshooting

- If GOOEY_MEMORY seems empty, make sure the Copilot Memory Integration is enabled.

- If changes are not saved, check whether the function run failed with an error.

Last updated

Was this helpful?