shaolang
A Common-Sense Guide to AI Engineering: Appending results to rag_chunks in research_docs (sub-agent) (page: 216 and page 226)
hi, Jay
research_docs maintains a rag_chunks dictionary at the start of the function and the results from search_manual and read_webpage are added to it. This rag_chunks dictionary is then inserted in to the conversation as a the result of the function call, i.e., rag_chunks keeps building up within the research_docs function. Supposed the agent created the following function calls:
search_manualread_webpagesearch_manual
The research history would be similar to the following:
FUNCTION CALL: { call_id: 1, search_manual }
FUNCTION CALL OUTPUT: { call_id: 1, search_manual_output_1 }
FUNCTION CALL: { call_id: 2, read_webpage }
FUNCTION CALL OUTPUT: { call_id: 2, search_manual_output_1, read_webpage_output_1 }
FUNCTION CALL: { call_id: 3, search_manual }
FUNCTION CALL OUTPUT: { call_id: 3, search_manual_output_1, read_webpage_output_1 , search_manual_output_2}
It is unlike flow discussed on page 226.
Question then is: which is the desired outcome? The code on page 216 (with repeated outputs) or the discussion on 226 (without repeated outputs)? My hunch is the latter.
First Post!
jaywengrow
Thanks for this! I think I see what you’re saying. You mean to say that search_manual shouldn’t have to return the entire rag_chunks again, but rather only the new chunks that were found by the most recent search. Is that what you mean?
Popular Pragmatic Bookshelf topics
Other popular topics
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /emacs
- /haskell
- /typescript
- /svelte
- /onivim
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /vscode
- /flutter
- /elm
- /ash
- /html
- /deepseek
- /opensuse
- /zig
- /centos
- /php
- /scala
- /react-native
- /lisp
- /sublime-text
- /textmate
- /nixos
- /debian
- /agda
- /deno
- /django
- /kubuntu
- /arch-linux
- /nodejs
- /spring
- /ubuntu
- /revery
- /manjaro
- /julia
- /lua
- /diversity
- /laravel
- /markdown









