Code Monkey home page Code Monkey logo

Comments (6)

dluc avatar dluc commented on May 18, 2024 1

@xbotter have you considere using tags and filters?

E.g. rather than multiple files in the one document, uploading multiple documents with the same tag:

var knowledgeBase1 = "001":
var knowledgeBase2 = "ABC":

await memory.ImportDocumentAsync(new Document()
            .AddFile("file1.pdf").AddTag("KnowledgeBase", knowledgeBase1));

await memory.ImportDocumentAsync(new Document()
            .AddFile("file2.pdf").AddTag("KnowledgeBase", knowledgeBase1));

await memory.ImportDocumentAsync(new Document()
            .AddFile("file3.pdf").AddTag("KnowledgeBase", knowledgeBase1));

await memory.ImportDocumentAsync(new Document()
            .AddFile("foobar.docx").AddTag("KnowledgeBase", knowledgeBase2));

var answer = await memory.AskAsync(question, 
                                   MemoryFilters.ByTag("KnowledgeBase", knowledgeBase1));

from kernel-memory.

dluc avatar dluc commented on May 18, 2024

Currently there's no API to directly edit the content of a document, and we use the ImportDocumentAsync API to refresh the document, passing the original Document ID, re-uploading the document without the file to remove.

We'll improve this area soon :-)

from kernel-memory.

dluc avatar dluc commented on May 18, 2024

We added the ability to delete documents. It doesn't fully address your question but it might help if you put one file per document.

from kernel-memory.

xbotter avatar xbotter commented on May 18, 2024

In my use case, I am trying to use Document as a knowledge database that can be managed in the form of maintaining files.
This requires performing operations to add, delete, and replace files in the Document.

I wonder if this scenario can be supported from semantic memory or if there are better practical methods available?

from kernel-memory.

xbotter avatar xbotter commented on May 18, 2024

Thanks @dluc , I have successfully fulfilled my use case based on your suggestions and reference documents.

from kernel-memory.

xbotter avatar xbotter commented on May 18, 2024

We added the ability to delete documents. It doesn't fully address your question but it might help if you put one file per document.

Delete and then re-upload, it worked.

from kernel-memory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.