-
Recently I started experimenting with Aspire and I was wondering if anyone managed to run Kernel Memory in an Aspire project and if yes how did you manage to ensure that all other depended service has started before Kernel Memory (Storage Emulator)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
KM settings can be passed using env vars, so it's possible to use env vars to override defaults stored in appsettings.json. Normally, one would create an 'appsettings.development.json` defining all the configs and which dependencies. You can do that via env vars. Once you've idenfied all the env vars, you can simply add KM project to the Aspire Host, like any other project. You can also run KM using the docker image, with Aspire docker support. About how to start the dependencies, that's all in the Aspire Host project, I would suggest checking out Aspire docs and tutorials, that show how to start docker images or simple processes. |
Beta Was this translation helpful? Give feedback.
-
Here's an example of KM with Qdrant: var builder = DistributedApplication.CreateBuilder(args);
var qdrant = builder.AddContainer("qdrant", "qdrant/qdrant")
.WithHttpEndpoint(targetPort: 6333)
.PublishAsContainer();
var qdrantEndpoint = qdrant.GetEndpoint("http");
builder.AddProject<Projects.Service>("kernel-memory")
.WaitFor(qdrant)
.WithEnvironment("KernelMemory__TextGeneratorType", "AzureOpenAIText")
.WithEnvironment("KernelMemory__DataIngestion__EmbeddingGeneratorTypes__0", "AzureOpenAIEmbedding")
.WithEnvironment("KernelMemory__DataIngestion__MemoryDbTypes__0", "Qdrant")
.WithEnvironment("KernelMemory__Retrieval__EmbeddingGeneratorType", "AzureOpenAIEmbedding")
.WithEnvironment("KernelMemory__Retrieval__MemoryDbType", "Qdrant")
.WithEnvironment("KernelMemory__Services__Qdrant__Endpoint", qdrantEndpoint)
.WithEnvironment("KernelMemory__Services__Qdrant__APIKey", "")
.WithEnvironment("KernelMemory__Services__AzureOpenAIText__Endpoint", "https://....openai.azure.com/")
.WithEnvironment("KernelMemory__Services__AzureOpenAIText__Deployment", "gpt-4o")
.WithEnvironment("KernelMemory__Services__AzureOpenAIEmbedding__Endpoint", "https://....openai.azure.com/")
.WithEnvironment("KernelMemory__Services__AzureOpenAIEmbedding__Deployment", "text-embedding-ada-002");
builder.Build().Run(); |
Beta Was this translation helpful? Give feedback.
Here's an example of KM with Qdrant: