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 docs are added when using the agent_query method? #727

Open
n400peanuts opened this issue Nov 27, 2024 · 1 comment
Open

how docs are added when using the agent_query method? #727

n400peanuts opened this issue Nov 27, 2024 · 1 comment
Labels
question Further information is requested

Comments

@n400peanuts
Copy link

I am trying to understand how documents are loaded, stored and embeddings created when using the agent_query method. This method works well and I would like to know what's working under the hood in order to save the embeddings created via this method.

Copy link

dosubot bot commented Nov 27, 2024

In the agent_query method, documents are handled as follows:

  1. Loading Documents: If the docs parameter is not provided, a new Docs object is initialized. This object is used to manage the documents that will be processed.

  2. Storing Documents: The method sets up a SearchIndex to store the answers and related data. This index is configured with fields such as "question" and uses a JSON model dump for storage. The index is named "answers" and is saved in the directory specified by query.settings.agent.index.index_directory.

  3. Creating Embeddings: The embeddings are created and stored in the SearchIndex. The add_document method is used to add the document to the index, and the save_index method is used to save the index. This process involves embedding the query into a vector, ranking document chunks, and generating an answer using a language model [1].

This setup ensures that documents are properly loaded, stored, and that embeddings are created and saved efficiently.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the question Further information is requested label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant