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 connect with the knowledge base #42

Closed
anan1213095357 opened this issue Jun 6, 2024 · 4 comments
Closed

How to connect with the knowledge base #42

anan1213095357 opened this issue Jun 6, 2024 · 4 comments

Comments

@anan1213095357
Copy link

How to connect with the knowledge base

@mili-tan
Copy link
Contributor

mili-tan commented Jun 6, 2024

Maybe you should try LangChain or Semantic Kernel, or learn how Retrieval Augmented Generation (RAG) works and implement the search yourself using OllamaApiClient.GenerateEmbeddings and some vector database.

@anan1213095357
Copy link
Author

Maybe you should try LangChain or Semantic Kernel, or learn how Retrieval Augmented Generation (RAG) works and implement the search yourself using OllamaApiClient.GenerateEmbeddings and some vector database.

I understand that retrieval vectors can be saved, but how can the vectors obtained through GenerateEmbedding be output as text?

@mili-tan
Copy link
Contributor

mili-tan commented Jun 7, 2024

I understand that retrieval vectors can be saved, but how can the vectors obtained through GenerateEmbedding be output as text?

It doesn't seem to work like that way, the vectors resulting from Embedding are only used to compare similarity distances. You may need to make the association between the vectors and the original text yourself. Vector databases can usually have text or id attached to them.
https://platform.openai.com/docs/tutorials/web-qa-embeddings

@awaescher
Copy link
Owner

This is not in the context of the Ollama API alone, so it's out of range of this project. @mili-tan is right, you should use langchain or semantic kernel for this.
There are tons of articles out there, I think this one is a good one to start:

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

3 participants