Émile RAG internal API

The RAG internal API from Émile — 4 operation(s) for rag internal.

GitHub OpenAPI

Operations 4

POST /internal/knowledge/search Internal Search #
POST /internal/knowledge/search_grounded Internal Search Grounded #
POST /internal/knowledge/bulk_insert Bulk Insert #
DELETE /internal/knowledge/by_source/{source} Delete By Source #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/emile-wine:emile-wine-rag-internal-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

emile-wine-rag-internal-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Émile RAG internal API
  description: '# Émile API


    Public API for the Émile wine cellar app.


    ## Authentication


    Two methods are supported:


    **1. API Key** (recommended for external clients: MCP servers, scripts, ChatGPT custom connectors)


    Send your key in the `X-API-Key` header OR as `Authorization: Bearer emile_live_...`.


    Generate keys from your iOS app: **Profil → Paramètres → Clés API**.


    **2. Supabase JWT** (used by the official iOS app — internal)


    Send `Authorization: Bearer `.


    ## Rate Limits


    All endpoints are rate-limited per user. See each endpoint''s documentation for specific limits.

    On exceeded: HTTP 429 with `Retry-After` header and `X-RateLimit-*` informational headers.


    | Endpoint | Limit |

    |---|---|

    | `POST /scan` | 10/min, 50/day |

    | `POST /me/scan:batch` | 5/hour |

    | `POST /recommendations` | 20/min, 100/day |

    | `POST /cellars/{id}/bottles` | 60/min, 500/day |

    | `POST /me/bottles:batch` | 10/hour, 50/day |

    | `POST /me/keys` | 5/hour, 20/day |'
  version: '1.0'
tags:
- name: RAG internal
paths:
  /internal/knowledge/search:
    post:
      tags:
      - RAG internal
      summary: Internal Search
      description: 'Internal-traffic search (same logic as /knowledge/search) auth''d via

        X-Internal-Secret rather than a user JWT. Used by the n8n content pipeline

        so it doesn''t need to impersonate a real Émile user.'
      operationId: internal_search_internal_knowledge_search_post
      parameters:
      - name: x-internal-secret
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Internal-Secret
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchQuery'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Internal Search Internal Knowledge Search Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /internal/knowledge/search_grounded:
    post:
      tags:
      - RAG internal
      summary: Internal Search Grounded
      description: 'RAG + Exa web search merged into a single result list.


        Used by the n8n content pipeline when curated RAG alone is too sparse

        (most pillars except ''vins''/''appellations'' have no FR content). Both

        legs fire in parallel; Exa is best-effort (returns [] on key missing or

        upstream error) so RAG outages don''t take the whole call down.'
      operationId: internal_search_grounded_internal_knowledge_search_grounded_post
      parameters:
      - name: x-internal-secret
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Internal-Secret
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchQuery'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Internal Search Grounded Internal Knowledge Search Grounded Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /internal/knowledge/bulk_insert:
    post:
      tags:
      - RAG internal
      summary: Bulk Insert
      description: 'Insert pre-embedded chunks. The ingestion script computes embeddings

        in bulk (cheaper than per-query) and pushes them here.'
      operationId: bulk_insert_internal_knowledge_bulk_insert_post
      parameters:
      - name: x-internal-secret
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Internal-Secret
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkInsertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Bulk Insert Internal Knowledge Bulk Insert Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /internal/knowledge/by_source/{source}:
    delete:
      tags:
      - RAG internal
      summary: Delete By Source
      description: 'Wipe all knowledge_chunks rows for a given source name. Used by the

        ingestion script before re-running a source — bulk_insert is not

        idempotent on (source, source_url, content_text), so a re-run would

        otherwise duplicate everything that was already ingested.'
      operationId: delete_by_source_internal_knowledge_by_source__source__delete
      parameters:
      - name: source
        in: path
        required: true
        schema:
          type: string
          title: Source
      - name: x-internal-secret
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Internal-Secret
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete By Source Internal Knowledge By Source  Source  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BulkInsertRequest:
      properties:
        chunks:
          items:
            $ref: '#/components/schemas/KnowledgeChunk'
          type: array
          title: Chunks
      type: object
      required:
      - chunks
      title: BulkInsertRequest
      description: 'Wrapper for the bulk_insert payload — keeps the door open for

        future top-level metadata (batch_id, source_run, etc.) without breaking

        the wire format.'
    KnowledgeChunk:
      properties:
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
        source:
          type: string
          title: Source
        source_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Url
        content_text:
          type: string
          minLength: 10
          title: Content Text
        content_embedding:
          anyOf:
          - items:
              type: number
            type: array
          - type: 'null'
          title: Content Embedding
        language:
          type: string
          enum:
          - fr
          - en
          title: Language
        pillar:
          type: string
          enum:
          - vins
          - viticulture
          - cave
          - sommellerie
          - accord
          - appellations
          title: Pillar
        topic:
          anyOf:
          - type: string
          - type: 'null'
          title: Topic
        token_count:
          anyOf:
          - type: integer
          - type: 'null'
          title: Token Count
      type: object
      required:
      - source
      - content_text
      - language
      - pillar
      title: KnowledgeChunk
      description: A single ingested chunk with metadata.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    SearchQuery:
      properties:
        query:
          type: string
          minLength: 2
          title: Query
        language:
          type: string
          enum:
          - fr
          - en
          title: Language
          default: fr
        pillars:
          anyOf:
          - items:
              type: string
              enum:
              - vins
              - viticulture
              - cave
              - sommellerie
              - accord
              - appellations
            type: array
          - type: 'null'
          title: Pillars
        top_k:
          type: integer
          maximum: 20.0
          minimum: 1.0
          title: Top K
          default: 8
      type: object
      required:
      - query
      title: SearchQuery
      description: Input for /knowledge/search.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer