Capture and recall via HTTP nodes inside Dify AI workflows.

Dify Integration

Dify is a visual platform for building AI apps. Use its HTTP Request node to call CortexDB endpoints inside any workflow.

Capture node — POST /v1/experience

Method:  POST
URL:     https://api-v1.cortexdb.ai/v1/experience
Headers: Authorization: Bearer {{#env.CORTEX_TOKEN#}}
         X-Cortex-Actor: service:dify
         Content-Type: application/json
Body:    {
           "scope": "org:acme/user:{{#sys.user_id#}}",
           "modality": "conversation",
           "content": { "kind": "message", "role": "user", "text": "{{#sys.query#}}" },
           "context": { "observed_at": "{{#sys.time#}}" },
           "idempotency_key": "dify-{{#sys.conversation_id#}}-{{#sys.run_id#}}"
         }

Recall node — POST /v1/recall

URL:  https://api-v1.cortexdb.ai/v1/recall
Body: { "scope": "org:acme/user:{{#sys.user_id#}}",
        "view": "holistic",
        "query": "{{#sys.query#}}",
        "include": ["beliefs", "facts", "episodes"],
        "budgets": { "max_tokens": 3000 } }

Wire $.context_block into the LLM node's system prompt.

See also