API Reference — Actor Module¶
potpie.actor
¶
Actor: who (user/system) and how (surface/client) submitted an event.
Threaded through every ingestion path (CLI, MCP, HTTP, webhook) so events, reconciliation runs, and graph episodes all retain a first-class answer to "who produced this".
ActorSurface = Literal['cli', 'mcp', 'http', 'webhook', 'system']
module-attribute
¶
Inbound surface. http = direct API caller; cli / mcp are clients
that go through HTTP but self-declare via X-Potpie-Client; webhook is an
external provider; system is internal jobs (backfills, workers).
SYSTEM_ACTOR = Actor(user_id='system', surface='system', client_name='context-engine', auth_method='system')
module-attribute
¶
Fallback used by internal jobs (backfills, workers) that have no human actor.
Actor
dataclass
¶
The principal that produced an event.
user_id is the stable Potpie user id for authenticated humans, or a
synthetic id for non-human actors (webhook:github:<delivery>,
system:<job>). client_name identifies the concrete program, e.g.
claude-code, cursor, potpie-cli — free-form metadata.
Source code in src/potpie/actor.py
to_properties()
¶
Render as Neo4j actor_* properties (skip empties).
Source code in src/potpie/actor.py
to_payload()
¶
JSON-serializable view for API responses.
normalize_surface(value)
¶
Case-insensitive normalization; returns None for invalid/empty input.