News

Azure Cosmos DB Python SDK Update Powers AI with OpenAI Integration

Microsoft released Azure Cosmos DB Python SDK version 4.14.0, a stable update designed to support advanced AI workloads and enhance performance for data-driven applications. The release includes new APIs and configuration options that improve developer productivity, resilience, and integration with OpenAI-based solutions.

The company said the SDK was built in collaboration with OpenAI, which relies on Azure Cosmos DB to store ChatGPT data at massive scale. The result is a set of capabilities optimized for retrieval-augmented generation (RAG), semantic search, and large-scale, low-latency workloads that power modern AI systems.

A key feature in this release is the Semantic Reranking API, currently in private preview. It introduces AI-powered document ranking directly inside Cosmos DB containers, allowing developers to reorder query results by semantic relevance instead of keyword matches. The API uses Azure inference services to understand meaning and context, enabling more intelligent search results and streamlined AI data pipelines. Developers can sign up for access and experiment with the sample Python demo published with the release.

The SDK also introduces the new read_items API for optimized batch retrieval. This feature enables reading multiple documents in one call, reducing network round trips by up to 90 percent compared to individual point reads. The SDK automatically groups items by partition and constructs optimized backend queries, cutting both latency and Request Unit (RU) consumption. The improvement is designed to help developers working with distributed, partitioned data at scale.

Another enhancement is automatic write retries, a feature that improves reliability by handling transient write failures transparently. The SDK now supports built-in retry logic for timeouts, transient connectivity issues, and server-side errors. Multi-region Cosmos DB accounts benefit from cross-regional failover capabilities, while single-region accounts gain faster error recovery without manual retry code.

The release also adds several developer experience improvements. Client-level configuration now supports setting custom user agent strings for telemetry tracking, enabling more granular visibility into application behavior. Developers can also activate throughput bucket headers to track RU consumption at a detailed level, and configure excluded regions to manage multi-region preferences at the client or request level. A new return_properties option lets developers retrieve both container references and their properties in a single call, streamlining setup operations.

Microsoft said the SDK has been battle-tested in production and incorporates feedback from enterprise users running high-scale AI systems. Many of its optimizations were developed while supporting OpenAI's massive data pipelines, ensuring that the SDK is capable of sustaining the demands of generative AI and real-time semantic workloads.

Azure Cosmos DB Python SDK 4.14.0 is available now through the Python Package Index (PyPI). Full documentation, onboarding information for Semantic Reranking, and code samples are provided in the official announcement on the Azure Cosmos DB Blog at devblogs.microsoft.com.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • VS Code 1.127 Further Integrates Advanced Browser-AI Tech

    Microsoft's July 1 Visual Studio Code update continues a recent push to make the editor's integrated browser a more capable development surface -- and a more useful tool for AI agents.

  • Support Vector Regression with SGD Training Using C#

    Support vector regression can predict numeric values effectively, and this article shows how to implement and train a kernel SVR model in C# using stochastic sub-gradient descent.

  • New GitHub Switch Limits Repo Issue Creation to Collaborators Only

    After publicly touting pull request limits as a way to cut maintainer noise, GitHub is taking the same idea further with a new setting that lets repository admins restrict issue creation to collaborators only.

  • Uno Platform Helps Ship First Stable SkiaSharp 4.0 Release for 2D .NET Graphics

    SkiaSharp 4.148.0 is the first stable v4 release, bringing a newer Skia engine, API cleanup, performance work and a Microsoft-Uno co-maintenance model.

Subscribe on YouTube