Skip to main content

Python SDK

The Nolma Python SDK adds session tracking and signal collection to your agents. It works alongside the gateway integration.

Installation

Requires Python 3.9+. Zero dependencies beyond httpx.

Basic usage

Session tracking

The @nolma.session decorator:
  • Creates a session ID automatically
  • Propagates it via contextvars
  • All LLM calls within the function are grouped under one session

Signals

Signals tell Lens what users do with AI outputs. This powers acceptance rate analytics and recommendations.

Signal types

get_headers()

Returns headers to inject into your LLM client.

Reference