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.2.0.tar.gz (45.2 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.2.0-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: usecortex_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 45.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 98dfa9b04faef56858e8704e39da03a21ab7d9d5c6633eefb0746c8ba4d39ab6
MD5 7c14dc092ddb485f6d1d57610e236863
BLAKE2b-256 0343de94ab56223c2068388f41b5cc56b0451b479b5ccce48360c8fb654d4f07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: usecortex_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 80.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b596633183fada6ef7fe889464856a782dfffba06d588a7a4a32692ece9b571d
MD5 7fb0ce704f1235a2577ccd670407aa11
BLAKE2b-256 588027319658f9a9fca354a68ba5f606e951838154a793ef76c011f2024c229b

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