Skip to main content

Romek - AI Agent session management SDK

Project description

Romek

Romek

Persistent auth for AI agents. Works on any site, today.

No website integration required. No OAuth adoption needed. Just secure session management that works.

License: MIT PyPI version Python 3.8+ Dev.to

Quick StartLangChainn8nHow It WorksRoadmap


The Problem

# What every agent developer does today
cookies = {"session_id": "abc123..."}  # Hardcoded. Breaks constantly. Security nightmare.

Sessions expire. Cookies leak into git history. No audit trail. No access control.

The Solution

from romek import Vault

vault = Vault()
cookies = vault.get_session("linkedin.com")  # Encrypted. Scoped. Audited.
pip install romek

Works on sites as they exist today. No website changes. No OAuth adoption. No waiting for the ecosystem.


See It In Action

One command to grab cookies from Chrome

Agent automatically authenticates using stored session—no manual login, no hardcoded cookies.


How It Works

  1. Log into any site in Chrome (you probably already are)
  2. Run romek grab <domain> — cookies are encrypted and stored locally
  3. Your agent retrieves them securely on-demand

No extension required. No copy-paste. One command.


Quick Start

pip install romek
romek grab linkedin.com

That's it. Your LinkedIn session is now stored in an encrypted vault.

The grab command reads cookies directly from Chrome—no extension needed, no manual export.

from romek import Vault

vault = Vault()
cookies = vault.get_session("linkedin.com")

# Use with requests, Playwright, or any HTTP library
import requests
response = requests.get("https://linkedin.com/feed", cookies=cookies)

Works with any site you're logged into:

romek grab github.com
romek grab notion.so
romek grab twitter.com

Multiple Chrome Profiles

If you use multiple Chrome profiles, specify which one to grab from:

romek grab linkedin.com --profile "Profile 1"
romek grab github.com --profile "Work"

To find your profile names:

# Mac
ls ~/Library/Application\ Support/Google/Chrome/

# Linux
ls ~/.config/google-chrome/

# Windows
dir %LOCALAPPDATA%\Google\Chrome\User Data\

Default profile is used if no --profile flag is specified.


☁️ Remote Servers (VPS / Headless / Docker)

Running n8n or scripts on a server without Chrome? Sync your local session:

On your local machine:

romek grab linkedin.com
romek export

Copy to server:

scp ~/.romek/vault-export.enc user@your-server:~/

On your server:

pip install romek
romek import ~/vault-export.enc

Your server can now access your authenticated sessions.


Why Romek?

Without Romek With Romek
Hardcoded cookies in code Encrypted vault storage
Sessions in git history Secrets separate from code
Any code can access anything Scoped access per agent
No idea what accessed what Full audit logging
Sessions break silently Expiration notifications

LangChain Integration

from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent, AgentType
from romek.langchain import get_romek_tools

tools = get_romek_tools(
    agent_name="sales-bot",
    vault_password="your-vault-password"  # Password auto-retrieved from system keyring if not provided
)

llm = ChatOpenAI(model="gpt-4", temperature=0)
agent = initialize_agent(
    tools=tools,
    llm=llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)

# Agent automatically uses stored sessions
response = agent.run("Get my LinkedIn notifications")

Available tools:

  • authenticated_request — Make HTTP requests with stored session cookies
  • get_session_cookies — Retrieve cookies for custom requests

n8n Integration

Use Romek in your n8n workflows with our community node.

npm install n8n-nodes-romek

The node lets you:

  • Store and retrieve session cookies in n8n workflows
  • Use authenticated sessions with HTTP Request nodes
  • Build automation flows that require login

📦 View on npm | GitHub


Playwright Integration

from playwright.sync_api import sync_playwright
from romek import Vault

vault = Vault()
cookies = vault.get_session("github.com")

with sync_playwright() as p:
    browser = p.chromium.launch()
    context = browser.new_context()
    context.add_cookies(cookies)
    
    page = context.new_page()
    page.goto("https://github.com/notifications")
    # Already authenticated!

CLI Reference

Command Description
romek grab <domain> Grab cookies from Chrome
romek grab <domain> --profile "Name" Grab from specific Chrome profile
romek list List all stored sessions
romek delete <domain> Delete a stored session
romek refresh <domain> Re-grab cookies for a domain
romek export Export vault for remote server
romek import <file> Import vault on remote server
romek version Show current version
romek status Check vault health and stats

Security

  • AES-256 encryption with PBKDF2 key derivation (100k iterations)
  • Ed25519 keypairs for agent identity
  • Scoped access — agents only access approved domains
  • Audit logging — every access logged with timestamp
  • SQLite storage — encrypted database at ~/.romek/vault.db

Roadmap

  • Chrome extension for cookie export (replaced by grab command)
  • Encrypted local vault
  • Direct Chrome cookie extraction (romek grab)
  • Playwright integration
  • LangChain integration
  • n8n integrationn8n-nodes-romek
  • Firefox extension
  • Selenium examples
  • Cloud vault sync

Examples

Working demos available in the examples/ folder.

GitHub Agent Demo

Setup:

# 1. Create the agent
romek create-agent github-agent --scopes github.com

# 2. Grab cookies from Chrome
romek grab github.com

# 3. Your session is now stored and ready to use

Run:

PYTHONPATH=. python examples/github_agent.py

Contributing

PRs welcome. Check out the issues for feature requests.


License

MIT

Star us if Romek helps your agents authenticate!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

romek-0.3.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

romek-0.3.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file romek-0.3.0.tar.gz.

File metadata

  • Download URL: romek-0.3.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for romek-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c35ed5b2c1f11746dc04852b20b0a5f4a44f185dbc80b65e0b87ceb532dc99ff
MD5 ce7be43b904824d8d6634b570f9c6284
BLAKE2b-256 f5e66af2e5da3ea2d6cf077263e55e2be1b134cb86aa09ea38e02a76612303e8

See more details on using hashes here.

File details

Details for the file romek-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: romek-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for romek-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c07ce513dde11b7596f914844559f94339b616fcc7b4b79e4157082de57b0ee3
MD5 85fe8b0fab43bbadd1ce7ff05855950f
BLAKE2b-256 2126433ea7a7a69ea678a66871cb5607baaec5bab989d60a456388b630f9807b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page