How Profiles Work
A profile is a saved snapshot of a browser’s user data directory. By default, each Notte session uses a fresh browser state to ensure isolation. When you create a profile and use it in a session withpersist=True, Notte saves that session’s browser state. You can then attach the profile to future sessions to restore the saved state.
Create a Profile
Create a profile to store browser state. Optionally, give it a name to keep track of different profiles:create_profile.py
Use a Profile in a Session
Attach a profile to a session to load saved browser state:use_profile.py
Persist Changes
Thepersist parameter controls whether session changes are saved back to the profile:
True- Save browser state to the profile when the session endsFalse(default) - Use the profile as read-only; don’t save changes
Set
persist=True the first time you use a new profile to save the initial browser state. After that, you can use persist=False to reuse the profile without modifying it.Profile Login Example
Step 1: Login and Save to Profile
First, create a profile and perform a login. When the session ends withpersist=True, all cookies and browser state are saved to the profile:
persist_profile.py
Step 2: Reuse the Saved Profile
Use the saved profile in a new session. The browser automatically loads the saved state, so you’re already authenticated:reuse_profile.py
- A new session is created using the same profile ID
- The browser loads saved cookies and state from the profile
- You navigate directly without needing to log in again
- The session picks up right where the previous one left off
This pattern is useful for:
- Avoiding repeated logins across automation runs
- Testing authenticated user flows
- Managing multiple accounts with separate profiles
- Maintaining session state over time
Using Profiles with Agents
Profiles work seamlessly with Notte Agents. An agent running with a pre-authenticated profile can access authenticated resources immediately:profile_with_agent.py
Managing Profiles
List Profiles
Retrieve all your profiles with optional filtering:list_profiles.py
Get Profile Details
Retrieve information about a specific profile:get_profile.py
Delete a Profile
Delete a profile when you no longer need it:delete_profile.py
Read-Only Profile Usage
Load a profile without saving changes by settingpersist=False:
use_profile.py
- Test workflows without affecting saved state
- Run parallel sessions with the same profile safely
- Maintain a clean baseline profile for repeated use
By default,
persist is False, so you don’t have to explicitly specify it for read-only access.Best Practices
Profile Management
- Use descriptive names to identify profiles by their purpose (e.g.,
github-login,twitter-bot-1) - Create separate profiles for different accounts or services
- Periodically verify that saved sessions are still valid
Security
- Profiles contain sensitive session data; treat profile IDs as secrets
- Delete profiles for accounts that are no longer needed
- Use separate profiles for production and development environments
Performance
- Profiles with large caches may take longer to load
- Consider creating fresh profiles periodically if performance degrades
Comparison: Profiles vs Cookies
| Feature | Profiles | Cookies |
|---|---|---|
| Scope | Full browser state (cookies, storage, cache) | Cookies only |
| Storage | Managed by Notte | JSON file you manage |
| Persistence | Automatic on session end | Manual export/import |
| Use case | Long-term state preservation | Quick cookie injection |

