[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71155":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":16,"starSnapshotCount":16,"syncStatus":46,"lastSyncTime":47,"discoverSource":48},71155,"agentops","AgentOps-AI\u002Fagentops","AgentOps-AI","Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI","https:\u002F\u002Fagentops.ai",null,"Python",5618,591,51,108,0,12,33,77,36,108.52,"MIT License",false,"main",true,[27,5,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"agent","agents-sdk","ai","anthropic","autogen","cost-estimation","crewai","evals","evaluation-metrics","groq","langchain","llm","mistral","ollama","openai","openai-agents","2026-06-12 04:00:59","\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fagentops.ai?ref=gh\">\n    \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Flogo\u002Fgithub-banner.png\" alt=\"Logo\">\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n  \u003Cem>Observability and DevTool platform for AI Agents\u003C\u002Fem>\n\u003C\u002Fdiv>\n\n\u003Cbr \u002F>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fagentops\">\n    \u003Cimg src=\"https:\u002F\u002Fstatic.pepy.tech\u002Fbadge\u002Fagentops\u002Fmonth\" alt=\"Downloads\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fagentops-ai\u002Fagentops\u002Fissues\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcommit-activity\u002Fm\u002Fagentops-ai\u002Fagentops\" alt=\"git commit activity\">\n  \u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fagentops?&color=3670A0\" alt=\"PyPI - Version\">\n  \u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg?&color=3670A0\" alt=\"License: MIT\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fsmithery.ai\u002Fserver\u002F@AgentOps-AI\u002Fagentops-mcp\">\n    \u003Cimg src=\"https:\u002F\u002Fsmithery.ai\u002Fbadge\u002F@AgentOps-AI\u002Fagentops-mcp\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fagentopsai\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fagentopsai?style=social\" alt=\"Twitter\" style=\"height: 20px;\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FFagdcwwXRR\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdiscord-7289da.svg?style=flat-square&logo=discord\" alt=\"Discord\" style=\"height: 20px;\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai\u002F?ref=gh\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDashboard-blue.svg?style=flat-square\" alt=\"Dashboard\" style=\"height: 20px;\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fintroduction\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocumentation-orange.svg?style=flat-square\" alt=\"Documentation\" style=\"height: 20px;\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fentelligence.ai\u002FAgentOps-AI&agentops\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FChat%20with%20Docs-green.svg?style=flat-square\" alt=\"Chat with Docs\" style=\"height: 20px;\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cdiv align=\"center\">\n  \u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fdfb4fa8d-d8c4-4965-9ff6-5b8514c1c22f\" width=\"650\" autoplay loop muted>\u003C\u002Fvideo>\n\u003C\u002Fdiv>\n\n\u003Cbr\u002F>\n\nAgentOps helps developers build, evaluate, and monitor AI agents. From prototype to production.\n\n## Open Source\n\nThe AgentOps app is open source under the MIT license. Explore the code in our [app directory](https:\u002F\u002Fgithub.com\u002FAgentOps-AI\u002Fagentops\u002Ftree\u002Fmain\u002Fapp).\n\n## Key Integrations 🔌\n\n\u003Cdiv align=\"center\" style=\"background-color: white; padding: 20px; border-radius: 10px; margin: 0 auto; max-width: 800px;\">\n  \u003Cdiv style=\"display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 30px; margin-bottom: 20px;\">\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv2\u002Fintegrations\u002Fopenai_agents_python\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fopenai\u002Fagents-sdk.svg\" height=\"45\" alt=\"OpenAI Agents SDK\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcrewai\">\u003Cimg src=\"docs\u002Fv1\u002Fimg\u002Fdocs-icons\u002Fcrew-banner.png\" height=\"45\" alt=\"CrewAI\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.ag2.ai\u002Fdocs\u002Fecosystem\u002Fagentops\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fag2\u002Fag2-logo.svg\" height=\"45\" alt=\"AG2 (AutoGen)\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fmicrosoft\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fmicrosoft\u002Fmicrosoft_logo.svg\" height=\"45\" alt=\"Microsoft\">\u003C\u002Fa>\n  \u003C\u002Fdiv>\n  \n  \u003Cdiv style=\"display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 30px; margin-bottom: 20px;\">\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Flangchain\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Flangchain\u002Flangchain-logo.svg\" height=\"45\" alt=\"LangChain\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcamel\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fcamel\u002Fcamel.png\" height=\"45\" alt=\"Camel AI\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.llamaindex.ai\u002Fen\u002Fstable\u002Fmodule_guides\u002Fobservability\u002F?h=agentops#agentops\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Follama\u002Follama-icon.png\" height=\"45\" alt=\"LlamaIndex\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcohere\">\u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fcohere\u002Fcohere-logo.svg\" height=\"45\" alt=\"Cohere\">\u003C\u002Fa>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n|                                       |                                                               |\n| ------------------------------------- | ------------------------------------------------------------- |\n| 📊 **Replay Analytics and Debugging** | Step-by-step agent execution graphs                           |\n| 💸 **LLM Cost Management**            | Track spend with LLM foundation model providers               |\n| 🤝 **Framework Integrations**         | Native Integrations with CrewAI, AG2 (AutoGen), Agno, LangGraph, & more         |\n| ⚒️ **Self-Host**                      | Want to run AgentOps on your own cloud? You're covered        |\n\n## Quick Start ⌨️\n\n```bash\npip install agentops\n```\n\n\n#### Session replays in 2 lines of code\n\nInitialize the AgentOps client and automatically get analytics on all your LLM calls.\n\n[Get an API key](https:\u002F\u002Fapp.agentops.ai\u002Fsettings\u002Fprojects)\n\n```python\nimport agentops\n\n# Beginning of your program (i.e. main.py, __init__.py)\nagentops.init( \u003C INSERT YOUR API KEY HERE >)\n\n...\n\n# End of program\nagentops.end_session('Success')\n```\n\nAll your sessions can be viewed on the [AgentOps dashboard](https:\u002F\u002Fapp.agentops.ai?ref=gh)\n\u003Cbr\u002F>\n\n## Self-Hosting\n\nLooking to run the full AgentOps app (Dashboard + API backend) on your machine? Follow the setup guide in `app\u002FREADME.md`:\n\n- [Run the App and Backend (Dashboard + API)](app\u002FREADME.md)\n\n\n\u003Cdetails>\n  \u003Csummary>Agent Debugging\u003C\u002Fsummary>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n    \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Fsession-drilldown-metadata.png\" style=\"width: 90%;\" alt=\"Agent Metadata\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n    \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Fchat-viewer.png\" style=\"width: 90%;\" alt=\"Chat Viewer\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n    \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Fsession-drilldown-graphs.png\" style=\"width: 90%;\" alt=\"Event Graphs\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>Session Replays\u003C\u002Fsummary>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n    \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Fsession-replay.png\" style=\"width: 90%;\" alt=\"Session Replays\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>Summary Analytics\u003C\u002Fsummary>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n   \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Foverview.png\" style=\"width: 90%;\" alt=\"Summary Analytics\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fapp.agentops.ai?ref=gh\">\n   \u003Cimg src=\"docs\u002Fimages\u002Fexternal\u002Fapp_screenshots\u002Foverview-charts.png\" style=\"width: 90%;\" alt=\"Summary Analytics Charts\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdetails>\n\n\n### First class Developer Experience\nAdd powerful observability to your agents, tools, and functions with as little code as possible: one line at a time.\n\u003Cbr\u002F>\nRefer to our [documentation](http:\u002F\u002Fdocs.agentops.ai)\n\n```python\n# Create a session span (root for all other spans)\nfrom agentops.sdk.decorators import session\n\n@session\ndef my_workflow():\n    # Your session code here\n    return result\n```\n\n```python\n# Create an agent span for tracking agent operations\nfrom agentops.sdk.decorators import agent\n\n@agent\nclass MyAgent:\n    def __init__(self, name):\n        self.name = name\n        \n    # Agent methods here\n```\n\n```python\n# Create operation\u002Ftask spans for tracking specific operations\nfrom agentops.sdk.decorators import operation, task\n\n@operation  # or @task\ndef process_data(data):\n    # Process the data\n    return result\n```\n\n```python\n# Create workflow spans for tracking multi-operation workflows\nfrom agentops.sdk.decorators import workflow\n\n@workflow\ndef my_workflow(data):\n    # Workflow implementation\n    return result\n```\n\n```python\n# Nest decorators for proper span hierarchy\nfrom agentops.sdk.decorators import session, agent, operation\n\n@agent\nclass MyAgent:\n    @operation\n    def nested_operation(self, message):\n        return f\"Processed: {message}\"\n        \n    @operation\n    def main_operation(self):\n        result = self.nested_operation(\"test message\")\n        return result\n\n@session\ndef my_session():\n    agent = MyAgent()\n    return agent.main_operation()\n```\n\nAll decorators support:\n- Input\u002FOutput Recording\n- Exception Handling\n- Async\u002Fawait functions\n- Generator functions\n- Custom attributes and names\n\n## Integrations 🦾\n\n### OpenAI Agents SDK 🖇️\n\nBuild multi-agent systems with tools, handoffs, and guardrails. AgentOps natively integrates with the OpenAI Agents SDKs for both Python and TypeScript.\n\n#### Python\n\n```bash\npip install openai-agents\n```\n\n- [Python integration guide](https:\u002F\u002Fdocs.agentops.ai\u002Fv2\u002Fintegrations\u002Fopenai_agents_python)\n- [OpenAI Agents Python documentation](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-python\u002F)\n\n#### TypeScript\n\n```bash\nnpm install agentops @openai\u002Fagents\n```\n\n- [TypeScript integration guide](https:\u002F\u002Fdocs.agentops.ai\u002Fv2\u002Fintegrations\u002Fopenai_agents_js)\n- [OpenAI Agents JS documentation](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-js)\n\n### CrewAI 🛶\n\nBuild Crew agents with observability in just 2 lines of code. Simply set an `AGENTOPS_API_KEY` in your environment, and your crews will get automatic monitoring on the AgentOps dashboard.\n\n```bash\npip install 'crewai[agentops]'\n```\n\n- [AgentOps integration example](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcrewai)\n- [Official CrewAI documentation](https:\u002F\u002Fdocs.crewai.com\u002Fhow-to\u002FAgentOps-Observability)\n\n### AG2 🤖\nWith only two lines of code, add full observability and monitoring to AG2 (formerly AutoGen) agents. Set an `AGENTOPS_API_KEY` in your environment and call `agentops.init()`\n\n- [AG2 Observability Example](https:\u002F\u002Fgithub.com\u002Fag2ai\u002Fag2\u002Fblob\u002Fmain\u002Fnotebook\u002Fagentchat_agentops.ipynb)\n- [AG2 - AgentOps Documentation](https:\u002F\u002Fdocs.ag2.ai\u002Flatest\u002Fdocs\u002Fecosystem\u002Fagentops\u002F)\n\n### Camel AI 🐪\n\nTrack and analyze CAMEL agents with full observability. Set an `AGENTOPS_API_KEY` in your environment and initialize AgentOps to get started.\n\n- [Camel AI](https:\u002F\u002Fwww.camel-ai.org\u002F) - Advanced agent communication framework\n- [AgentOps integration example](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcamel)\n- [Official Camel AI documentation](https:\u002F\u002Fdocs.camel-ai.org\u002Fcookbooks\u002Fagents_tracking.html)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n\n```bash\npip install \"camel-ai[all]==0.2.11\"\npip install agentops\n```\n\n```python\nimport os\nimport agentops\nfrom camel.agents import ChatAgent\nfrom camel.messages import BaseMessage\nfrom camel.models import ModelFactory\nfrom camel.types import ModelPlatformType, ModelType\n\n# Initialize AgentOps\nagentops.init(os.getenv(\"AGENTOPS_API_KEY\"), tags=[\"CAMEL Example\"])\n\n# Import toolkits after AgentOps init for tracking\nfrom camel.toolkits import SearchToolkit\n\n# Set up the agent with search tools\nsys_msg = BaseMessage.make_assistant_message(\n    role_name='Tools calling operator',\n    content='You are a helpful assistant'\n)\n\n# Configure tools and model\ntools = [*SearchToolkit().get_tools()]\nmodel = ModelFactory.create(\n    model_platform=ModelPlatformType.OPENAI,\n    model_type=ModelType.GPT_4O_MINI,\n)\n\n# Create and run the agent\ncamel_agent = ChatAgent(\n    system_message=sys_msg,\n    model=model,\n    tools=tools,\n)\n\nresponse = camel_agent.step(\"What is AgentOps?\")\nprint(response)\n\nagentops.end_session(\"Success\")\n```\n\nCheck out our [Camel integration guide](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcamel) for more examples including multi-agent scenarios.\n\u003C\u002Fdetails>\n\n### Langchain 🦜🔗\n\nAgentOps works seamlessly with applications built using Langchain. To use the handler, install Langchain as an optional dependency:\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```shell\npip install agentops[langchain]\n```\n\nTo use the handler, import and set\n\n```python\nimport os\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.agents import initialize_agent, AgentType\nfrom agentops.integration.callbacks.langchain import LangchainCallbackHandler\n\nAGENTOPS_API_KEY = os.environ['AGENTOPS_API_KEY']\nhandler = LangchainCallbackHandler(api_key=AGENTOPS_API_KEY, tags=['Langchain Example'])\n\nllm = ChatOpenAI(openai_api_key=OPENAI_API_KEY,\n                 callbacks=[handler],\n                 model='gpt-3.5-turbo')\n\nagent = initialize_agent(tools,\n                         llm,\n                         agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,\n                         verbose=True,\n                         callbacks=[handler], # You must pass in a callback handler to record your agent\n                         handle_parsing_errors=True)\n```\n\nCheck out the [Langchain Examples Notebook](.\u002Fexamples\u002Flangchain\u002Flangchain_examples.ipynb) for more details including Async handlers.\n\n\u003C\u002Fdetails>\n\n### Cohere ⌨️\n\nFirst class support for Cohere(>=5.4.0). This is a living integration, should you need any added functionality please message us on Discord!\n\n- [AgentOps integration example](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fcohere)\n- [Official Cohere documentation](https:\u002F\u002Fdocs.cohere.com\u002Freference\u002Fabout)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```bash\npip install cohere\n```\n\n```python python\nimport cohere\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\nco = cohere.Client()\n\nchat = co.chat(\n    message=\"Is it pronounced ceaux-hear or co-hehray?\"\n)\n\nprint(chat)\n\nagentops.end_session('Success')\n```\n\n```python python\nimport cohere\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nco = cohere.Client()\n\nstream = co.chat_stream(\n    message=\"Write me a haiku about the synergies between Cohere and AgentOps\"\n)\n\nfor event in stream:\n    if event.event_type == \"text-generation\":\n        print(event.text, end='')\n\nagentops.end_session('Success')\n```\n\u003C\u002Fdetails>\n\n\n### Anthropic ﹨\n\nTrack agents built with the Anthropic Python SDK (>=0.32.0).\n\n- [AgentOps integration guide](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fanthropic)\n- [Official Anthropic documentation](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fwelcome)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```bash\npip install anthropic\n```\n\n```python python\nimport anthropic\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nclient = anthropic.Anthropic(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"ANTHROPIC_API_KEY\"),\n)\n\nmessage = client.messages.create(\n        max_tokens=1024,\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me a cool fact about AgentOps\",\n            }\n        ],\n        model=\"claude-3-opus-20240229\",\n    )\nprint(message.content)\n\nagentops.end_session('Success')\n```\n\nStreaming\n```python python\nimport anthropic\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nclient = anthropic.Anthropic(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"ANTHROPIC_API_KEY\"),\n)\n\nstream = client.messages.create(\n    max_tokens=1024,\n    model=\"claude-3-opus-20240229\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"Tell me something cool about streaming agents\",\n        }\n    ],\n    stream=True,\n)\n\nresponse = \"\"\nfor event in stream:\n    if event.type == \"content_block_delta\":\n        response += event.delta.text\n    elif event.type == \"message_stop\":\n        print(\"\\n\")\n        print(response)\n        print(\"\\n\")\n```\n\nAsync\n\n```python python\nimport asyncio\nfrom anthropic import AsyncAnthropic\n\nclient = AsyncAnthropic(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"ANTHROPIC_API_KEY\"),\n)\n\n\nasync def main() -> None:\n    message = await client.messages.create(\n        max_tokens=1024,\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me something interesting about async agents\",\n            }\n        ],\n        model=\"claude-3-opus-20240229\",\n    )\n    print(message.content)\n\n\nawait main()\n```\n\u003C\u002Fdetails>\n\n### Mistral 〽️\n\nTrack agents built with the Mistral Python SDK (>=0.32.0).\n\n- [AgentOps integration example](.\u002Fexamples\u002Fmistral\u002F\u002Fmistral_example.ipynb)\n- [Official Mistral documentation](https:\u002F\u002Fdocs.mistral.ai)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```bash\npip install mistralai\n```\n\nSync\n\n```python python\nfrom mistralai import Mistral\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nclient = Mistral(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"MISTRAL_API_KEY\"),\n)\n\nmessage = client.chat.complete(\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me a cool fact about AgentOps\",\n            }\n        ],\n        model=\"open-mistral-nemo\",\n    )\nprint(message.choices[0].message.content)\n\nagentops.end_session('Success')\n```\n\nStreaming\n\n```python python\nfrom mistralai import Mistral\nimport agentops\n\n# Beginning of program's code (i.e. main.py, __init__.py)\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nclient = Mistral(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"MISTRAL_API_KEY\"),\n)\n\nmessage = client.chat.stream(\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me something cool about streaming agents\",\n            }\n        ],\n        model=\"open-mistral-nemo\",\n    )\n\nresponse = \"\"\nfor event in message:\n    if event.data.choices[0].finish_reason == \"stop\":\n        print(\"\\n\")\n        print(response)\n        print(\"\\n\")\n    else:\n        response += event.text\n\nagentops.end_session('Success')\n```\n\nAsync\n\n```python python\nimport asyncio\nfrom mistralai import Mistral\n\nclient = Mistral(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"MISTRAL_API_KEY\"),\n)\n\n\nasync def main() -> None:\n    message = await client.chat.complete_async(\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me something interesting about async agents\",\n            }\n        ],\n        model=\"open-mistral-nemo\",\n    )\n    print(message.choices[0].message.content)\n\n\nawait main()\n```\n\nAsync Streaming\n\n```python python\nimport asyncio\nfrom mistralai import Mistral\n\nclient = Mistral(\n    # This is the default and can be omitted\n    api_key=os.environ.get(\"MISTRAL_API_KEY\"),\n)\n\n\nasync def main() -> None:\n    message = await client.chat.stream_async(\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": \"Tell me something interesting about async streaming agents\",\n            }\n        ],\n        model=\"open-mistral-nemo\",\n    )\n\n    response = \"\"\n    async for event in message:\n        if event.data.choices[0].finish_reason == \"stop\":\n            print(\"\\n\")\n            print(response)\n            print(\"\\n\")\n        else:\n            response += event.text\n\n\nawait main()\n```\n\u003C\u002Fdetails>\n\n\n\n### CamelAI ﹨\n\nTrack agents built with the CamelAI Python SDK (>=0.32.0).\n\n- [CamelAI integration guide](https:\u002F\u002Fdocs.camel-ai.org\u002Fcookbooks\u002Fagents_tracking.html#)\n- [Official CamelAI documentation](https:\u002F\u002Fdocs.camel-ai.org\u002Findex.html)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```bash\npip install camel-ai[all]\npip install agentops\n```\n\n```python python\n#Import Dependencies\nimport agentops\nimport os\nfrom getpass import getpass\nfrom dotenv import load_dotenv\n\n#Set Keys\nload_dotenv()\nopenai_api_key = os.getenv(\"OPENAI_API_KEY\") or \"\u003Cyour openai key here>\"\nagentops_api_key = os.getenv(\"AGENTOPS_API_KEY\") or \"\u003Cyour agentops key here>\"\n\n\n\n```\n\u003C\u002Fdetails>\n\n[You can find usage examples here!](examples\u002Fcamelai_examples\u002FREADME.md).\n\n\n\n### LiteLLM 🚅\n\nAgentOps provides support for LiteLLM(>=1.3.1), allowing you to call 100+ LLMs using the same Input\u002FOutput Format. \n\n- [AgentOps integration example](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Flitellm)\n- [Official LiteLLM documentation](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```bash\npip install litellm\n```\n\n```python python\n# Do not use LiteLLM like this\n# from litellm import completion\n# ...\n# response = completion(model=\"claude-3\", messages=messages)\n\n# Use LiteLLM like this\nimport litellm\n...\nresponse = litellm.completion(model=\"claude-3\", messages=messages)\n# or\nresponse = await litellm.acompletion(model=\"claude-3\", messages=messages)\n```\n\u003C\u002Fdetails>\n\n### LlamaIndex 🦙\n\n\nAgentOps works seamlessly with applications built using LlamaIndex, a framework for building context-augmented generative AI applications with LLMs.\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n  \n```shell\npip install llama-index-instrumentation-agentops\n```\n\nTo use the handler, import and set\n\n```python\nfrom llama_index.core import set_global_handler\n\n# NOTE: Feel free to set your AgentOps environment variables (e.g., 'AGENTOPS_API_KEY')\n# as outlined in the AgentOps documentation, or pass the equivalent keyword arguments\n# anticipated by AgentOps' AOClient as **eval_params in set_global_handler.\n\nset_global_handler(\"agentops\")\n```\n\nCheck out the [LlamaIndex docs](https:\u002F\u002Fdocs.llamaindex.ai\u002Fen\u002Fstable\u002Fmodule_guides\u002Fobservability\u002F?h=agentops#agentops) for more details.\n\n\u003C\u002Fdetails>\n\n### Llama Stack 🦙🥞\n\nAgentOps provides support for Llama Stack Python Client(>=0.0.53), allowing you to monitor your Agentic applications. \n\n- [AgentOps integration example 1](https:\u002F\u002Fgithub.com\u002FAgentOps-AI\u002Fagentops\u002Fpull\u002F530\u002Ffiles\u002F65a5ab4fdcf310326f191d4b870d4f553591e3ea#diff-fdddf65549f3714f8f007ce7dfd1cde720329fe54155d54389dd50fbd81813cb)\n- [AgentOps integration example 2](https:\u002F\u002Fgithub.com\u002FAgentOps-AI\u002Fagentops\u002Fpull\u002F530\u002Ffiles\u002F65a5ab4fdcf310326f191d4b870d4f553591e3ea#diff-6688ff4fb7ab1ce7b1cc9b8362ca27264a3060c16737fb1d850305787a6e3699)\n- [Official Llama Stack Python Client](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-stack-client-python)\n\n### SwarmZero AI 🐝\n\nTrack and analyze SwarmZero agents with full observability. Set an `AGENTOPS_API_KEY` in your environment and initialize AgentOps to get started.\n\n- [SwarmZero](https:\u002F\u002Fswarmzero.ai) - Advanced multi-agent framework\n- [AgentOps integration example](https:\u002F\u002Fdocs.agentops.ai\u002Fv1\u002Fintegrations\u002Fswarmzero)\n- [SwarmZero AI integration example](https:\u002F\u002Fdocs.swarmzero.ai\u002Fexamples\u002Fai-agents\u002Fbuild-and-monitor-a-web-search-agent)\n- [SwarmZero AI - AgentOps documentation](https:\u002F\u002Fdocs.swarmzero.ai\u002Fsdk\u002Fobservability\u002Fagentops)\n- [Official SwarmZero Python SDK](https:\u002F\u002Fgithub.com\u002Fswarmzero\u002Fswarmzero)\n\n\u003Cdetails>\n  \u003Csummary>Installation\u003C\u002Fsummary>\n\n```bash\npip install swarmzero\npip install agentops\n```\n\n```python\nfrom dotenv import load_dotenv\nload_dotenv()\n\nimport agentops\nagentops.init(\u003CINSERT YOUR API KEY HERE>)\n\nfrom swarmzero import Agent, Swarm\n# ...\n```\n\u003C\u002Fdetails>\n\n## Evaluations Roadmap 🧭\n\n| Platform                                                                     | Dashboard                                  | Evals                                  |\n| ---------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------- |\n| ✅ Python SDK                                                                | ✅ Multi-session and Cross-session metrics | ✅ Custom eval metrics                 |\n| 🚧 Evaluation builder API                                                    | ✅ Custom event tag tracking              | 🔜 Agent scorecards                    |\n| 🚧 [Javascript\u002FTypescript SDK (Alpha)](https:\u002F\u002Fgithub.com\u002FAgentOps-AI\u002Fagentops-node) | ✅ Session replays                         | 🔜 Evaluation playground + leaderboard |\n\n## Debugging Roadmap 🧭\n\n| Performance testing                       | Environments                                                                        | LLM Testing                                 | Reasoning and execution testing                   |\n| ----------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------- |\n| ✅ Event latency analysis                 | 🔜 Non-stationary environment testing                                               | 🔜 LLM non-deterministic function detection | 🚧 Infinite loops and recursive thought detection |\n| ✅ Agent workflow execution pricing       | 🔜 Multi-modal environments                                                         | 🚧 Token limit overflow flags               | 🔜 Faulty reasoning detection                     |\n| 🚧 Success validators (external)          | 🔜 Execution containers                                                             | 🔜 Context limit overflow flags             | 🔜 Generative code validators                     |\n| 🔜 Agent controllers\u002Fskill tests          | ✅ Honeypot and prompt injection detection ([PromptArmor](https:\u002F\u002Fpromptarmor.com)) | ✅ API bill tracking                        | 🔜 Error breakpoint analysis                      |\n| 🔜 Information context constraint testing | 🔜 Anti-agent roadblocks (i.e. Captchas)                                            | 🔜 CI\u002FCD integration checks                 |                                                   |\n| 🔜 Regression testing                     | ✅ Multi-agent framework visualization                                              |                                             |                                                   |\n\n### Why AgentOps? 🤔\n\nWithout the right tools, AI agents are slow, expensive, and unreliable. Our mission is to bring your agent from prototype to production. Here's why AgentOps stands out:\n\n- **Comprehensive Observability**: Track your AI agents' performance, user interactions, and API usage.\n- **Real-Time Monitoring**: Get instant insights with session replays, metrics, and live monitoring tools.\n- **Cost Control**: Monitor and manage your spend on LLM and API calls.\n- **Failure Detection**: Quickly identify and respond to agent failures and multi-agent interaction issues.\n- **Tool Usage Statistics**: Understand how your agents utilize external tools with detailed analytics.\n- **Session-Wide Metrics**: Gain a holistic view of your agents' sessions with comprehensive statistics.\n\nAgentOps is designed to make agent observability, testing, and monitoring easy.\n\n\n## Star History\n\nCheck out our growth in the community:\n\n\u003Cimg src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=AgentOps-AI\u002Fagentops&type=Date\" style=\"max-width: 500px\" width=\"50%\" alt=\"Logo\">\n\n## Popular projects using AgentOps\n\n\n| Repository | Stars  |\n| :--------  | -----: |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2707039?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [geekan](https:\u002F\u002Fgithub.com\u002Fgeekan) \u002F [MetaGPT](https:\u002F\u002Fgithub.com\u002Fgeekan\u002FMetaGPT) | 42787 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130722866?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [run-llama](https:\u002F\u002Fgithub.com\u002Frun-llama) \u002F [llama_index](https:\u002F\u002Fgithub.com\u002Frun-llama\u002Fllama_index) | 34446 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F170677839?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [crewAIInc](https:\u002F\u002Fgithub.com\u002FcrewAIInc) \u002F [crewAI](https:\u002F\u002Fgithub.com\u002FcrewAIInc\u002FcrewAI) | 18287 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F134388954?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [camel-ai](https:\u002F\u002Fgithub.com\u002Fcamel-ai) \u002F [camel](https:\u002F\u002Fgithub.com\u002Fcamel-ai\u002Fcamel) | 5166 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F152537519?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [superagent-ai](https:\u002F\u002Fgithub.com\u002Fsuperagent-ai) \u002F [superagent](https:\u002F\u002Fgithub.com\u002Fsuperagent-ai\u002Fsuperagent) | 5050 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30197649?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [iyaja](https:\u002F\u002Fgithub.com\u002Fiyaja) \u002F [llama-fs](https:\u002F\u002Fgithub.com\u002Fiyaja\u002Fllama-fs) | 4713 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F188122941?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [ag2ai](https:\u002F\u002Fgithub.com\u002Fag2ai) \u002F [ag2](https:\u002F\u002Fgithub.com\u002Fag2ai\u002Fag2) | 4240 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F162546372?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [BasedHardware](https:\u002F\u002Fgithub.com\u002FBasedHardware) \u002F [Omi](https:\u002F\u002Fgithub.com\u002FBasedHardware\u002FOmi) | 2723 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F454862?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [MervinPraison](https:\u002F\u002Fgithub.com\u002FMervinPraison) \u002F [PraisonAI](https:\u002F\u002Fgithub.com\u002FMervinPraison\u002FPraisonAI) | 2007 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F140554352?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [AgentOps-AI](https:\u002F\u002Fgithub.com\u002FAgentOps-AI) \u002F [Jaiqu](https:\u002F\u002Fgithub.com\u002FAgentOps-AI\u002FJaiqu) | 272 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F173542722?s=48&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [swarmzero](https:\u002F\u002Fgithub.com\u002Fswarmzero) \u002F [swarmzero](https:\u002F\u002Fgithub.com\u002Fswarmzero\u002Fswarmzero) | 195 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3074263?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [strnad](https:\u002F\u002Fgithub.com\u002Fstrnad) \u002F [CrewAI-Studio](https:\u002F\u002Fgithub.com\u002Fstrnad\u002FCrewAI-Studio) | 134 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F18406448?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [alejandro-ao](https:\u002F\u002Fgithub.com\u002Falejandro-ao) \u002F [exa-crewai](https:\u002F\u002Fgithub.com\u002Falejandro-ao\u002Fexa-crewai) | 55 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64493665?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [tonykipkemboi](https:\u002F\u002Fgithub.com\u002Ftonykipkemboi) \u002F [youtube_yapper_trapper](https:\u002F\u002Fgithub.com\u002Ftonykipkemboi\u002Fyoutube_yapper_trapper) | 47 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17598928?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [sethcoast](https:\u002F\u002Fgithub.com\u002Fsethcoast) \u002F [cover-letter-builder](https:\u002F\u002Fgithub.com\u002Fsethcoast\u002Fcover-letter-builder) | 27 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F109994880?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [bhancockio](https:\u002F\u002Fgithub.com\u002Fbhancockio) \u002F [chatgpt4o-analysis](https:\u002F\u002Fgithub.com\u002Fbhancockio\u002Fchatgpt4o-analysis) | 19 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F14105911?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [breakstring](https:\u002F\u002Fgithub.com\u002Fbreakstring) \u002F [Agentic_Story_Book_Workflow](https:\u002F\u002Fgithub.com\u002Fbreakstring\u002FAgentic_Story_Book_Workflow) | 14 |\n|\u003Cimg class=\"avatar mr-2\" src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F124134656?s=40&v=4\" width=\"20\" height=\"20\" alt=\"\">  &nbsp; [MULTI-ON](https:\u002F\u002Fgithub.com\u002FMULTI-ON) \u002F [multion-python](https:\u002F\u002Fgithub.com\u002FMULTI-ON\u002Fmultion-python) | 13 |\n\n\n_Generated using [github-dependents-info](https:\u002F\u002Fgithub.com\u002Fnvuillam\u002Fgithub-dependents-info), by [Nicolas Vuillamy](https:\u002F\u002Fgithub.com\u002Fnvuillam)_\n","AgentOps 是一个用于AI代理监控、大语言模型成本跟踪、基准测试等的Python SDK。该项目支持与大多数LLM和代理框架集成，包括CrewAI、Agno、OpenAI Agents SDK、Langchain、Autogen、AG2以及CamelAI等。其核心功能涵盖了对AI代理从原型到生产的全面监控、评估及优化，并提供了详细的成本估算和性能指标分析工具。适用于需要构建、测试或持续优化AI代理的应用场景，特别是在自然语言处理领域内追求高效开发流程和技术透明度的团队。",2,"2026-06-11 03:36:09","high_star"]