Decorators work by wrapping functions or classes that they are placed above. You’ve probably seen this before. Using decorators allows us to add a lot of functionality to your code with minimal work on your part.

python
@example_decorator()
def hello_world():
   ...

@track_agent()

If your implementation uses Classes to denote Agents, this decorator enables automatic agent tracking.

Learn more about tracking agents here.

@track_function()

Sometimes your agent system will use functions that are important to track as Actions.

Adding this decorator above any function will allow every instance of that function call to be tracked and displayed in your Session Drill-Down on the dashboard.