Socket
Socket
Sign inDemoInstall

agentops

Package Overview
Dependencies
0
Maintainers
2
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    agentops

Python SDK for developing AI agent evals and observability


Maintainers
2

Readme

Logo

AI agents suck. We’re fixing that.

Python Version

🐦 Twitter   •   📢 Discord   •   🖇️ AgentOps   •   📙 Documentation

AgentOps 🖇️

License: MIT PyPI - Version AgentOps Twitter Discord community channel git commit activity

AgentOps helps developers build, evaluate, and monitor AI agents. Tools to build agents from prototype to production.

📊 Replay Analytics and DebuggingStep-by-step agent execution graphs
💸 LLM Cost ManagementTrack spend with LLM foundation model providers
🧪 Agent BenchmarkingTest your agents against 1,000+ evals
🔐 Compliance and SecurityDetect common prompt injection and data exfiltration exploits
🤝 Framework IntegrationsEasily plugs in with frameworks like CrewAI and LangChain

Quick Start ⌨️

pip install agentops

Session replays in 3 lines of code

Initialize the AgentOps client and automatically get analytics on every LLM call.

import agentops

# Beginning of program's code (i.e. main.py, __init__.py)
agentops.init(<INSERT YOUR API KEY HERE>)

...
# (optional: record specific functions)
@agentops.record_function('sample function being record')
def sample_function(...):
    ...

# End of program
agentops.end_session('Success')
# Woohoo You're done 🎉

All your sessions are available on the AgentOps dashboard. Refer to our API documentation for detailed instructions.

Agent Dashboard Agent Dashboard
Session Analytics Session Analytics
Session Replays Session Replays

Integrations 🦾

CrewAI 🛶

Build Crew agents with observability with only 2 lines of code. Simply set an AGENTOPS_API_KEY in your environment, and your crews will get automatic monitoring on the AgentOps dashboard.

AgentOps is integrated with CrewAI on a pre-release fork. Install crew with

pip install git+https://github.com/AgentOps-AI/crewAI.git@main

Langchain 🦜🔗

AgentOps works seamlessly with applications built using Langchain. To use the handler, install Langchain as an optional dependency:

Installation
pip install agentops[langchain]

To use the handler, import and set

import os
from langchain.chat_models import ChatOpenAI
from langchain.agents import initialize_agent, AgentType
from agentops.langchain_callback_handler import LangchainCallbackHandler

AGENTOPS_API_KEY = os.environ['AGENTOPS_API_KEY']
handler = LangchainCallbackHandler(api_key=AGENTOPS_API_KEY, tags=['Langchain Example'])

llm = ChatOpenAI(openai_api_key=OPENAI_API_KEY,
                 callbacks=[handler],
                 model='gpt-3.5-turbo')

agent = initialize_agent(tools,
                         llm,
                         agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
                         verbose=True,
                         callbacks=[handler], # You must pass in a callback handler to record your agent
                         handle_parsing_errors=True)

Check out the Langchain Examples Notebook for more details including Async handlers.

Cohere ⌨️

First class support for Cohere(>=5.4.0). This is a living integration, should you need any added functionality please message us on Discord!

Installation
pip install cohere
import cohere
import agentops

# Beginning of program's code (i.e. main.py, __init__.py)
agentops.init(<INSERT YOUR API KEY HERE>)
co = cohere.Client()

chat = co.chat(
    message="Is it pronounced ceaux-hear or co-hehray?"
)

print(chat)

agentops.end_session('Success')
import cohere
import agentops

# Beginning of program's code (i.e. main.py, __init__.py)
agentops.init(<INSERT YOUR API KEY HERE>)

co = cohere.Client()

stream = co.chat_stream(
    message="Write me a haiku about the synergies between Cohere and AgentOps"
)

for event in stream:
    if event.event_type == "text-generation":
        print(event.text, end='')

agentops.end_session('Success')

LlamaIndex 🦙

(Coming Soon)

Time travel debugging 🔮

(coming soon!)

Agent Arena 🥊

(coming soon!)

Evaluations Roadmap 🧭

PlatformDashboardEvals
✅ Python SDK✅ Multi-session and Cross-session metrics✅ Custom eval metrics
🚧 Evaluation builder API✅ Custom event tag tracking 🔜 Agent scorecards
Javascript/Typescript SDK✅ Session replays🔜 Evaluation playground + leaderboard

Debugging Roadmap 🧭

Performance testingEnvironmentsLLM TestingReasoning and execution testing
✅ Event latency analysis🔜 Non-stationary environment testing🔜 LLM non-deterministic function detection🚧 Infinite loops and recursive thought detection
✅ Agent workflow execution pricing🔜 Multi-modal environments🚧 Token limit overflow flags🔜 Faulty reasoning detection
🚧 Success validators (external)🔜 Execution containers🔜 Context limit overflow flags🔜 Generative code validators
🔜 Agent controllers/skill tests✅ Honeypot and prompt injection detection (PromptArmor)🔜 API bill tracking🔜 Error breakpoint analysis
🔜 Information context constraint testing🔜 Anti-agent roadblocks (i.e. Captchas)🔜 CI/CD integration checks
🔜 Regression testing🔜 Multi-agent framework visualization

Why AgentOps? 🤔

Our mission is to bring your agent from prototype to production.

Agent developers often work with little to no visibility into agent testing performance. This means their agents never leave the lab. We're changing that.

AgentOps is the easiest way to evaluate, grade, and test agents. Is there a feature you'd like to see AgentOps cover? Just raise it in the issues tab, and we'll work on adding it to the roadmap.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc