Sessions for different users

Hi, so recently I managed to make a chatbot using gpt-3.5 api with long-term memory (using semantic search).

So i want to have multiple users for my chatbot, each of the user has like its user_id. But then the problem is, how store the vectors in the db for different users?

Each of my logs has its uuid.json, and I stored it in user_id/uuid.json, so each user can have their own logs folder. But now the problem is just the vector though, since in pinecone it can only upsert (id, vector), hence the idea was to only upsert either user_id or uuid, but both of these just don’t work and result in conflicting matches.

Thank you, looking forward to hear from the people here who has experience in embeddings :grinning:

EDIT:
I made it work by using metadata filtering.

vdb.upsert((id, vector, metadata))
vdb.query(vector=vector, top_k=15, filter={"user_id":{"$eq":user_id}}, include_metadata=True)

Pinecone has a meta object you can use to store the user id. But that may not be ideal.

Depending on how many Embeddings per user, and your latency requirements, you could keep the Embeddings in simple file storage and load into memory when necessary.

Also, Postgres has some vector storage capabilities. In theory, you could create and index on user_id and run the similarity calculation from there.

Oh, I may try Postgres.

Do you mind to elaborate about this “simple file storage” for the Embeddings? Thank you.