This system allows you to create autonomous web agents using Puppeteer and large language models. It features a dynamic prompt management system that can generate detailed web automation instructions from simple natural language commands.
- Dynamic Prompt Generation: Turn simple commands into detailed step-by-step instructions
- Task Classification: Automatically categorize user requests and extract parameters
- Template Management: Organize and manage prompt templates for different tasks
- Prompt Repository: Store and retrieve generated prompts
- Multiple Task Types: Support for shopping, search, media, and more
- Browserbase Integration: Option to use Browserbase for cloud-based browser automation
- Clone the repository
- Install dependencies:
npm install - Copy the
.env.exampleto.envand fill in your API keys:cp .env.example .env - Build the TypeScript code:
npm run build
Start the agent with a local Chrome instance:
npx ts-node client.ts
Start the agent with Browserbase cloud browser:
npm run browserbase
or
npx ts-node client.ts --browserbase
The interactive CLI will guide you through:
- Generating detailed instructions from simple commands
- Viewing available templates
- Managing previously generated prompts
This project supports Browserbase for cloud-based browser automation. Browserbase provides:
- Cloud-based Chromium instances
- Anti-detection fingerprinting
- Proxy support
- Captcha solving
To use Browserbase:
-
Set the following environment variables in your
.envfile:BROWSERBASE_API_KEY=your_api_key BROWSERBASE_PROJECT_ID=your_project_id USE_BROWSERBASE=true -
Or run with the
--browserbaseflag:npx ts-node client.ts --browserbase
You can view your Browserbase sessions at: https://browserbase.com/sessions
/src- TypeScript source code/prompts- Prompt generation and templating/storage- File storage and retrieval/utils- Utility functions including LLM client/agent- Agent execution logic (future)
/templates- Prompt templates/system- System prompts/tasks- Task-specific templates/generated- Generated detailed instructions
/config- Configuration files
Create your own templates in the /templates directory. Use the {{variable}} syntax for dynamic content. For example:
I need to search for information about {{query}} and collect the results.
Please provide detailed step-by-step instructions for...
Then define the task in /config/tasks.json.
ANTHROPIC_API_KEY- API key for the Claude AI modelBROWSERBASE_API_KEY- API key for BrowserbaseBROWSERBASE_PROJECT_ID- Project ID for BrowserbaseUSE_BROWSERBASE- Set to "true" to use Browserbase instead of local ChromeAGENT_MODE- Set to "interactive" or "execute"AGENT_INSTRUCTIONS_PATH- Path to instructions file for agent mode
MIT