Comments (3)
hi @tonyqus we might not have any short term plan, but the memory builder allows to plug in custom implementations, so I would suggest developing that and similar extensions as nugets, adding the corresponding With...()
extension methods.
from kernel-memory.
how about the TextGenerations? i was able to reuse my custom classes that i use with SK. that's nice that the interfaces are the same but i'm getting some weirdness. at each memory.ImportDocumentAsync, i see the embedding results from my GenerateEmbeddingsAsync implementation. i'm assuming the kernelMemory has some built-in storage behind the scenes because i'm not explicitly calling it here like i would in SK. so my questions are:
- why do i need to have .WithCustomTextGeneration(new AmazonTitanTextGeneration())? if i remove this line, i'll get an error telling me i don't have an ITextGeneration registered
- await memory.AskAsync seems to fire GenerateEmbeddingsAsync again. why? is this method also supposed to search the storage?
- why am i getting INFO NOT FOUND?
i implemented it like this:
var memory = new KernelMemoryBuilder()
.WithCustomTextGeneration(new AmazonClaudeV2TextGeneration())
.WithCustomEmbeddingGeneration(new AmazonTitanTextEmbeddingGeneration())
.Build();
await memory.ImportDocumentAsync("context1.pdf");
await memory.ImportDocumentAsync("context2.pdf");
await memory.ImportDocumentAsync("context3.pdf");
var answer1 = await memory.AskAsync("question about context");
but i get the error: INFO NOT FOUND
from kernel-memory.
hi @curlyfro
at each memory.ImportDocumentAsync, i see the embedding results from my GenerateEmbeddingsAsync implementation
that's correct. When importing a document, the text is exported, chunked, and for each chunk an embedding is generated with AmazonTitanTextEmbeddingGeneration
and the embedding is saved. Since you're not specifying a vector db storage, the vector is stored in RAM, hence it's lost after the program ends.
why do i need to have .WithCustomTextGeneration(new AmazonTitanTextGeneration())?
The text generator is used in 2 places:
- To Summarize the document, if you are using summaries. Summaries where enabled by default until a couple of versions ago. In the latest versions a document is summarized only if you pass the corresponding step, and looks like you are not.
- To Answer questions. A question is generated using the RAG pattern, that involves a call to a text generator.
await memory.AskAsync seems to fire GenerateEmbeddingsAsync again. why? is this method also supposed to search the storage?
That's correct. The system generates an embedding of the question, in order to find similar chunks. The question is passed to the embedding generator, and then the system searches the vector DB for similar embeddings.
why am i getting INFO NOT FOUND?
It really depends on the content of your files and the question. Here's some options:
- If the files don't contain an answer that's the usual reason.
- there could also be a bug. If you try with OpenAI what happens?
- how good are AmazonTitan embeddings at capturing the meaning of documents and the meaning of questions? maybe Titan needs some special settings, I'm not familiar with it.
from kernel-memory.
Related Issues (20)
- Using the Semantic Kernel plugin raises the error "System.Collections.Generic.KeyNotFoundException: 'The given key 'url' was not present in the dictionary.'" HOT 4
- IDEA: Include directions for building and running Kernel Memory as a container HOT 2
- Search There was an error while searching--update to 0.22.231216.1 HOT 1
- KeyNotFoundException: The given key 'url' was not present in the dictionary. HOT 1
- Make the `Service` available as a NuGet package HOT 8
- Home grown Tokenization library vs. Microsoft Tokenizer library HOT 1
- SimpleQueues: After the handle exception, it will continue to be executed repeatedly HOT 2
- Error while running example 003-dotnet-Serverless using TextCompletition
- Support Running as Serverless but with Data Persistence HOT 3
- Allow template prompt using "AskAsync" HOT 1
- Semantic Kernel plugin - sample with reference HOT 1
- Answers not related to facts HOT 1
- Feature request: Basic AND/OR support for tags filtering. HOT 3
- Support for Upsert operation in IKernelMemory HOT 5
- KernelMemory Crash with LLamaSharp Embedder during Importing Document HOT 1
- [QUESTION] About security filters scenarios with many groups HOT 8
- KernelMemory: Include tags in answer's "RelevantSources" HOT 2
- [Bug] Incorrect detection of embedding generator
- [Bug] Text embedding generator for LLamaSharp fails during token count. HOT 2
- [Feature Request] Document - load string content HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kernel-memory.