

You’re thinking of retrieval augmented generation (RAG) with a vector database. Its something that’s being actively developed. I haven’t had time to dig much into it, especially currently. But the terms themselves should give you a starting point.
Edit: a quick google gives what could be a promising starting point https://huggingface.co/learn/cookbook/rag_llamaindex_librarian
Shame they’re making that harder going forward by removing pixel specific info from the build tree