Skip to main content

Python SDK for CortexDB — a RAG-powered memory database

Project description

CortexDB Python SDK

PyPI version PyPI downloads PyPI - Python Version

A Python client for the CortexDB RAG backend, providing easy access to ingestion, querying, and LLM orchestration.

Features

  • Setup API: Configure LLM providers (Gemini, OpenAI, Azure).
  • Ingest API: Ingest documents with automatic embedding generation.
  • Query API: Perform semantic search, entity retrieval, and graph traversals.
  • Native LLM Integration: Uses google-genai for native Gemini support.

Installation

pip install cortexdb-py

Or visit the package on PyPI.

Usage

See main.py for a complete example of setting up a medical chatbot.

from cortexdb import CortexDB

db = CortexDB("http://localhost:8080")

# Setup
db.setup.configure(provider="GEMINI", api_key="...", chat_model="gemini-2.0-flash", embed_model="gemini-embedding-001")

# Ingest
db.ingest.document(uid="user-1", document_title="Test Doc", document_text="Hello world")
db.ingest.prompt(uid="user-1", converser="USER", text="What is this?")

# Query
results = db.query.search_contexts("Hello", limit=5)

Testing

pip install pytest respx
pytest tests/

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

cortexdb_py-0.2.15.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

cortexdb_py-0.2.15-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file cortexdb_py-0.2.15.tar.gz.

File metadata

  • Download URL: cortexdb_py-0.2.15.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.17.0-1010-azure

File hashes

Hashes for cortexdb_py-0.2.15.tar.gz
Algorithm Hash digest
SHA256 e7a51ca0fdb7e539c9ac5f9dcde6744bf3a6a12ad674286359863c3cb71309ac
MD5 e95423a0ba63e7175109e54de3cdac9c
BLAKE2b-256 b6c1353a484bc5434f6e6ae6ce26899e639b9880181e7c2f3f440d664a0007e8

See more details on using hashes here.

File details

Details for the file cortexdb_py-0.2.15-py3-none-any.whl.

File metadata

  • Download URL: cortexdb_py-0.2.15-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.17.0-1010-azure

File hashes

Hashes for cortexdb_py-0.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 0ddff8c55773f2d7961d514a8f835022587c672fd069ba051c3c6d6512e43dd3
MD5 cccfdb74372e04c0df3a0ffd28f5a360
BLAKE2b-256 84d53f0af17fb4d134dd8491aac8f84671737b5520e2dec84db20c5fa6ecd315

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