In this quickstart, you’ll build an AI agent that can search the web and analyze images. Let’s dive in!
1

Install Slide

2

Set Up Your API Key

Your agent needs an API key to use the LLM. Choose your provider:
Create your API key from platform.openai.com then add it to your environment:
export OPENAI_API_KEY="sk-..."
For production, use a .env file. If you choose this approach:
  1. Install python-dotenv: uv add python-dotenv or pip install python-dotenv
  2. Create a .env file with your API keys
  3. Uncomment the dotenv import lines in the code example below
3

Create Your Agent

Create a file called agent.py:
# Optional: If you're using a .env file for API keys, uncomment these lines
# from dotenv import load_dotenv
# load_dotenv()

import asyncio
from tyler import Agent, Thread, Message
from lye import WEB_TOOLS, IMAGE_TOOLS, FILES_TOOLS

# Optional: Uncomment these lines if you want observiabiltiy with W&B Weave
# import weave
# weave.init("wandb-designers/my-agent")

async def main():
    # Create your agent
    agent = Agent(
        name="research-assistant",
        model_name="gpt-4o",  # Use the model for your API key provider
        purpose="To help with research and analysis tasks",
        tools=[
            *WEB_TOOLS,      # Can search and fetch web content
            *IMAGE_TOOLS    # Can analyze and describe images
        ]
    )

    # Create a conversation thread
    thread = Thread()
    
    # Add your request
    message = Message(
        role="user",
        content="Search for information about the Mars Perseverance rover and create a summary"
    )
    thread.add_message(message)
    
    # Let the agent work
    print("🤖 Agent is working...")
    result = await agent.go(thread)
    
    # Print the results
    print(f"\n💬 Assistant: {result.content}")

if __name__ == "__main__":
    asyncio.run(main())
4

Run Your Agent

uv run agent.py
Your agent will search for information about the Mars rover and create a summary. That’s it! 🎉

What’s Next?

Now that you have a working agent, explore these guides to add more capabilities:

Deploy Your Agent

Troubleshooting