TechnologyMarch 26, 2024

Microsoft and DataStax Simplify Building AI Agents with Legacy Apps and Data

Announcing a new integration that enables Astra DB to function as a vector store within Microsoft’s Semantic Kernel app orchestration framework.
Greg Stachnick
Greg StachnickProduct, DataStax
Microsoft and DataStax Simplify Building AI Agents with Legacy Apps and Data

Companies often have hundreds or even thousands of existing applications that they want to bring into the AI world. Microsoft’s Semantic Kernel is an open-source SDK that helps solve this challenge, by making it easy to build generative AI agents that can call existing code. We’re excited to announce the new integration of Semantic Kernel and DataStax Astra DB that enables developers to more easily build upon their current codebase, vectorize the data, and build production-grade GenAI apps and AI agents that utilize the relevance and precision provided by retrieval-augmented generation (RAG). 

What’s so cool about Semantic Kernel? 

Semantic Kernel is a GenAI/RAG application and agent orchestration framework in Microsoft’s stack of AI copilots and models. In many ways, it’s similar to LangChain and LlamaIndex, but with more focus on enabling intelligent agents. Semantic Kernel provides capabilities for managing contextual conversations including previous chats, prompt history, and conversations, as well as planners for multi-step functions and connections (plug-ins) for third-party APIs to enable RAG grounded in enterprise data (learn more about why RAG is critical to generating responses that aren’t only contextually accurate but also information-rich here). 

Another cool thing about Semantic Kernel is that prompts written for a Python version during app iteration can be used by the C# version for much faster execution at runtime. Semantic Kernel is also proven on Microsoft Azure for Copilot and has reference frameworks for developers to build their own scalable copilots with Azure. 

Introducing the Astra DB connector

With this in mind, we have contributed the Astra DB connector in Python. This connector enables Astra DB to function as a vector database within Semantic Kernel. It's a game-changer for developers building RAG applications that want to use Semantic Kernel’s unique framework features for contextual conversations or intelligent agents, or for those targeting the Microsoft AI and Azure ecosystem. The integration allows for the storage of embeddings and the performance of semantic searches with unprecedented ease.

By combining Semantic Kernel with Astra DB, developers can build powerful RAG applications with extended contextual conversation capabilities (such as managing chat and prompt histories) and multi-function or planner capabilities, on a globally scalable vector database proven to give more relevant and faster query responses. 

A performance booster for Python developers

While this release will benefit a broad swath of the GenAI developer community, it’s of particular interest to those who work in the Microsoft/Azure ecosystem. By integrating Astra DB directly into Semantic Kernel, developers can now leverage Astra DB as a data source in their existing applications, streamlining the development process and enhancing application performance.

To add Astra DB support to a Semantic Kernel application, simply import the module and register the memory store:

# import Astra DB connector
import semantic_kernel as sk
from semantic_kernel.connectors.memory.astradb import AstraDBMemoryStore

# create Astra memory store
store = AstraDBMemoryStore(ASTRA_DB_TOKEN, ASTRA_DB_ID, ASTRA_REGION, KEYSPACE, EMBEDDING_DIMENSION, SIMILARITY)

#register Astra memory in Semantic Kernel Memory
memory = SemanticTextMemory(storage=store, embeddings_generator=kernel.get_service("text_embedding"))

Unlocking new possibilities

The integration of Astra DB and Semantic Kernel extends beyond technical enhancements, paving the way for a range of business use cases from personalized customer service to intelligent product recommendations and beyond. It's not just about making development easier; it's about enabling the creation of more intelligent, responsive, and personalized AI applications that can transform industries.

For more information, check out the Astra DB documentation.

Discover more
Retrieval-augmented generationVector Search
Share

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.