You are reading the documentation of OpenCTI 7.260811 LTS · 7.260811.0-lts.1, supported until 2027-09.Latest is 7.261119.0 →
How-to guide

Extract intelligence from documents on premises

Run the extraction web service of the Import Document AI connector in your own stack, so that OpenCTI extracts threat intelligence from documents on premises.

OpenCTIEnterprise EditionFor platform engineers

The Import Document AI connector of OpenCTI extracts entities, observables and relationships from PDF, text, HTML and Markdown files, and imports them as a STIX bundle. It sends each document to an extraction web service, the one Filigran hosts or one you run. This page runs that web service in your own stack, for an air-gapped network or to keep documents on your premises, and points the connector to it.

DOCUMENTSOPENCTICONNECTORON YOUR PREMISESDocumentsPDF, text, HTML, MarkdownOpenCTIData > ImportImportDocumentAIconnector-import-document-aiExtraction web serviceimport-document-ai-webservice:8000Your language modelai:endpoint, such as vLLM
  1. Documents → OpenCTI: upload
  2. OpenCTI → ImportDocumentAI: launch import
  3. ImportDocumentAI → Extraction web service: document and license
  4. ImportDocumentAI → OpenCTI: STIX bundle
  5. OpenCTI → Your language model: summaries, search, text
OpenCTI hands each imported document to the connector, which sends it to the extraction web service in your stack and imports the STIX bundle, while the other AI features call the model of the ai keys

New in 7.260811 LTS The connector has no default address: without an XTM One agent, it needs the address of a web service and your license certificate, or every import fails with No agent_slug provided and api_base_url/api_key is not configured.

Before you start

  • OpenCTI with an Enterprise Edition license, and the license certificate that Filigran gave you, in PEM format: the connector sends it to the web service.

  • An access token to the private Docker repository of Filigran, from your Customer Success Manager or Account Manager.

  • A host that fits the web service. These figures come from Filigran; extraction time depends on the size of the file.

    With a GPUWithout a GPU
    ComputingAn NVIDIA GPUCPU at 3 GHz or more
    RAM8 GB16 GB
    Disk16 GB16 GB
    Average extraction time5 to 10 seconds30 seconds to 2 minutes
  • The stack installed as Install with Docker Compose describes.

Run the web service

  1. Sign in to the private repository of Filigran, and enter the token when Docker asks for the password.

    docker login --username filigrancustomers
    

    To run the service where Docker Hub is not reachable, pull filigran/import-document-ai-webservice here and push it to your own registry.

  2. Add the service to docker-compose.override.yml, under services:, as Change the stack without editing docker-compose.yml describes. It listens on port 8000 inside the stack; the connector reaches it there, so it needs no published port. Keep the deploy block only on a host with an NVIDIA GPU.

      import-document-ai-webservice:
        image: filigran/import-document-ai-webservice
        restart: always
        deploy:
          resources:
            reservations:
              devices:
                - driver: nvidia
                  count: 1
                  capabilities: [gpu]
    
  3. Start it.

    docker compose pull import-document-ai-webservice
    docker compose up -d import-document-ai-webservice
    
    Check that it worked
    docker compose ps import-document-ai-webservice
    

    The service is running.

Point the connector to it

The connector is not part of xtm-docker. Add it to docker-compose.override.yml with the address of your web service.

  1. Give the connector an identifier in .env.

    echo "CONNECTOR_IMPORT_DOCUMENT_AI_ID=$(python3 -c 'import uuid; print(uuid.uuid4())')" >> .env
    
  2. Add the connector under services:, with your license certificate in place of the three certificate lines: the whole PEM text, from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----, indented as shown.

      connector-import-document-ai:
        image: opencti/connector-import-document-ai:latest
        environment:
          OPENCTI_URL: http://opencti:8080
          OPENCTI_TOKEN: ${OPENCTI_ADMIN_TOKEN}
          CONNECTOR_ID: ${CONNECTOR_IMPORT_DOCUMENT_AI_ID}
          CONNECTOR_NAME: ImportDocumentAI
          CONNECTOR_SCOPE: application/pdf,text/plain,text/html,text/markdown
          CONNECTOR_AUTO: "false"
          CONNECTOR_LOG_LEVEL: info
          IMPORT_DOCUMENT_AI_API_BASE_URL: http://import-document-ai-webservice:8000
          IMPORT_DOCUMENT_AI_API_KEY: |
            -----BEGIN CERTIFICATE-----
            Your license certificate
            -----END CERTIFICATE-----
        depends_on:
          opencti:
            condition: service_healthy
        restart: always
    

    New in 7.260811 LTS The connector calls /stix under IMPORT_DOCUMENT_AI_API_BASE_URL.

    Use the image tag of your OpenCTI version in place of latest, as for the other connectors.

  3. Start the connector.

    docker compose up -d connector-import-document-ai
    
  4. In OpenCTI, go to Data, then Import, upload a PDF file, and launch an import with the connector ImportDocumentAI.

    Check that it worked

    The import completes and its entities appear in OpenCTI.

    New in 7.260811 LTS The connector log names your web service:

    docker compose logs connector-import-document-ai | grep "HTTP Post Request"
    

    The line holds http://import-document-ai-webservice:8000/stix.

If the import fails with ImportDocumentAI webservice seems to be unreachable, the connector cannot reach the address you set: check the service name and the port.

Connect OpenCTI to your own language model

The connector above handles documents only. The other AI features of OpenCTI, such as the summaries of an entity, the search in natural language and the text generation in the editors, call the language model set in the ai keys of the platform. To keep those prompts on your premises too, point these keys to a model you host.

KeyDefaultWhat it does
ai:enablednot setSet to true to connect the model. Unset or false, the AI features have no model
ai:typemistralaiThe API of the model: mistralai, openai or azureopenai. With ai:enabled and ai:token set, any other value stops the platform at start
ai:endpointemptyURL of the model API. Empty: the public cloud of the provider. For the Mistral AI cloud, set https://api.mistral.ai: with mistralai and any other URL, OpenCTI calls an OpenAI-compatible API at the URL followed by /v1, as a model served by vLLM exposes
ai:tokenemptyThe API key. Without it, the AI features have no model
ai:modelemptyThe model name, as the API knows it
ai:max_tokens30000Length of the prompt sent to the model. Despite its name, OpenCTI cuts the prompt to this number of characters, not tokens
app:ai:timeout60000Time, in milliseconds, a search in natural language waits for the model before it fails. Raise it for a slow model

For Azure OpenAI, set ai:type to azureopenai, with ai:version, the API version of your deployment, ai:ai_azure_instance, the instance name, such as example-cert for https://example-cert.openai.azure.com, and ai:ai_azure_deployment, the deployment name.

Two keys of config/default.json have no effect: ai:timeout, since the timeout is read from app:ai:timeout (APP__AI__TIMEOUT), and ai:model_images, which no code reads. The platform also needs the Generative AI (AI Insight, NLQ) switch on, in Settings, then Filigran Experience. Every other AI key is in the AI Service section of the configuration reference.

ExampleUse the model of Example CERT's GPU cluster

Example CERT serves a Mistral model with vLLM at https://llm.example.com, behind its own API key, kept in .env as OPENCTI_AI_TOKEN. It adds to docker-compose.override.yml:

services:
  opencti:
    environment:
      - AI__ENABLED=true
      - AI__TYPE=mistralai
      - AI__ENDPOINT=https://llm.example.com
      - AI__TOKEN=${OPENCTI_AI_TOKEN}
      - AI__MODEL=mistralai/Mistral-Small-3.2-24B-Instruct-2506
      - APP__AI__TIMEOUT=120000

After docker compose up -d opencti, the summaries and the search in natural language of OpenCTI use this model, and no prompt leaves the network.

What's next

NextMap tiles
Deploy
Install, configure, secure, scale and upgrade the platform.

Published

Overview
Run the XTM platform locally
OverviewDeploy with an AI agent