what semantic kernel uses to store vector data and search vector data? #104
-
|
Hi I am a Java developer and am very confused about what semantic kernel uses to store vector data and search vector data. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi @xiguazhiPrince - We have a sample in PR right now (a GitHub repository exploration / Q&A chat sample) that showcases how to use memories; see: #96 if you'd like to peruse. See the GitHubskill.cs class for how we're wrapping memories/embeddings. Then see QASkill/MemoryQuery, skprompt.txt for how we're pulling the memories back out of storage to include in questions (prompts) given to the AI. This will go to Main shortly (lots of fast moving PR comments on it rn). Memories (embedding) storage is abstracted and pluggable in Semantic Kernel. In Main right now we enable storing them in a Dictionary (for quick testing) and SQLite on disk. In the future we'll extend to Qdrant and other memory providers (in the cloud, local, etc.). @awharrison-28 and @tawalke are experts in this space and can go deeper if you'd like. |
Beta Was this translation helpful? Give feedback.
-
|
Semantic Kernel's vector storage story has evolved quite a bit. Here's a quick breakdown: Built-in connectors (as of recent SK versions):
// Wiring up a vector store
var builder = Kernel.CreateBuilder();
builder.AddOpenAIChatCompletion("gpt-4o", apiKey);
// Option 1: In-memory (dev/testing)
builder.Services.AddSingleton<IMemoryStore, VolatileMemoryStore>();
// Option 2: Qdrant for production
builder.Services.AddQdrantMemoryStore("http://localhost:6333", 1536);
var kernel = builder.Build();
var memory = new SemanticTextMemory(
kernel.Services.GetRequiredService<IMemoryStore>(),
kernel.Services.GetRequiredService<ITextEmbeddingGenerationService>()
);Recommendation by use case:
For agent memory specifically (storing per-agent conversation history and learned facts), I've found that the metadata filtering support matters a lot — not all connectors implement More on memory architecture for persistent agents: https://blog.kinthai.ai/why-character-ai-forgets-you-persistent-memory-architecture |
Beta Was this translation helpful? Give feedback.
Hi @xiguazhiPrince -
We have a sample in PR right now (a GitHub repository exploration / Q&A chat sample) that showcases how to use memories; see: #96 if you'd like to peruse. See the GitHubskill.cs class for how we're wrapping memories/embeddings. Then see QASkill/MemoryQuery, skprompt.txt for how we're pulling the memories back out of storage to include in questions (prompts) given to the AI. This will go to Main shortly (lots of fast moving PR comments on it rn).
Memories (embedding) storage is abstracted and pluggable in Semantic Kernel. In Main right now we enable storing them in a Dictionary (for quick testing) and SQLite on disk. In the future we'll extend to Qdrant and other memor…