Overview • Features • Prerequisites • Installation • Usage • Functions • License
BrandOS is a Python script that utilizes the Anthropic API and You Web LLM Search to monitor, analyze, and suggest actions for a brand to maintain unique differentiation. This project is based on Maestro by Doriandarko.
BrandOS contains the code and instructions needed to build a sophisticated brand monitoring and analysis tool that leverages the capabilities of Anthropic API and You Web LLM Search. Designed to efficiently break down objectives into sub-tasks, generate prompts for sub-agents, and refine the results into a cohesive final output, this project is an ideal starting point for developers interested in brand management and natural language processing.
- Utilizes the Anthropic API for natural language processing and generation
- Integrates with the You Web LLM Search API for QnA search functionality
- Breaks down the objective into sub-tasks using an orchestrator
- Generates prompts for sub-agents to execute the sub-tasks
- Refines the sub-task results into a cohesive final output
- Provides a list of competitors, keyword search terms to monitor, and suggested actions for the brand
- Saves the full exchange log to a Markdown file
Before running the script, make sure you have the following:
- Python 3.x installed
- Required Python packages:
os
,re
,json
,dotenv
,anthropic
,rich
,datetime
- Anthropic API key (stored in a
.env
file asANTHROPIC_API_KEY
) - You Web LLM Search API key (stored in a
.env
file asYou Web LLM Search_API_KEY
)
-
Clone the repository or download the script file.
-
Install the required Python packages by running the following command:
pip install os re json dotenv anthropic You Web LLM Search rich datetime
-
Create a
.env
file in the same directory as the script and add your Anthropic and You Web LLM Search API keys:ANTHROPIC_API_KEY=your_anthropic_api_key You Web LLM Search_API_KEY=your_You Web LLM Search_api_key
-
Run the script using the following command:
python brandos.py
-
When prompted, enter the following information about the brand:
- Brand URL
- Brand mission
- Brand vision
- Brand values
-
Choose whether you want to use search functionality by entering 'y' or 'n'.
-
The script will start the process of monitoring, analyzing, and suggesting actions for the brand. It will break down the objective into sub-tasks, generate prompts for sub-agents, and refine the results.
-
The final output will be displayed in the console, including a list of competitors, keyword search terms to monitor, and suggested actions for the brand.
-
The full exchange log will be saved to a Markdown file with a timestamp and the sanitized brand name.
calculate_subagent_cost(model, input_tokens, output_tokens)
: Calculates the cost of a sub-agent based on the model and token usage.opus_orchestrator(brand_info, previous_results=None, use_search=False)
: Calls the orchestrator to break down the objective into sub-tasks and generate prompts for sub-agents.haiku_sub_agent(prompt, search_query=None, previous_haiku_tasks=None, continuation=False)
: Calls the sub-agent to execute a sub-task based on the provided prompt and search query.opus_refine(brand_info, sub_task_results, filename, continuation=False)
: Calls Opus to review and refine the sub-task results into a cohesive final output.
BrandOS is open-source and licensed under MIT.