@@ -9,10 +9,10 @@ and project deployment.
99
1010## Overview
1111
12- Docs Agent apps use a technique known as Retrieval Augmented Generation (RAG), which allows
13- you to bring your own documents as knowledge sources to AI language models. This approach
14- helps the AI language models to generate relevant and accurate responses that are grounded
15- in the information that you provide and control.
12+ Docs Agent apps use a technique known as Retrieval Augmented Generation (RAG), which
13+ allows you to bring your own documents as knowledge sources to AI language models.
14+ This approach helps the AI language models to generate relevant and accurate responses
15+ that are grounded in the information that you provide and control.
1616
1717![ Docs Agent architecture] ( docs/images/docs-agent-architecture-01.png )
1818
@@ -26,66 +26,43 @@ the [Set up Docs Agent][set-up-docs-agent] section below.
2626
2727The following list summarizes the tasks and features supported by Docs Agent:
2828
29- - ** Process Markdown** : Split Markdown files into small plain text files. (See the
30- Python scripts in the [ ` preprocess ` ] [ preprocess-dir ] directory.)
31- - ** Generate embeddings** : Use an embedding model to process small plain text files
32- into embeddings, and store them in a vector database. (See the
33- [ ` populate_vector_database.py ` ] [ populate-vector-database ] script.)
34- - ** Perform semantic search** : Compare embeddings in the vector database to retrieve
35- most relevant content given user questions.
36- - ** Add context to a user question** : Add a list of text chunks returned from
37- a semantic search as context in a prompt. (See the
38- [ Structure of a prompt to a language model] [ prompt-structure ] section.)
39- - ** (Experimental) “Fact-check” responses** : This experimental feature composes
29+ - ** Process Markdown** : Split Markdown files into small plain text chunks. (See
30+ [ Docs Agent chunking process] [ chunking-process ] .)
31+ - ** Generate embeddings** : Use an embedding model to process text chunks into embeddings
32+ and store them in a vector database.
33+ - ** Perform semantic search** : Compare embeddings in a vector database to retrieve
34+ chunks that are most relevant to user questions.
35+ - ** Add context to a user question** : Add chunks returned from a semantic search as
36+ [ context] [ prompt-structure ] to a prompt.
37+ - ** Fact-check responses** : This [ experimental feature] [ fact-check-section ] composes
4038 a follow-up prompt and asks the language model to “fact-check” its own previous response.
41- (See the [ Using a language model to fact-check its own response] [ fact-check-section ]
42- section.)
43- - ** Generate related questions** : In addition to displaying a response to the user
44- question, the web UI displays 5 questions generated by the language model based on
45- the context of the user question. (See the
46- [ Using a language model to suggest related questions] [ related-questions-section ]
47- section.)
48- - ** Return URLs of documentation sources** : Docs Agent's vector database stores URLs
49- as metadata next to embeddings. Whenever the vector database is used to retrieve
50- text chunks for context, the database can also return the URLs of the sources used
51- to generate the embeddings.
52- - ** Collect feedback from users** : Docs Agent's chatbot web UI includes buttons that
53- allow users to [ like generated responses] [ like-generated-responses ] or
54- [ submit rewrites] [ submit-a-rewrite ] .
39+ - ** Generate related questions** : In addition to answering a question, Docs Agent can
40+ [ suggest related questions] [ related-questions-section ] based on the context of the
41+ question.
42+ - ** Return URLs of source documents** : URLs are stored as chunks' metadata. This enables
43+ Docs Agent to return the URLs of the source documents.
44+ - ** Collect feedback from users** : Docs Agent's web app has buttons that allow users
45+ to [ like responses] [ like-generated-responses ] or [ submit rewrites] [ submit-a-rewrite ] .
5546- ** Convert Google Docs, PDF, and Gmail into Markdown files** : This feature uses
56- Apps Script to convert Google Docs, PDF, and Gmail into Markdown files, which then
57- can be used as input datasets for Docs Agent. (See the
58- [ ` apps_script ` ] [ apps-script-readme ] directory.)
59- - ** Run benchmark test to monitor the quality of AI-generated responses** : Using
60- Docs Agent, you can run [ benchmark test] [ benchmark-test ] to measure and compare
61- the quality of text chunks, embeddings, and AI-generated responses.
62- - ** Use the Semantic Retrieval API and AQA model** : You can use Gemini's
63- [ Semantic Retrieval API] [ semantic-api ] to upload source documents to an online
64- corpus and use the [ AQA model] [ aqa-model ] that is specifically created for answering
65- questions using an online corpus.
66- - ** Manage online corpora using the Docs Agent CLI** : The Docs Agent CLI enables you
67- to create, populate, update and delete online corpora using the Semantic Retrieval AI.
68- For the list of all available Docs Agent command lines, see the
69- [ Docs Agent CLI reference] [ cli-reference ] page.
70- - ** Run the Docs Agent CLI from anywhere in a terminal** : You can set up the
71- Docs Agent CLI to ask questions to the Gemini model from anywhere in a terminal.
72- For more information, see the [ Set up Docs Agent CLI] [ cli-readme ] page.
73- - ** Support the Gemini 1.5 models** : You can use the new Gemini 1.5 models,
74- ` gemini-1.5-pro-latest ` and ` text-embedding-004 ` , with Docs Agent today.
75- For the moment, the following ` config.yaml ` setup is recommended:
76-
77- ```
78- models:
79- - language_model: "models/aqa"
80- embedding_model: "models/text-embedding-004"
81- api_endpoint: "generativelanguage.googleapis.com"
82- ...
83- app_mode: "1.5"
84- db_type: "chroma"
85- ```
86-
87- The setup above uses 3 Gemini models to their strength: AQA (` aqa ` ),
88- Gemini 1.0 Pro (` gemini-pro ` ), and Gemini 1.5 Pro (` gemini-1.5-pro-latest ` ).
47+ [ Apps Script] [ apps-script-readme ] to convert Google Docs, PDF, and Gmail into
48+ Markdown files, which then can be used as input datasets for Docs Agent.
49+ - ** Run benchmark test** : Docs Agent can [ run benchmark test] [ benchmark-test ] to measure
50+ and compare the quality of text chunks, embeddings, and AI-generated responses.
51+ - ** Use the Semantic Retrieval API and AQA model** : Docs Agent can use Gemini's
52+ [ Semantic Retrieval API] [ semantic-api ] to upload source documents to online corpora
53+ and use the [ AQA model] [ aqa-model ] for answering questions.
54+ - ** Manage online corpora using the Docs Agent CLI** : The [ Docs Agent CLI] [ cli-reference ]
55+ lets you create, update and delete online corpora using the Semantic Retrieval AI.
56+ - ** Prevent duplicate chunks and delete obsolete chunks in databases** : Docs Agent
57+ uses [ metadata in chunks] [ chunking-process ] to prevent uploading duplicate chunks
58+ and delete obsolete chunks that are no longer present in the source.
59+ - ** Run the Docs Agent CLI from anywhere in a terminal** :
60+ [ Set up the Docs Agent CLI] [ cli-readme ] to make requests to the Gemini models
61+ from anywhere in a terminal.
62+ - ** Support the Gemini 1.5 models** : Docs Agent works with the Gemini 1.5 models,
63+ ` gemini-1.5-pro-latest ` and ` text-embedding-004 ` . The new [ "1.5"] [ new-15-mode ] web app
64+ mode uses all three Gemini models to their strength: AQA (` aqa ` ), Gemini 1.0 Pro
65+ (` gemini-pro ` ), and Gemini 1.5 Pro (` gemini-1.5-pro-latest ` ).
8966
9067For more information on Docs Agent's architecture and features,
9168see the [ Docs Agent concepts] [ docs-agent-concepts ] page.
@@ -122,26 +99,26 @@ Update your host machine's environment to prepare for the Docs Agent setup:
12299
1231001 . Update the Linux package repositories on the host machine:
124101
125- ``` posix-terminal
102+ ```
126103 sudo apt update
127104 ```
128105
1291062 . Install the following dependencies:
130107
131- ``` posix-terminal
108+ ```
132109 sudo apt install git pipx python3-venv
133110 ```
134111
1351123 . Install ` poetry ` :
136113
137- ``` posix-terminal
114+ ```
138115 pipx install poetry
139116 ```
140117
1411184 . To add ` $HOME/.local/bin ` to your ` PATH ` variable, run the following
142119 command:
143120
144- ``` posix-terminal
121+ ```
145122 pipx ensurepath
146123 ```
147124
@@ -157,7 +134,7 @@ Update your host machine's environment to prepare for the Docs Agent setup:
157134
1581356 . Update your environment:
159136
160- ``` posix-termainl
137+ ```
161138 source ~/.bashrc
162139 ```
163140
@@ -202,25 +179,25 @@ Clone the Docs Agent project and install dependencies:
202179
2031801 . Clone the following repo:
204181
205- ``` posix-terminal
182+ ```
206183 git clone https://github.com/google/generative-ai-docs.git
207184 ```
208185
2091862 . Go to the Docs Agent project directory:
210187
211- ``` posix-terminal
188+ ```
212189 cd generative-ai-docs/examples/gemini/python/docs-agent
213190 ```
214191
2151923 . Install dependencies using ` poetry ` :
216193
217- ``` posix-terminal
194+ ```
218195 poetry install
219196 ```
220197
2211984 . Enter the ` poetry ` shell environment:
222199
223- ``` posix-terminal
200+ ```
224201 poetry shell
225202 ```
226203
@@ -437,3 +414,5 @@ Meggin Kearney (`@Meggin`), and Kyo Lee (`@kyolee415`).
437414[ oauth-client ] : https://ai.google.dev/docs/oauth_quickstart#set-cloud
438415[ cli-readme ] : docs_agent/interfaces/README.md
439416[ cli-reference ] : docs/cli-reference.md
417+ [ chunking-process ] : docs/chunking-process.md
418+ [ new-15-mode ] : docs/config-reference.md#app_mode
0 commit comments