> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kubiya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Resolve Agent Context

> Convenience endpoint to resolve full context for an agent.

Fetches and merges context from:
1. ALL agent environments (many-to-many)
2. Team (if agent belongs to a team)
3. ALL team environments
4. Project (if assigned)
5. Agent's own context

Workers should call this endpoint to get all knowledge, resources, and policies.



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json get /api/v1/agents/{agent_id}/context/resolved
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/agents/{agent_id}/context/resolved:
    get:
      summary: Resolve Agent Context
      description: >-
        Convenience endpoint to resolve full context for an agent.


        Fetches and merges context from:

        1. ALL agent environments (many-to-many)

        2. Team (if agent belongs to a team)

        3. ALL team environments

        4. Project (if assigned)

        5. Agent's own context


        Workers should call this endpoint to get all knowledge, resources, and
        policies.
      operationId: resolve_agent_context_api_v1_agents__agent_id__context_resolved_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolvedContextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ResolvedContextResponse:
      properties:
        entity_id:
          type: string
          title: Entity Id
        entity_type:
          type: string
          title: Entity Type
        environment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
        knowledge_uuids:
          items:
            type: string
          type: array
          title: Knowledge Uuids
          description: Merged knowledge from all layers
        resource_ids:
          items:
            type: string
          type: array
          title: Resource Ids
          description: Merged resources from all layers
        policy_ids:
          items:
            type: string
          type: array
          title: Policy Ids
          description: Merged policies from all layers
        layers:
          additionalProperties:
            $ref: '#/components/schemas/ContextData'
          type: object
          title: Layers
          description: Context breakdown by layer
      type: object
      required:
        - entity_id
        - entity_type
        - knowledge_uuids
        - resource_ids
        - policy_ids
        - layers
      title: ResolvedContextResponse
      description: Resolved context with inheritance from all layers
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContextData:
      properties:
        knowledge_uuids:
          items:
            type: string
          type: array
          title: Knowledge Uuids
          description: Knowledge base UUIDs
        resource_ids:
          items:
            type: string
          type: array
          title: Resource Ids
          description: Resource IDs from Meilisearch
        policy_ids:
          items:
            type: string
          type: array
          title: Policy Ids
          description: OPA policy IDs
      type: object
      title: ContextData
      description: Generic context data structure
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your Kubiya API token (format: Bearer <token>)'

````