Integrations
Semantic Kernel
Build AI plugins with Semantic Kernel that retrieve grounded context from Aether.
Semantic Kernel uses a plugin architecture where native functions are registered on the kernel and can be called from prompt templates or by the AI planner. By wrapping Aether as a plugin, the kernel can automatically pull relevant context from your document store when answering questions. This works with both direct prompt invocation and Semantic Kernel's planning capabilities.
Prerequisites
Install the Aether SDK alongside the Semantic Kernel package for your language.
pip install aether-ai semantic-kernel
Environment variables
Configuration
Set the following environment variables before running the examples below.
OPENAI_API_KEY— your OpenAI API key (required).AETHER_API_KEY— your Aether API key, loaded and passed to the client below (optional for unauthenticated deployments).
Swappable LLM
Semantic Kernel supports Azure OpenAI, Anthropic, Google, and other providers via connector packages. Swap the chat completion service to use a different LLM backend.
Full working example
The AetherPlugin class exposes a Search kernel function that retrieves relevant documents from Aether. When registered on the kernel, this function can be called from prompt templates using the {{Aether.Search "query"}} syntax. The kernel resolves the function call, injects the results into the prompt, and sends the complete prompt to the LLM.
import asyncio
import os
from aether import AsyncAetherClient
from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
from semantic_kernel.functions import kernel_function
class AetherPlugin:
"""Semantic Kernel plugin for Aether document search."""
def __init__(self, client: AsyncAetherClient):
self._client = client
@kernel_function(
name="search",
description="Search the knowledge base for relevant documents",
)
async def search(self, query: str) -> str:
results = await self._client.retrieve(query, k=3)
return "\n\n".join(
f"[{r.title or r.doc_id}]\n{r.content}" for r in results
)
async def main():
aether = AsyncAetherClient(api_key=os.environ.get("AETHER_API_KEY"))
kernel = Kernel()
kernel.add_service(OpenAIChatCompletion(ai_model_id="gpt-4o"))
kernel.add_plugin(AetherPlugin(aether), plugin_name="Aether")
result = await kernel.invoke_prompt(
"Using the following context, answer the question.\n\n"
"Context: {{Aether.search 'What is the 401k match policy?'}}\n\n"
"Question: What is the company's 401k match policy?"
)
print(result)
await aether.close()
asyncio.run(main())