Python SDK for Cognify AI platform
Project description
Cognify Python SDK
A comprehensive Python SDK for the Cognify AI platform, providing easy access to document management, search, RAG (Retrieval-Augmented Generation), and conversation capabilities.
🚀 Features
- 📄 Document Management: Upload, process, and manage documents with metadata
- 🔍 Search & Query: Semantic, keyword, and hybrid search capabilities
- 🤖 RAG Operations: Retrieval-Augmented Generation for intelligent Q&A
- 💬 Conversations: Chat and conversation management with context
- 📁 Collections: Organize documents into collections with permissions
- 🏢 Multi-tenant Support: Organization-level isolation and workspaces
- 🔐 Authentication: Secure API key and JWT token support
- ⚡ Async/Sync Support: Both asynchronous and synchronous API methods
- 🎯 Type Safety: Full type hints and Pydantic models
- 🛡️ Error Handling: Comprehensive exception hierarchy
Installation
pip install cognify-sdk
Quick Start
from cognify_sdk import CognifyClient
# Initialize the client
client = CognifyClient(api_key="your_api_key")
# Upload a document
with open("document.pdf", "rb") as f:
document = client.documents.upload(
name="My Document",
file=f,
metadata={"category": "research"}
)
# Search documents
results = client.query.search(
query="artificial intelligence",
limit=10
)
# Start a conversation
conversation = client.conversations.create(
title="AI Discussion",
initial_message="What is artificial intelligence?"
)
Async Support
The SDK supports both synchronous and asynchronous operations:
import asyncio
from cognify_sdk import CognifyClient
async def main():
async with CognifyClient(api_key="your_api_key") as client:
# Async operations
documents = await client.documents.alist()
results = await client.query.asearch("machine learning")
asyncio.run(main())
Configuration
Configure the SDK using environment variables or direct parameters:
# Environment variables
export COGNIFY_API_KEY="your_api_key"
export COGNIFY_BASE_URL="https://api.cognify.ai"
export COGNIFY_TIMEOUT=30
# Direct configuration
client = CognifyClient(
api_key="your_api_key",
base_url="https://api.cognify.ai",
timeout=60,
max_retries=3,
debug=True
)
Development Status
This SDK is currently in active development. The following modules are planned:
- Core Client Architecture
- Authentication Module
- Documents Module
- Query/Search Module
- RAG/Agents Module
- Conversations Module
- Collections/Organizations Module
Requirements
- Python 3.11+
- httpx >= 0.25.0
- pydantic >= 2.0.0
License
MIT License - see LICENSE file for details.
Support
For support and questions, please contact support@cognify.ai or visit our documentation at https://docs.cognify.ai
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognify_sdk-0.1.0.tar.gz.
File metadata
- Download URL: cognify_sdk-0.1.0.tar.gz
- Upload date:
- Size: 178.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16fc83cd1b36ce3aa32a3ef1ed1870844cb0f2d6007a92fe155afdd459d1586a
|
|
| MD5 |
6181833d94cf0593c87aa0d8fab0db16
|
|
| BLAKE2b-256 |
94af918f39abc9d55b08f5aee8e83bf186443ff1a2576f34b26cddccc400dbc8
|
File details
Details for the file cognify_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cognify_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 87.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
001d97b9e942b5478ddc336e15e775318e2aa2e25970f07347597dfb92b87e7b
|
|
| MD5 |
ed1b4d7d008c439f61f55050ddbf3eb7
|
|
| BLAKE2b-256 |
c01d1ca67732285b05f0d7fa39a6e8dcd450a2358e78000bd931af0bb244b8a9
|