shaolang

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_manual
  • read_webpage
  • search_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

jaywengrow

Author of A Common-Sense Guide to Data Structures and Algorithms

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?

Where Next?

Popular Pragmatic Bookshelf topics Top

iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
New
NaplesDave
@mfazio23 I am following along and I have gotten up to adding the data binding items. The project has built alright until I added the da...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New

Other popular topics Top

PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
New
First poster: AstonJ
Jan | Rethink the Computer. Jan turns your computer into an AI machine by running LLMs locally on your computer. It’s a privacy-focus, l...
New
PragmaticBookshelf
Explore the power of Ash Framework by modeling and building the domain for a real-world web application. Rebecca Le @sevenseacat and ...
New
NewsBot
Node.js v22.14.0 has been released. Link: Release 2025-02-11, Version 22.14.0 'Jod' (LTS), @aduh95 · nodejs/node · GitHub
New
PragmaticBookshelf
Use advanced functional programming principles, practical Domain-Driven Design techniques, and production-ready Elixir code to build scal...
New

Sub Categories: