### Run Project Setup and Installation Commands Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/backend-setup.mdx Use these 'just' commands for complete development setup and dependency installation. ```bash just setup # Complete development setup just install # Install all dependencies ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/agentops-ai/agentops/blob/main/app/dashboard/README.md Command to launch the development server after installing dependencies. ```bash bun run dev ``` -------------------------------- ### Documentation Structure Example Source: https://github.com/agentops-ai/agentops/blob/main/app/CONTRIBUTING.md Illustrates the typical directory structure for project documentation, including sections for API, guides, development, deployment, and examples. ```bash docs/ ├── api/ # API reference ├── guides/ # User guides ├── development/ # Developer documentation ├── deployment/ # Deployment guides └── examples/ # Code examples ``` -------------------------------- ### Complete Example with AgentOps Decorators and Initialization Source: https://github.com/agentops-ai/agentops/blob/main/llms.txt A consolidated example demonstrating the initialization of AgentOps with `auto_start_session=False` and the definition of a tool. This setup is suitable for projects where traces are managed manually or via decorators. ```python import agentops from agentops.sdk.decorators import agent, operation, tool, trace from dotenv import load_dotenv import os # Load environment variables load_dotenv() AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY") # Initialize AgentOps. # Set auto_start_session=False because @trace will manage the session. agentops.init(AGENTOPS_API_KEY, auto_start_session=False, tags=["quickstart-complete-example"]) # Define a tool @tool(name="AdvancedSearch", cost=0.02) def advanced_web_search(query: str) -> str: # Simulate a more advanced search return f"Advanced search results for '{query}': [Details...]" ``` -------------------------------- ### Install AgentOps and OpenAI dependencies Source: https://github.com/agentops-ai/agentops/blob/main/examples/openai/README.md Required installation command for running the provided examples. ```bash pip install agentops openai ``` -------------------------------- ### Start AgentOps Dashboard Source: https://github.com/agentops-ai/agentops/blob/main/app/SETUP_GUIDE.md Navigate to the dashboard directory and install dependencies. Then, start the dashboard in development mode using npm or bun. ```bash # In a new terminal, navigate to dashboard directory cd dashboard # Install Node.js dependencies npm install # OR if using bun: bun install # Start the dashboard in development mode npm run dev # OR if using bun: bun run dev ``` -------------------------------- ### Start Development Servers Source: https://github.com/agentops-ai/agentops/blob/main/app/CONTRIBUTING.md Methods for starting the API and frontend services. ```bash # Option 1: Use just commands (recommended) just api-run # Start API server just fe-run # Start frontend (in another terminal) # Option 2: Manual startup cd api && uv run python run.py & cd dashboard && bun dev & ``` -------------------------------- ### Install and Run Dashboard Manually Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/native-development.mdx Commands to install dependencies and start the dashboard development server using bun, npm, or yarn. ```bash cd dashboard # Using bun bun install bun dev # Using npm npm install npm run dev # Using yarn yarn install yarn dev ``` -------------------------------- ### Run Frontend Dashboard Development Server Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Starts the development server for the frontend dashboard using the 'just' command. Ensure you have completed setup within the 'dashboard/' directory first. ```bash just dash ``` -------------------------------- ### Clone and Setup AgentOps Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/docker-guide.mdx Clones the AgentOps repository and sets up initial environment files. Ensure Docker and Git are installed. ```bash git clone https://github.com/AgentOps-AI/AgentOps.Next.git cd AgentOps.Next/app # Copy environment files cp .env.example .env cp api/.env.example api/.env cp dashboard/.env.example dashboard/.env.local ``` -------------------------------- ### Initialize AgentOps SDK Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/introduction.mdx Basic setup required to start tracking sessions in the AgentOps dashboard. ```python import agentops agentops.init() ``` -------------------------------- ### Execute LlamaIndex example Source: https://github.com/agentops-ai/agentops/blob/main/examples/llamaindex/README.md Run the provided Python script or Jupyter notebook to start the session. ```bash python llamaindex_example.py ``` ```bash jupyter notebook llamaindex_example.ipynb ``` -------------------------------- ### Initialize and Start Supabase Source: https://github.com/agentops-ai/agentops/blob/main/docs/local_supabase_linux.md Initialize the Supabase project and start the local services. ```bash cd ~/repos/agentops/app supabase init supabase start ``` -------------------------------- ### Verify Local Setup (Dashboard and ClickHouse) Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md After running an example, verify the trace in the AgentOps dashboard and by querying ClickHouse. Replace and with the actual trace identifiers. ```bash - Dashboard: http://localhost:3000/traces?trace_id= ``` ```bash - CH rows: curl -s -u default:password "http://localhost:8123/?query=SELECT%20count()%20FROM%20otel_2.otel_traces%20WHERE%20TraceId%20=%20'' ``` -------------------------------- ### Setup Kubeconfig Source: https://github.com/agentops-ai/agentops/blob/main/app/deploy/jockey/README.md Initialize the Kubeconfig path and run the setup command from the jockey directory. ```bash # From the jockey directory export KUBECONFIG=./config/kubeconfig python -m jockey setup-kubeconfig ``` -------------------------------- ### Install AgentOps and PyAutoGen with Uv Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/ag2.mdx Install the necessary libraries using uv. ```bash uv pip install agentops pyautogen ``` -------------------------------- ### Install Cohere SDK Source: https://github.com/agentops-ai/agentops/blob/main/README.md Install the Cohere Python SDK. ```bash pip install cohere ``` -------------------------------- ### Install AgentOps and OpenAI Agents Libraries Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/openai_agents.mdx Install the necessary libraries using pip, poetry, or uv. Ensure you have AgentOps, openai-agents, and pydotenv installed. ```bash pip install -q agentops openai-agents pydotenv ``` ```bash poetry add -q agentops openai-agents pydotenv ``` ```bash uv pip install -q agentops openai-agents pydotenv ``` -------------------------------- ### Install Dependencies with Uv Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/langgraph.mdx Install LangGraph, Langchain, AgentOps, and python-dotenv using uv. ```bash uv pip install langgraph langchain agentops python-dotenv ``` -------------------------------- ### Install AgentOps and LiteLLM Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/litellm.mdx Install the necessary packages using your preferred package manager. ```bash pip install agentops litellm ``` ```bash poetry add agentops litellm ``` ```bash uv pip install agentops litellm ``` -------------------------------- ### Initial Workflow Setup Source: https://github.com/agentops-ai/agentops/blob/main/app/deploy/jockey/README.md Commands to initialize the environment and configure the builder namespace. ```bash # 1. Initial setup (one-time) source ../api/.venv/bin/activate export KUBECONFIG=./config/kubeconfig # Setup kubeconfig python -m jockey setup-kubeconfig # Setup builder namespace and AWS credentials python -m jockey setup-builder ``` -------------------------------- ### Initialize Environment Configuration Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Copy the example environment file to create a local configuration. ```bash cp app/.env.example app/.env ``` -------------------------------- ### Install Required Packages Source: https://github.com/agentops-ai/agentops/blob/main/examples/xai/grok_vision_examples.ipynb Installs the OpenAI and AgentOps Python packages. Use this command in your environment before running the example. ```python %pip install -U openai %pip install -U agentops ``` -------------------------------- ### Initialize Environment Files Source: https://github.com/agentops-ai/agentops/blob/main/app/CONTRIBUTING.md Copying example environment files to local configuration files. ```bash cp .env.example .env cp api/.env.example api/.env cp dashboard/.env.example dashboard/.env.local ``` -------------------------------- ### Install AgentOps and Anthropic Libraries Source: https://github.com/agentops-ai/agentops/blob/main/examples/anthropic/anthropic-example-async.ipynb Install the necessary Python libraries for AgentOps and Anthropic. This is a prerequisite for running the example. ```python %pip install agentops %pip install anthropic ``` -------------------------------- ### Install AgentOps, Anthropic, and python-dotenv Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/anthropic.mdx Install the necessary libraries using pip, poetry, or uv. ```bash pip install agentops anthropic python-dotenv ``` ```bash poetry add agentops anthropic python-dotenv ``` ```bash uv pip install agentops anthropic python-dotenv ``` -------------------------------- ### Initialize Environment Variables Source: https://github.com/agentops-ai/agentops/blob/main/app/dashboard/README.md Copy the example environment file to create a local configuration file. ```bash cp .env.example .env.local ``` -------------------------------- ### Advanced LiteLLM Usage Examples Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/litellm.mdx Examples demonstrating streaming responses and multi-provider tracking. ```python import litellm from litellm import completion # Configure LiteLLM to use AgentOps litellm.success_callback = ["agentops"] # Make a streaming completion request response = completion( model="gpt-4", messages=[{"role": "user", "content": "Write a short poem about AI."}], stream=True ) # Process the streaming response for chunk in response: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) print() # Add a newline at the end ``` ```python import litellm from litellm import completion # Configure LiteLLM to use AgentOps litellm.success_callback = ["agentops"] # OpenAI request openai_response = completion( model="gpt-4", messages=[{"role": "user", "content": "What are the advantages of GPT-4?"}] ) print("OpenAI Response:", openai_response.choices[0].message.content) # Anthropic request using the same interface anthropic_response = completion( model="anthropic/claude-3-opus-20240229", messages=[{"role": "user", "content": "What are the advantages of Claude?"}] ) print("Anthropic Response:", anthropic_response.choices[0].message.content) # All requests across different providers are automatically tracked by AgentOps ``` -------------------------------- ### Start API Server Source: https://github.com/agentops-ai/agentops/blob/main/app/SETUP_GUIDE.md Commands to install Python dependencies and start the AgentOps API server. Ensure this terminal remains open while the API is in use. ```bash # Navigate to API directory cd api # Install Python dependencies pip install -e . # Start the API server python run.py The API server should start on http://localhost:8000. Look for these log messages: - INFO: Started server process - INFO: Uvicorn running on http://0.0.0.0:8000 - INFO: Application startup complete **Important**: Keep this terminal open - the API server must remain running. ``` -------------------------------- ### Run Full Project Setup Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/just-commands.mdx Executes the complete development environment setup process. Use this when setting up the project for the first time, after a fresh clone, or to reset the environment. ```bash just setup ``` -------------------------------- ### Copy Example Environment Files Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Copy the example environment files to create your own configuration files for the root and API. ```bash cp .env.example .env cp api/.env.example api/.env ``` -------------------------------- ### Complete AgentOps integration example Source: https://github.com/agentops-ai/agentops/blob/main/llms.txt A full example demonstrating initialization, agent definition, and session execution. ```python import agentops from agentops.sdk.decorators import session, agent, operation # Initialize AgentOps agentops.init() # Create an agent class @agent class MyAgent: def __init__(self, name): self.name = name @operation def perform_task(self, task): # Agent task logic here return f"Completed {task}" # Create a session @session def my_workflow(): # Your session code here agent = MyAgent("research-agent") result = agent.perform_task("data analysis") return result # Run the session my_workflow() ``` -------------------------------- ### Start API and Frontend Servers with Just Commands Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Convenience scripts to start the API server and the frontend development server. ```bash just api-run ``` ```bash just fe-run ``` -------------------------------- ### Start Development Services with Just Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/native-development.mdx Initiate both the API and frontend development servers simultaneously using 'just api-native' and 'just fe-run'. ```bash # Terminal 1 just api-native # Terminal 2 just fe-run ``` -------------------------------- ### Initialize and End AgentOps Session Source: https://github.com/agentops-ai/agentops/blob/main/README.md Basic setup to start and terminate an AgentOps session in a Python program. ```python # Beginning of your program (i.e. main.py, __init__.py) agentops.init( < INSERT YOUR API KEY HERE >) ... # End of program agentops.end_session('Success') ``` -------------------------------- ### Clone AgentOps Repository Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Clone the AgentOps AI repository from GitHub to start the local development setup. ```bash git clone https://github.com/AgentOps-AI/agentops.git ``` -------------------------------- ### CrewAI Job Posting Setup Source: https://github.com/agentops-ai/agentops/blob/main/llms.txt Provides the initial package installation command for setting up CrewAI with tools for job posting applications. ```python # Crew Job Posting # First let's install the required packages # %pip install -U 'crewai[tools]' ``` -------------------------------- ### Quick Start: Create DB and Base Schema Source: https://github.com/agentops-ai/agentops/blob/main/docs/local_clickhouse_setup.md Commands to set up the ClickHouse database and apply the initial schema and UDFs for AgentOps. Ensure ClickHouse is running on the default ports. ```bash curl -u default:password "http://localhost:8123/?query=CREATE%20DATABASE%20IF%20NOT%20EXISTS%20otel_2" ``` ```bash curl -u default:password --data-binary @app/clickhouse/migrations/0000_init.sql "http://localhost:8123/?query=" ``` -------------------------------- ### Start Local Development Server Source: https://github.com/agentops-ai/agentops/blob/main/docs/README.md Run the Mintlify development server from the root of your documentation project. Ensure mint.json is present. ```bash mintlify dev ``` -------------------------------- ### Initialize AgentOps Client Source: https://github.com/agentops-ai/agentops/blob/main/examples/xai/grok_vision_examples.ipynb Initializes the AgentOps client and starts a trace for tracking. The trace is named 'XAI Vision Example' and tagged accordingly. ```python agentops.init(auto_start_session=False) tracer = agentops.start_trace(trace_name="XAI Vision Example", tags=["xai-example", "grok-vision", "agentops-example"]) ``` -------------------------------- ### Configure Environment Files Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/backend-setup.mdx Copy example environment files to local configuration files. ```bash # Root environment (for Docker Compose) cp .env.example .env # API environment cp api/.env.example api/.env # Dashboard environment cp dashboard/.env.example dashboard/.env.local ``` -------------------------------- ### Self-Hosting AgentOps Setup Source: https://context7.com/agentops-ai/agentops/llms.txt Deploy AgentOps on your own infrastructure by cloning the repository, configuring environment files, and starting the services with Docker Compose or native commands. ```bash # Clone the repository git clone https://github.com/AgentOps-AI/AgentOps.Next.git cd AgentOps.Next/app # Copy environment files cp .env.example .env cp api/.env.example api/.env cp dashboard/.env.example dashboard/.env.local # Configure external services (Supabase, ClickHouse) in .env files # Start with Docker Compose docker-compose up -d # Or run natively for development just api-native # Terminal 1: Start API server just fe-run # Terminal 2: Start dashboard ``` -------------------------------- ### Set Up Virtual Environment Source: https://github.com/agentops-ai/agentops/blob/main/CONTRIBUTING.md Commands to create and activate a virtual environment on different operating systems. ```bash python -m venv venv source venv/bin/activate # Unix .\venv\Scripts\activate # Windows ``` -------------------------------- ### Start Local Supabase Instance Source: https://github.com/agentops-ai/agentops/blob/main/app/SETUP_GUIDE.md Initialize and start a local Supabase instance. Save the provided API URL and keys for later configuration. ```bash supabase start ``` -------------------------------- ### Run Backend API in Docker Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Starts the backend API server within a Docker container using the 'just' command. Ensure you have completed setup within the 'api/' directory first. ```bash just api-docker-run ``` -------------------------------- ### OpenAI Sync Example with AgentOps Source: https://github.com/agentops-ai/agentops/blob/main/llms.txt Demonstrates using AgentOps to trace synchronous calls to the OpenAI API for chat completions. Includes setup for API keys, initializing AgentOps, and validating recorded spans. ```python # OpenAI Sync Example # # We are going to create a simple chatbot that creates stories based on a prompt. The chatbot will use the gpt-4o-mini LLM to generate the story using a user prompt. # # We will track the chatbot with AgentOps and see how it performs! # First let's install the required packages # # Install required dependencies # %pip install agentops # %pip install openai # %pip install python-dotenv # Then import them from openai import OpenAI import agentops import os from dotenv import load_dotenv # Next, we'll grab our API keys. You can use dotenv like below or however else you like to load environment variables load_dotenv() os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", "your_openai_api_key_here") os.environ["AGENTOPS_API_KEY"] = os.getenv("AGENTOPS_API_KEY", "your_api_key_here") # Next we initialize the AgentOps client. agentops.init(auto_start_session=True, trace_name="OpenAI Sync Example", tags=["openai", "sync", "agentops-example"]) tracer = agentops.start_trace( trace_name="OpenAI Sync Example", tags=["openai-sync-example", "openai", "agentops-example"] ) client = OpenAI() # And we are all set! Note the seesion url above. We will use it to track the chatbot. # # Let's create a simple chatbot that generates stories. system_prompt = """ You are a master storyteller, with the ability to create vivid and engaging stories. You have experience in writing for children and adults alike. You are given a prompt and you need to generate a story based on the prompt. """ user_prompt = "Write a very short story about a cyber-warrior trapped in the imperial time period." messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ] response = client.chat.completions.create( model="gpt-4o-mini", messages=messages, ) print(response.choices[0].message.content) # The response is a string that contains the story. We can track this with AgentOps by navigating to the trace url and viewing the run. # ## Streaming Version # We will demonstrate the streaming version of the API. stream = client.chat.completions.create( model="gpt-4o-mini", messages=messages, stream=True, ) for chunk in stream: if chunk.choices and len(chunk.choices) > 0: print(chunk.choices[0].delta.content or "", end="") agentops.end_trace(tracer, end_state="Success") # Let's check programmatically that spans were recorded in AgentOps print("\n" + "=" * 50) print("Now let's verify that our LLM calls were tracked properly...") try: result = agentops.validate_trace_spans(trace_context=tracer) agentops.print_validation_summary(result) except agentops.ValidationError as e: print(f"\n❌ Error validating spans: {e}") raise # Note that the response is a generator that yields chunks of the story. We can track this with AgentOps by navigating to the trace url and viewing the run. # All done! ``` -------------------------------- ### Install AgentOps and IBM Watsonx.ai SDK Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/ibm_watsonx_ai.mdx Install the necessary packages using pip, poetry, or uv. ```bash pip install agentops ibm-watsonx-ai ``` ```bash poetry add agentops ibm-watsonx-ai ``` ```bash uv pip install agentops ibm-watsonx-ai ``` -------------------------------- ### Function Calling Example with Agent Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/openai_agents_python.mdx Shows how to define a function tool and use it within an agent. The agent can then call this tool to get specific information, like weather data. Requires agentops initialization. ```python import asyncio from agents import Agent, Runner, function_tool import agentops import os agentops.init() @function_tool def get_weather(city: str) -> str: return f"The weather in {city} is sunny." agent = Agent( name="Weather Agent", instructions="You are a helpful agent that can get weather information.", tools=[get_weather], ) async def main(): result = await Runner.run(agent, input="What's the weather in Tokyo?") print(result.final_output) # Expected Output: The weather in Tokyo is sunny. if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Clone and Navigate Repository Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/backend-setup.mdx Initial steps to clone the repository and enter the application directory. ```bash git clone https://github.com/AgentOps-AI/AgentOps.Next.git cd AgentOps.Next/app ``` -------------------------------- ### Install AgentOps and Xpander SDK Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/xpander.mdx Install AgentOps and the Xpander SDK along with necessary dependencies using pip, poetry, or uv. ```bash pip install agentops xpander-sdk xpander-utils openai python-dotenv loguru ``` ```bash poetry add agentops xpander-sdk xpander-utils openai python-dotenv loguru ``` ```bash uv add agentops xpander-sdk xpander-utils openai python-dotenv loguru ``` -------------------------------- ### Test AgentOps Trace Generation Source: https://github.com/agentops-ai/agentops/blob/main/app/SETUP_GUIDE.md Configure AgentOps environment variables for local setup and then initialize AgentOps, start a trace, simulate work, and end the trace. This script verifies basic trace generation functionality. ```python #!/usr/bin/env python3 import agentops import os import time # Configure AgentOps for local setup os.environ["AGENTOPS_API_KEY"] = "6b7a1469-bdcb-4d47-85ba-c4824bc8486e" # From seed data os.environ["AGENTOPS_API_ENDPOINT"] = "http://localhost:8000" os.environ["AGENTOPS_APP_URL"] = "http://localhost:3000" os.environ["AGENTOPS_EXPORTER_ENDPOINT"] = "http://localhost:4318/v1/traces" def test_agentops_trace(): """Test AgentOps trace generation""" try: print("🚀 Starting AgentOps trace test...") agentops.init(auto_start_session=True, trace_name="Test Trace", tags=["local-test"]) print("✓ AgentOps initialized successfully") tracer = agentops.start_trace(trace_name="Test Trace", tags=["test"]) print("✓ Trace started successfully") print("📝 Simulating work...") time.sleep(2) agentops.end_trace(tracer, end_state="Success") print("✓ Trace ended successfully") print("\n🎉 AgentOps trace test completed successfully!") print("🖇 Check the AgentOps output above for the session replay URL") return True except Exception as e: print(f"❌ Error during trace test: {e}") return False if __name__ == "__main__": success = test_agentops_trace() if success: print("\n✅ Trace test passed!") else: print("\n❌ Trace test failed!") ``` -------------------------------- ### Troubleshoot Service Startup Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/docker-guide.mdx Commands to inspect logs and configuration. ```bash # Check logs for errors docker-compose logs api docker-compose logs dashboard # Verify environment variables docker-compose config ``` -------------------------------- ### Web Search Tool Demo with AgentOps Source: https://github.com/agentops-ai/agentops/blob/main/examples/openai_agents/agents_tools.ipynb Demonstrates using the Web Search Tool within an AgentOps traced session. It includes starting the trace, defining an agent with the tool configured for a specific location, and running the agent to perform a web search. The example output shows a potential result format. ```python # Start the AgentOps trace session tracer = agentops.start_trace( trace_name="Web Search Tool Example", tags=["tools-demo", "openai-agents", "agentops-example"] ) async def run_web_search_demo(): agent = Agent( name="Web searcher", instructions="You are a helpful agent.", tools=[WebSearchTool(user_location={"type": "approximate", "city": "New York"})], ) with trace("Web search example"): result = await Runner.run( agent, "search the web for 'local sports news' and give me 1 interesting update in a sentence.", ) print(result.final_output) # Example output: The New York Giants are reportedly pursuing quarterback Aaron Rodgers after his ... # Run the demo await run_web_search_demo() # End the AgentOps trace session agentops.end_trace(tracer, end_state="Success") ``` -------------------------------- ### Install Python Development Dependencies with Uv Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/native-development.mdx Install Python development dependencies using uv, a fast Python package installer. This command installs packages listed in requirements-dev.txt. ```bash # Install Python development tools uv pip install -r requirements-dev.txt ``` -------------------------------- ### Run Workflow Demonstration Source: https://github.com/agentops-ai/agentops/blob/main/examples/agno/agno_workflow_setup.ipynb Calls the `demonstrate_workflows` function to execute the example and showcase the caching workflow. ```python demonstrate_workflows() ``` -------------------------------- ### Manually Start Development Servers Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/backend-setup.mdx Instructions for manually starting the API server, dashboard, and landing page in separate terminals. ```bash # Start API server cd api && uv run python run.py # Start dashboard (in another terminal) cd dashboard && bun dev # Start landing page (in another terminal) cd landing && bun dev ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/agentops-ai/agentops/blob/main/app/api/README.md Install project dependencies using uv or pip. uv is recommended for faster installation. ```bash # Using uv (faster): uv pip install -r requirements.txt # Or using pip: pip install -r requirements.txt ``` -------------------------------- ### Install AgentOps and OpenAI Agents JS Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/openai_agents_js.mdx Install the necessary packages using npm. Ensure you have Node.js and npm installed. ```bash npm install agentops @openai/agents ``` -------------------------------- ### Install CrewAI and AgentOps Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/crewai.mdx Install CrewAI with tools support and AgentOps for tracking. Use pip, poetry, or uv for installation. ```bash pip install -U 'crewai[tools]' agentops ``` ```bash poetry add 'crewai[tools]' agentops ``` ```bash uv pip install 'crewai[tools]' agentops ``` -------------------------------- ### Run Development Server Source: https://github.com/agentops-ai/agentops/blob/main/app/landing/README.md Use one of these commands to start the Next.js development server. Open http://localhost:3000 in your browser to view the application. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` ```bash bun dev ``` -------------------------------- ### Install Supabase CLI Source: https://github.com/agentops-ai/agentops/blob/main/app/SETUP_GUIDE.md Install the Supabase Command Line Interface globally using npm. Verify the installation by checking the version. ```bash npm install -g supabase supabase --version ``` -------------------------------- ### Install Dependencies Source: https://github.com/agentops-ai/agentops/blob/main/CONTRIBUTING.md Install the package in editable mode. ```bash pip install -e . ``` -------------------------------- ### Start Trace with Tags Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/concepts/traces.mdx Demonstrates starting a trace with tags provided as either a list of strings or a dictionary. ```python # Tags can be provided as a list of strings or a dictionary agentops.start_trace("my_trace", tags=["production", "experiment-a"]) agentops.start_trace("my_trace", tags={"environment": "prod", "version": "1.2.3"}) ``` -------------------------------- ### Install AgentOps and OpenAI Agents SDK Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/openai_agents_python.mdx Install the necessary Python packages using pip, poetry, or uv. Ensure you have agentops, openai-agents, and python-dotenv installed. ```bash pip install agentops openai-agents python-dotenv ``` ```bash poetry add agentops openai-agents python-dotenv ``` ```bash uv pip install agentops openai-agents python-dotenv ``` -------------------------------- ### Install AgentOps and Google GenAI Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/google_genai.mdx Install the necessary libraries using pip, poetry, or uv. ```bash pip install agentops google-genai ``` ```bash poetry add agentops google-genai ``` ```bash uv pip install agentops google-genai ``` -------------------------------- ### Run Example with Local OTLP Exporter Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Execute a Python example script configured to use a local OTLP exporter endpoint. Replace placeholders for keys and endpoints as needed. ```bash AGENTOPS_API_KEY= \ AGENTOPS_API_ENDPOINT=http://localhost:8000 \ AGENTOPS_APP_URL=http://localhost:3000 \ AGENTOPS_EXPORTER_ENDPOINT=http://localhost:4318/v1/traces \ OPENAI_API_KEY= \ python examples/openai/openai_example_sync.py ``` -------------------------------- ### Install Dependencies with Bun and UV Source: https://github.com/agentops-ai/agentops/blob/main/app/README.md Install project dependencies using Bun for the dashboard and uv for Python packages. This includes installing the API in editable mode. ```bash bun install uv pip install -r requirements-dev.txt cd api && uv pip install -e . && cd .. cd dashboard && bun install && cd .. ``` -------------------------------- ### Install LiteLLM Source: https://github.com/agentops-ai/agentops/blob/main/README.md Install the LiteLLM package via pip. ```bash pip install litellm ``` -------------------------------- ### Install Agno and Dependencies Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/agno.mdx Install the necessary libraries for Agno and asynchronous operations using pip, poetry, or uv. ```bash pip install agentops agno python-dotenv ``` ```bash poetry add agentops agno python-dotenv ``` ```bash uv pip install agentops agno python-dotenv ``` -------------------------------- ### Create and Monitor Basic Deployment Source: https://github.com/agentops-ai/agentops/blob/main/app/deploy/jockey/PROJECT_PLAN.md Use the Deployment.create method to instantiate a deployment with a specified image and replica count, then retrieve its status. ```python from jockey.models import Deployment from jockey.pipeline import DeploymentPipeline # Create deployment deployment = Deployment.create( name="my-agent", image="myregistry/agent:v1.0.0", replicas=3 ) # Monitor status status = deployment.get_status() print(f"Ready replicas: {status.replicas_ready}/{status.replicas_desired}") ``` -------------------------------- ### Install Anthropic SDK Source: https://github.com/agentops-ai/agentops/blob/main/README.md Install the Anthropic Python SDK. ```bash pip install anthropic ``` -------------------------------- ### Initialize and Start AgentOps Services Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/self-hosting/overview.mdx Commands to clone the repository, configure environment variables, and launch services using Docker or native commands. ```bash # 1. Clone the repository git clone https://github.com/AgentOps-AI/AgentOps.Next.git cd AgentOps.Next/app # 2. Copy environment files cp .env.example .env cp api/.env.example api/.env cp dashboard/.env.example dashboard/.env.local # 3. Configure external services (see guides below) # Edit .env files with your service credentials # 4. Start with Docker docker-compose up -d # Or start natively for development just api-native # Terminal 1 just fe-run # Terminal 2 ``` -------------------------------- ### Create Project Structure Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/langgraph.mdx Set up the basic project directory and files for the LangGraph chatbot. ```bash # Create project directory mkdir langgraph_chatbot cd langgraph_chatbot # Create main chatbot file touch chatbot.py touch .env ``` -------------------------------- ### Install Dependencies Source: https://github.com/agentops-ai/agentops/blob/main/examples/mem0/mem0_memory_example.ipynb Installs the necessary Python packages for AgentOps and Mem0. ```python %pip install agentops %pip install mem0ai %pip install python-dotenv ``` -------------------------------- ### Install Dependencies Source: https://github.com/agentops-ai/agentops/blob/main/examples/ag2/groupchat.ipynb Install the required packages for AgentOps and AG2 integration. ```bash %pip install agentops %pip install ag2 %pip install nest-asyncio ``` -------------------------------- ### Install Dependencies with UV Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/google_adk.mdx Install Google ADK, AgentOps, and other required packages using UV. ```bash uv pip install google-adk agentops nest_asyncio python-dotenv ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/examples/langgraph.mdx Configure .env file with API keys for OpenAI and AgentOps. ```bash # .env OPENAI_API_KEY=your_openai_api_key_here AGENTOPS_API_KEY=your_agentops_api_key_here ``` -------------------------------- ### Install AgentOps SDK Source: https://context7.com/agentops-ai/agentops/llms.txt Install the required packages via pip. ```bash pip install agentops python-dotenv ``` -------------------------------- ### Install CrewAI Integration Source: https://github.com/agentops-ai/agentops/blob/main/README.md Command to install CrewAI with AgentOps support. ```bash pip install 'crewai[agentops]' ``` -------------------------------- ### Quick Start AgentOps Initialization Source: https://github.com/agentops-ai/agentops/blob/main/docs/v2/integrations/agno.mdx Initialize AgentOps and run a basic Agno agent to begin tracking. ```python import os from dotenv import load_dotenv # Load environment variables load_dotenv() from agno.agent import Agent from agno.team import Team from agno.models.openai import OpenAIChat # Initialize AgentOps import agentops agentops.init(api_key=os.getenv("AGENTOPS_API_KEY")) # Create and run an agent agent = Agent( name="Assistant", role="Helpful AI assistant", model=OpenAIChat(id="gpt-4o-mini") ) response = agent.run("What are the key benefits of AI agents?") print(response.content) ```