Not in general, sorry. Best bet is to make sure you’re using the most recent kernel, which Ubuntu tends to lag on. You can also try checking out the arch wiki entry for it. It’s a different distro, but the wiki is good and commonly has tips relevant for any distro.
Not sure how ollama integration works in general, but these are two good libraries for RAG:
https://github.com/facebookresearch/faiss
https://pypi.org/project/chromadb/