Skip to contents

What This Agent Does

build_interpreter_agent() turns technical outputs (tables, metrics, model summaries) into plain-language interpretation.

Workflow Diagram

Generate Mermaid PNGs

library(LLMAgentR)

my_llm_wrapper <- function(prompt, verbose = FALSE) "LLM response placeholder"

workflow <- build_interpreter_agent(
  llm = my_llm_wrapper,
  output = "both",
  direction = "LR"
)

save_mermaid_png(
  x = workflow,
  file = "pkgdown/assets/interpreter-agent-workflow.png"
)

Step 1: Build a Reusable Interpreter

library(LLMAgentR)

my_llm_wrapper <- function(prompt, verbose = FALSE) "LLM response placeholder"

interpreter <- build_interpreter_agent(
  llm = my_llm_wrapper,
  verbose = FALSE
)

Step 2: Interpret an Output

table_txt <- "
| Region | Sales | Profit |
| North  | 2000  | 300    |
| South  | 1500  | 250    |"

result <- interpreter(table_txt)
str(result)

Notes for Beginners

  • The closure pattern lets you reuse one configured agent.
  • Main fields: success, attempts, and interpretation.
  • Keep raw technical output in your records for traceability.