neuml/txtai

How to index() or upsert() only on specific index?

Opened this issue · 5 comments

Heyo,

Love txtai, amazing work.

I have two subindexes and want to perform an upsert() on only one of the subindexes:
Basically I'd want something like this:

    embeddings = Embeddings({
        "indexes": {
            "raw" : CONFIG,
            "llm": CONFIG
        }
    })

embeddings.upsert((id, text, tags),  index='raw'))

Is this something that's supported? I don't see anything in the docs about it

Hello. Thank you for the kind words. I haven't considered the use case. What would be the downside in updating both indexes?

In my specific situation, I'd want the llm index to have LLM generated summaries of the content in the raw index and can search() them separately.

So the main thing is you want to index the raw first then come back and upsert with the summaries?

basically yes.

And it wouldn't be possible to generate the summaries and upload at the same time?

With the current functionality, the best thing would be to have two separate embeddings indexes. I'll think if there is a way to support something like this though.