Skip to content
← How we build

backend/src/agents/base/agent_context.py

import uuid


class AgentContext:
    """
    Holds per-request state passed into every agent.
    Phase 1: session ID + system prompt only.
    Phase 3 will add persistent memory references here.
    """

    def __init__(
        self,
        session_id: str | None = None,
        system_prompt: str | None = None,
        trace_id: str | None = None,
    ) -> None:
        self.session_id: str = session_id or str(uuid.uuid4())
        self.system_prompt: str | None = system_prompt
        self.trace_id: str = trace_id or str(uuid.uuid4())

Follow the work.

Occasional updates on SignalFoundry, MarketCompass, and what we are building at CompassFoundry Labs.

No spam. Unsubscribe anytime.