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

# Search Deal Context — NL answer over deal memory

> Ask a natural-language question about one or more authorized deals. The service runs an internal retrieval agent over the resolved deal scope's observations and source artifacts (call transcripts, emails, notes) and returns a synthesized, citation-backed answer.

Integrator notes:
- **Authorized deal set.** Pass `deal_ids` for a single or explicit multi-deal search. Omit `deal_ids` to search all visible deals in the API key's organization. Every explicit id must belong to the organization and be visible; otherwise `404` (cross-org existence is never revealed). No `user_id` is needed.
- **v1 compatibility.** Deprecated `deal_id` is accepted as an alias for one `deal_ids` entry.
- **Budget.** Omit `budget_mode` for the standard `medium` path. Use `instant` only with exactly one `deal_ids` entry. Public direct calls accept only `instant`, `medium`, and `high`; larger eval modes require an internal queue/eval path.
- **Read-only.** No deal, CRM, or artifact data is modified (the run skips the interactive deal-state regeneration).
- **Grounded output.** `answer` is synthesized from `citations[]`; artifact citations carry `observation_id`, `artifact_id`, and a verbatim `source_quote` when available, while structured-data citations identify CRM/deal-state/SQL support. Source gaps and caveats are carried in the answer text rather than separate runtime diagnostics.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/agentic-search/deal-context
openapi: 3.0.0
info:
  title: Tempo API
  description: >-
    The Tempo API gives you programmatic access to Deal Brain over HTTP.


    Authenticate with an API key passed as a Bearer token in the `Authorization`
    header.


    If you are building an AI agent rather than a traditional integration, the
    [MCP server](/integrations/mcp) exposes a richer surface and handles auth
    over OAuth.
  version: '1.0'
  contact: {}
servers:
  - url: https://findtempo.co
    description: Production
security: []
tags: []
paths:
  /api/v1/agentic-search/deal-context:
    post:
      tags:
        - Agentic Search
      summary: Search Deal Context — NL answer over deal memory
      description: >-
        Ask a natural-language question about one or more authorized deals. The
        service runs an internal retrieval agent over the resolved deal scope's
        observations and source artifacts (call transcripts, emails, notes) and
        returns a synthesized, citation-backed answer.


        Integrator notes:

        - **Authorized deal set.** Pass `deal_ids` for a single or explicit
        multi-deal search. Omit `deal_ids` to search all visible deals in the
        API key's organization. Every explicit id must belong to the
        organization and be visible; otherwise `404` (cross-org existence is
        never revealed). No `user_id` is needed.

        - **v1 compatibility.** Deprecated `deal_id` is accepted as an alias for
        one `deal_ids` entry.

        - **Budget.** Omit `budget_mode` for the standard `medium` path. Use
        `instant` only with exactly one `deal_ids` entry. Public direct calls
        accept only `instant`, `medium`, and `high`; larger eval modes require
        an internal queue/eval path.

        - **Read-only.** No deal, CRM, or artifact data is modified (the run
        skips the interactive deal-state regeneration).

        - **Grounded output.** `answer` is synthesized from `citations[]`;
        artifact citations carry `observation_id`, `artifact_id`, and a verbatim
        `source_quote` when available, while structured-data citations identify
        CRM/deal-state/SQL support. Source gaps and caveats are carried in the
        answer text rather than separate runtime diagnostics.
      operationId: AgenticSearchController_searchDealContext_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - question
              properties:
                question:
                  type: string
                  description: The natural-language question to answer.
                  example: What did the buyer say about pricing?
                deal_ids:
                  type: array
                  maxItems: 2500
                  description: >-
                    Optional opportunity ids to scope the answer to. Omit to
                    search all visible organization deals.
                  items:
                    type: string
                  example:
                    - 00000000-0000-0000-0000-000000000000
                deal_id:
                  type: string
                  deprecated: true
                  description: Deprecated v1 alias for a single deal. Prefer deal_ids.
                  example: 00000000-0000-0000-0000-000000000000
                budget_mode:
                  type: string
                  enum:
                    - instant
                    - medium
                    - high
                  default: medium
                  description: >-
                    Search depth preset for public direct calls. instant is only
                    valid with exactly one deal_ids entry.
      responses:
        '200':
          description: A synthesized, citation-backed answer for the resolved deal scope.
          content:
            application/json:
              schema:
                type: object
                required:
                  - answer
                  - missing_context
                  - citations
                  - source_artifacts
                  - deal_id
                  - stop_reason
                  - elapsed_ms
                properties:
                  answer:
                    type: string
                    description: >-
                      The synthesized natural-language answer, grounded in the
                      citations.
                  missing_context:
                    type: string
                    nullable: true
                    description: >-
                      Non-null when the answer names concrete source gaps or
                      caveats.
                  citations:
                    type: array
                    description: Evidence the answer is grounded in, in support order.
                    items:
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - artifact
                            - structured_data
                        observation_id:
                          type: string
                          nullable: true
                          description: Observation backing this citation, if any.
                        deal_id:
                          type: string
                          nullable: true
                          description: >-
                            Deal id for the cited evidence when the citation can
                            be tied to a deal.
                        deal_name:
                          type: string
                          nullable: true
                          description: Deal name for citation navigation when available.
                        account_id:
                          type: string
                          nullable: true
                          description: Account id for the cited deal when available.
                        account_name:
                          type: string
                          nullable: true
                          description: Account name for citation navigation when available.
                        artifact_id:
                          type: string
                          nullable: true
                          description: >-
                            Source artifact (transcript/email/note) the quote
                            came from. Use with a retrieval endpoint to fetch
                            the full artifact.
                        artifact_title:
                          type: string
                          nullable: true
                          description: Display title of the cited source artifact.
                        artifact_type:
                          type: string
                          nullable: true
                          description: >-
                            Document or artifact type for navigation and
                            filtering.
                        artifact_source:
                          type: string
                          nullable: true
                          description: >-
                            Source system or channel that produced the cited
                            artifact.
                        artifact_summary:
                          type: string
                          nullable: true
                          description: Short artifact summary when available.
                        artifact_occurred_at:
                          type: string
                          nullable: true
                          description: >-
                            When the cited artifact occurred, as an ISO
                            timestamp when available.
                        source_quote:
                          type: string
                          nullable: true
                          description: Verbatim excerpt from the source artifact.
                        source_refs:
                          type: array
                          description: >-
                            Structured anchors into the source
                            (line/offset/section/speaker) for precise
                            attribution.
                          items:
                            type: object
                        observation_text:
                          type: string
                          description: The agent-extracted observation in plain language.
                        structured_data:
                          type: object
                          nullable: true
                          description: >-
                            Structured CRM, deal-state, or SQL support when the
                            citation is not tied to a source artifact.
                  source_artifacts:
                    type: array
                    description: >-
                      Deduped manifest of artifacts referenced by artifact
                      citations.
                    items:
                      type: object
                      properties:
                        artifact_id:
                          type: string
                        title:
                          type: string
                          nullable: true
                        type:
                          type: string
                          nullable: true
                        source:
                          type: string
                          nullable: true
                        occurred_at:
                          type: string
                          nullable: true
                        summary:
                          type: string
                          nullable: true
                  deal_id:
                    type: string
                    nullable: true
                    description: >-
                      Single resolved deal id when the request resolved to one
                      deal; null for multi-deal or all-visible searches.
                  stop_reason:
                    type: string
                    enum:
                      - final_answer
                      - fallback_final
                      - timeout
                    description: How the bounded search loop ended.
                  elapsed_ms:
                    type: number
                    description: Server-side wall-clock for the run, in milliseconds.
        '400':
          description: >-
            Invalid request body (missing/blank `question` or malformed
            `deal_ids`).
        '401':
          description: Missing or invalid API key.
        '404':
          description: >-
            One or more requested deal ids are not readable by the API key’s
            organization, or no visible organization deals were available when
            `deal_ids` was omitted. Returned for unknown ids, deals in another
            organization, and non-visible deals (cross-org existence is never
            revealed).
      security:
        - api-key: []
components:
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: Authorization
      description: API key passed as Bearer token (e.g. "Bearer your-api-key")

````