Skip to main content

The official Python SDK for the Cortex AI platform.

Project description

# Introduction

> You can generate and manage API keys from your Cortex Dashboard. All endpoints require an API key sent as a Bearer token in the Authorization header.

Welcome to the Cortex SDK API Reference. This section documents every available endpoint and how to interact with them to power AI apps and agents with intelligent memory and retrieval.

> Base URL: `https://api.usecortex.ai`
>
> Contact us to get your API key at [founders@usecortex.ai](mailto:founders@usecortex.ai)

```mdx
Authorization: Bearer <your_api_key>

Data Ingestion

Upload and import content into Cortex from various sources.

  • /upload/upload_document — Upload single documents
  • /upload/upload_text — Upload text/markdown content
  • /upload/upload_app_sources — Import from workplace apps (Gmail, Slack, etc.)
  • /upload/scrape_webpage — Scrape and index web content
  • /upload/verify_processing — Check upload processing status
  • /upload/batch_upload — Upload multiple files at once

Search & Query

Retrieve answers and information from your knowledge base.

  • /search/qna — Main search endpoint with AI-powered responses. Supports optional metadata parameter to filter sources by source_title or source_type.
  • /search/retrieve — Hybrid search without AI generation. Returns structured search results for custom processing. – /search/full-text-search – Perform a full text search without AI generation. Allows you to use operators like logical AND, OR

Knowledge Management

Browse, fetch, and manage your knowledge base.

  • /list/sources — Browse all indexed sources
  • /list/sources_by_id — Get specific sources by ID
  • /fetch/fetch_content — Retrieve file content and download URLs
  • /delete_source — Remove sources from knowledge base

Update & Upsert

Update existing content and embeddings. If a source_id does not exist, these endpoints upsert (create or update).

  • /upload/update_text — Upsert markdown/text content by source_id
  • /upload/update_document — Upsert a file/document by source_id
  • /upload/update_webpage — Re-scrape and upsert a webpage by source_id and web_url
  • /upload/update_embeddings — Update existing embeddings by chunk_id within a batch/source

Embeddings

Manage and query pre-computed embeddings.

  • /upload/upload_embeddings — Upload embeddings and get generated chunk_ids
  • /embeddings/search — Vector similarity search; returns nearest chunk_ids and scores
  • /embeddings/by-chunk-ids — Retrieve embedding vectors for specific chunk_ids
  • /embeddings/delete — Delete embeddings by chunk_id

Tenant Management

Create and monitor tenants for multi-tenant setups.

  • /user/create_tenant — Create a tenant (optionally provide tenant_id, or auto-generate)
  • /embeddings/create_embeddings_tenant — Create an embeddings-only tenant (sets sub_tenant_id = tenant_id); use when directly uploading/searching embeddings
  • /tenant/stats — Get tenant stats (object count, vector dimension, identifiers)

User Memory

Personalize, retrieve, and manage user-specific AI memories for advanced agentic workflows.

  • /user_memory/list_user_memories — Browse user memories
  • /user_memory/retrieve_user_memory — Get specific user memories
  • /user_memory/add_user_memory — Manually add user-specific memories
  • /user_memory/generate_user_memory — AI-generated personalized memories
  • /user_memory/delete_user_memory — Remove user memories

💡 Best Practices

  • Use sub-tenants to support multi-user isolation in B2B use cases.
  • Leverage metadata (e.g., source_title, source_type in the QnA API) for fine-grained filtering and agentic retrieval.
  • Tune search_alpha and recency_bias to control relevance.
  • Enable highlight_chunks for chunk-level citations.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usecortex_ai-0.3.0.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usecortex_ai-0.3.0-py3-none-any.whl (108.6 kB view details)

Uploaded Python 3

File details

Details for the file usecortex_ai-0.3.0.tar.gz.

File metadata

  • Download URL: usecortex_ai-0.3.0.tar.gz
  • Upload date:
  • Size: 62.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for usecortex_ai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a366fdac2da8051c1ba3b139025b3a20bad016c28125c99d3cd1792b58b8ec54
MD5 cbd66374d85fbe24afa8bbe2a0b3a3c3
BLAKE2b-256 6acb8e87c6b29db6ed9b24c98c56b98dee1c8f23faccc6ac1eb067bb1568752d

See more details on using hashes here.

File details

Details for the file usecortex_ai-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: usecortex_ai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 108.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for usecortex_ai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cacd1b46e09e27a0f93e8d284ef8f835fef34bd205317d992c1d84ec0752f0a
MD5 d7d80062310ca88bd54f59a0da9224be
BLAKE2b-256 62f93d0957e6ec3f4570e46a618a9f58381135762d53b4710a7a23b7bfded92f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page