Your First Agent
Start Here to Begin with Beacon Labs
In this example, we will create a sample agent, and in doing so, we will analyze and learn Beacon Labs' fundamental mechanisms.
Agents function as electronic employees that perform tasks on your behalf. By properly utilizing them, you can free up time for high-value tasks instead of spending it on time-consuming, lower-priority activities.
Basic Agent
basic_agent.py
pythonCopyEditfrom beaconlabs import Agent, Task
task = Task("Do an in-depth analysis of US history")
agent = Agent("Historian")
agent.print_do(task)
To run the agent, install dependencies and export your OPENAI_API_KEY.
1. Set Up Your Virtual Environment
Mac / Windows
shCopyEditpython3 -m venv .venv
source .venv/bin/activate
2. Install Dependencies
Mac / Windows
shCopyEditpip install -U beaconlabs
3. Set Up Your OpenAI API Key
.env File
iniCopyEditOPENAI_API_KEY=sk-***
4. Run the Agent to Execute the Task
shCopyEditpython basic_agent.py
✅ You’ve successfully created your first agent with Beacon Labs! 🚀
Last updated