Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
byt3bl33d3r opened this issue Dec 2, 2024 · 5 comments
Open

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

byt3bl33d3r opened this issue Dec 2, 2024 · 5 comments

Comments

@byt3bl33d3r
Copy link

byt3bl33d3r commented Dec 2, 2024

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

@davidmezzetti
Copy link
Member

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

@byt3bl33d3r
Copy link
Author

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.

@davidmezzetti
Copy link
Member

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

@byt3bl33d3r
Copy link
Author

basically yes.

@davidmezzetti
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants