{"id":87593,"date":"2026-05-02T15:53:45","date_gmt":"2026-05-02T15:53:45","guid":{"rendered":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/"},"modified":"2026-05-02T15:53:45","modified_gmt":"2026-05-02T15:53:45","slug":"a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset","status":"publish","type":"post","link":"https:\/\/youzum.net\/es\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/","title":{"rendered":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset"},"content":{"rendered":"<p>In this tutorial, we explore the<strong> <\/strong><a href=\"https:\/\/huggingface.co\/datasets\/lambda\/hermes-agent-reasoning-traces\"><strong>lambda\/hermes-agent-reasoning-traces dataset<\/strong><\/a><strong> <\/strong>to understand how agent-based models think, use tools, and generate responses across multi-turn conversations. We start by loading and inspecting the dataset, examining its structure, categories, and conversational format to get a clear idea of the available information. We then build simple parsers to extract key components such as reasoning traces, tool calls, and tool responses, allowing us to separate internal thinking from external actions. Also, we analyze patterns such as tool usage frequency, conversation length, and error rates to better understand agent behavior. We also create visualizations to highlight these trends and make the analysis more intuitive. Finally, we prepare the dataset for training by converting it into a model-friendly format, making it suitable for tasks like supervised fine-tuning.<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\"no-line-numbers\"><code class=\"no-wrap language-php\">!pip -q install -U datasets pandas matplotlib seaborn transformers accelerate trl\n\n\nimport json, re, random, textwrap\nfrom collections import Counter, defaultdict\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom datasets import load_dataset, concatenate_datasets\n\n\nrandom.seed(0)\n\n\nCONFIG = \"kimi\"\nds = load_dataset(\"lambda\/hermes-agent-reasoning-traces\", CONFIG, split=\"train\")\nprint(ds)\nprint(\"Config:\", CONFIG, \"| Fields:\", ds.column_names)\nprint(\"Categories:\", sorted(set(ds[\"category\"])))\n\n\nCOMPARE_BOTH = False\nif COMPARE_BOTH:\n   ds_kimi = load_dataset(\"lambda\/hermes-agent-reasoning-traces\", \"kimi\", split=\"train\")\n   ds_glm  = load_dataset(\"lambda\/hermes-agent-reasoning-traces\", \"glm-5.1\", split=\"train\")\n   ds_kimi = ds_kimi.add_column(\"source\", [\"kimi\"] * len(ds_kimi))\n   ds_glm  = ds_glm.add_column(\"source\", [\"glm-5.1\"] * len(ds_glm))\n   ds = concatenate_datasets([ds_kimi, ds_glm]).shuffle(seed=0)\n   print(\"Combined:\", ds, \"\u2192 counts:\", Counter(ds[\"source\"]))\n\n\nsample = ds[0]\nprint(\"n=== Sample 0 ===\")\nprint(\"id        :\", sample[\"id\"])\nprint(\"category  :\", sample[\"category\"], \"\/\", sample[\"subcategory\"])\nprint(\"task      :\", sample[\"task\"])\nprint(\"turns     :\", len(sample[\"conversations\"]))\nprint(\"system[0] :\", sample[\"conversations\"][0][\"value\"][:220], \"...n\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>We install all required libraries and import the necessary modules to set up our environment. We then load the lambda\/hermes-agent-reasoning-traces dataset and inspect its structure, fields, and categories. We also optionally combine multiple dataset configurations and examine a sample to understand the conversational format.<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\"no-line-numbers\"><code class=\"no-wrap language-php\">THINK_RE     = re.compile(r\"&lt;think&gt;(.*?)&lt;\/think&gt;\", re.DOTALL)\nTOOL_CALL_RE = re.compile(r\"&lt;tool_call&gt;s*({.*?})s*&lt;\/tool_call&gt;\", re.DOTALL)\nTOOL_RESP_RE = re.compile(r\"&lt;tool_response&gt;s*(.*?)s*&lt;\/tool_response&gt;\", re.DOTALL)\n\n\ndef parse_assistant(value: str) -&gt; dict:\n   thoughts = [t.strip() for t in THINK_RE.findall(value)]\n   calls = []\n   for raw in TOOL_CALL_RE.findall(value):\n       try:\n           calls.append(json.loads(raw))\n       except json.JSONDecodeError:\n           calls.append({\"name\": \"&lt;malformed&gt;\", \"arguments\": {}})\n   final = TOOL_CALL_RE.sub(\"\", THINK_RE.sub(\"\", value)).strip()\n   return {\"thoughts\": thoughts, \"tool_calls\": calls, \"final\": final}\n\n\ndef parse_tool(value: str):\n   raw = TOOL_RESP_RE.search(value)\n   if not raw: return {\"raw\": value}\n   body = raw.group(1)\n   try:    return json.loads(body)\n   except: return {\"raw\": body}\n\n\nfirst_gpt = next(t for t in sample[\"conversations\"] if t[\"from\"] == \"gpt\")\np = parse_assistant(first_gpt[\"value\"])\nprint(\"Thought preview :\", (p[\"thoughts\"][0][:160] + \"...\") if p[\"thoughts\"] else \"(none)\")\nprint(\"Tool calls       :\", [(c.get(\"name\"), list(c.get(\"arguments\", {}).keys())) for c in p[\"tool_calls\"]])<\/code><\/pre>\n<\/div>\n<\/div>\n<p>We define regex-based parsers to extract reasoning traces, tool calls, and tool responses from the dataset. We process assistant messages to separate thoughts, actions, and final outputs in a structured way. We then test the parser on a sample conversation to verify that the extraction works correctly.<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\"no-line-numbers\"><code class=\"no-wrap language-php\">N = 3000\nsub = ds.select(range(min(N, len(ds))))\n\n\ntool_calls         = Counter()\nparallel_widths    = Counter()\nthoughts_per_turn  = []\ncalls_per_traj     = []\nerrors_per_traj    = []\nturns_per_traj     = []\ncat_counts         = Counter()\n\n\nfor ex in sub:\n   cat_counts[ex[\"category\"]] += 1\n   n_calls = n_err = 0\n   turns_per_traj.append(len(ex[\"conversations\"]))\n   for t in ex[\"conversations\"]:\n       if t[\"from\"] == \"gpt\":\n           p = parse_assistant(t[\"value\"])\n           thoughts_per_turn.append(len(p[\"thoughts\"]))\n           if p[\"tool_calls\"]:\n               parallel_widths[len(p[\"tool_calls\"])] += 1\n               for c in p[\"tool_calls\"]:\n                   tool_calls[c.get(\"name\", \"&lt;unknown&gt;\")] += 1\n               n_calls += len(p[\"tool_calls\"])\n       elif t[\"from\"] == \"tool\":\n           r = parse_tool(t[\"value\"])\n           blob = json.dumps(r).lower()\n           if \"error\" in blob or '\"exit_code\": 1' in blob or \"traceback\" in blob:\n               n_err += 1\n   calls_per_traj.append(n_calls)\n   errors_per_traj.append(n_err)\n\n\nprint(f\"nScanned {len(sub)} trajectories\")\nprint(f\"Avg turns\/traj      : {np.mean(turns_per_traj):.1f}\")\nprint(f\"Avg tool calls\/traj : {np.mean(calls_per_traj):.1f}\")\nprint(f\"% with &gt;=1 error    : {100*np.mean([e&gt;0 for e in errors_per_traj]):.1f}%\")\nprint(f\"% parallel turns    : {100*sum(v for k,v in parallel_widths.items() if k&gt;1)\/max(1,sum(parallel_widths.values())):.1f}%\")\nprint(\"Top 10 tools        :\", tool_calls.most_common(10))\n\n\nfig, axes = plt.subplots(2, 2, figsize=(13, 9))\n\n\ntop = tool_calls.most_common(15)\naxes[0,0].barh([t for t,_ in top][::-1], [c for _,c in top][::-1], color=\"teal\")\naxes[0,0].set_title(\"Top 15 tools by call volume\")\naxes[0,0].set_xlabel(\"calls\")\n\n\nks = sorted(parallel_widths)\naxes[0,1].bar([str(k) for k in ks], [parallel_widths[k] for k in ks], color=\"coral\")\naxes[0,1].set_title(\"Tool-calls per assistant turn (parallel width)\")\naxes[0,1].set_xlabel(\"# tool calls in one turn\"); axes[0,1].set_ylabel(\"count\")\naxes[0,1].set_yscale(\"log\")\n\n\naxes[1,0].hist(turns_per_traj, bins=40, color=\"steelblue\")\naxes[1,0].set_title(\"Conversation length\"); axes[1,0].set_xlabel(\"turns\")\n\n\ncats, vals = zip(*cat_counts.most_common())\naxes[1,1].pie(vals, labels=cats, autopct=\"%1.0f%%\", startangle=90)\naxes[1,1].set_title(\"Category distribution\")\n\n\nplt.tight_layout(); plt.show()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>We perform dataset-wide analytics to measure tool usage, conversation lengths, and error patterns. We aggregate statistics across multiple samples to understand overall agent behavior. We also create visualizations to highlight trends such as tool frequency, parallel calls, and category distribution.<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\"no-line-numbers\"><code class=\"no-wrap language-php\">def render_trace(ex, max_chars=350):\n   print(f\"n{'='*72}nTASK [{ex['category']} \/ {ex['subcategory']}]: {ex['task']}n{'='*72}\")\n   for t in ex[\"conversations\"]:\n       role = t[\"from\"]\n       if role == \"system\":\n           continue\n       if role == \"human\":\n           print(f\"n[USER]n{textwrap.shorten(t['value'], 600)}\")\n       elif role == \"gpt\":\n           p = parse_assistant(t[\"value\"])\n           for th in p[\"thoughts\"]:\n               print(f\"n[THINK]n{textwrap.shorten(th, max_chars)}\")\n           for c in p[\"tool_calls\"]:\n               args = json.dumps(c.get(\"arguments\", {}))[:200]\n               print(f\"[CALL] {c.get('name')}({args})\")\n           if p[\"final\"]:\n               print(f\"n[ANSWER]n{textwrap.shorten(p['final'], max_chars)}\")\n       elif role == \"tool\":\n           print(f\"[TOOL_RESPONSE] {textwrap.shorten(t['value'], 220)}\")\n   print(\"=\"*72)\n\n\nidx = int(np.argmin(np.abs(np.array(turns_per_traj) - 10)))\nrender_trace(sub[idx])\n\n\ndef get_tool_schemas(ex):\n   try:    return json.loads(ex[\"tools\"])\n   except: return []\n\n\nschemas = get_tool_schemas(sample)\nprint(f\"nSample 0 has {len(schemas)} tools available\")\nfor s in schemas[:3]:\n   fn = s.get(\"function\", {})\n   print(\" -\", fn.get(\"name\"), \"\u2014\", (fn.get(\"description\") or \"\")[:80])\n\n\nROLE_MAP = {\"system\": \"system\", \"human\": \"user\", \"gpt\": \"assistant\", \"tool\": \"tool\"}\n\n\ndef to_openai_messages(conv):\n   return [{\"role\": ROLE_MAP[t[\"from\"]], \"content\": t[\"value\"]} for t in conv]\n\n\nexample_msgs = to_openai_messages(sample[\"conversations\"])\nprint(\"nFirst 2 OpenAI messages:\")\nfor m in example_msgs[:2]:\n   print(\" \", m[\"role\"], \"\u2192\", m[\"content\"][:120].replace(\"n\", \" \"), \"...\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>We build utilities to render full conversation traces in a readable format for deeper inspection. We also extract tool schemas and convert the dataset into OpenAI-style message format for compatibility with training pipelines. This helps us better understand both the structure of tools and how conversations can be standardized.<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\"no-line-numbers\"><code class=\"no-wrap language-php\">from transformers import AutoTokenizer\nTOK_ID = \"Qwen\/Qwen2.5-0.5B-Instruct\"\ntok = AutoTokenizer.from_pretrained(TOK_ID)\n\n\ndef build_masked(conv, tokenizer, max_len=2048):\n   msgs = to_openai_messages(conv)\n   for m in msgs:\n       if m[\"role\"] == \"tool\":\n           m[\"role\"] = \"user\"\n           m[\"content\"] = \"[TOOL OUTPUT]n\" + m[\"content\"]\n   input_ids, labels = [], []\n   for m in msgs:\n       text = tokenizer.apply_chat_template([m], tokenize=False, add_generation_prompt=False)\n       ids = tokenizer.encode(text, add_special_tokens=False)\n       input_ids.extend(ids)\n       labels.extend(ids if m[\"role\"] == \"assistant\" else [-100] * len(ids))\n   return input_ids[:max_len], labels[:max_len]\n\n\nids, lbls = build_masked(sample[\"conversations\"], tok)\ntrainable = sum(1 for x in lbls if x != -100)\nprint(f\"nTokenized example: {len(ids)} tokens, {trainable} trainable ({100*trainable\/len(ids):.1f}%)\")\n\n\nthink_lens, call_lens, ans_lens = [], [], []\nfor ex in sub.select(range(min(500, len(sub)))):\n   for t in ex[\"conversations\"]:\n       if t[\"from\"] != \"gpt\": continue\n       p = parse_assistant(t[\"value\"])\n       for th in p[\"thoughts\"]: think_lens.append(len(th))\n       for c in p[\"tool_calls\"]: call_lens.append(len(json.dumps(c)))\n       if p[\"final\"]: ans_lens.append(len(p[\"final\"]))\n\n\nplt.figure(figsize=(10,4))\nplt.hist([think_lens, call_lens, ans_lens], bins=40, log=True,\n        label=[\"&lt;think&gt;\", \"&lt;tool_call&gt;\", \"final answer\"], stacked=False)\nplt.legend(); plt.xlabel(\"characters\"); plt.title(\"Length distributions (log y)\")\nplt.tight_layout(); plt.show()\n\n\nclass TraceReplayer:\n   def __init__(self, ex):\n       self.ex = ex\n       self.steps = []\n       pending = None\n       for t in ex[\"conversations\"]:\n           if t[\"from\"] == \"gpt\":\n               if pending: self.steps.append(pending)\n               pending = {\"think\": parse_assistant(t[\"value\"]), \"responses\": []}\n           elif t[\"from\"] == \"tool\" and pending:\n               pending[\"responses\"].append(parse_tool(t[\"value\"]))\n       if pending: self.steps.append(pending)\n   def __len__(self): return len(self.steps)\n   def play(self, i):\n       s = self.steps[i]\n       print(f\"n\u2500\u2500 Step {i+1}\/{len(self)} \u2500\u2500\")\n       for th in s[\"think\"][\"thoughts\"]:\n           print(f\"<img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\" alt=\"\ud83d\udcad\" class=\"wp-smiley\" \/> {textwrap.shorten(th, 280)}\")\n       for c in s[\"think\"][\"tool_calls\"]:\n           print(f\"<img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/2699.png\" alt=\"\u2699\" class=\"wp-smiley\" \/>  {c.get('name')}({json.dumps(c.get('arguments', {}))[:140]})\")\n       for r in s[\"responses\"]:\n           print(f\"<img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4e5.png\" alt=\"\ud83d\udce5\" class=\"wp-smiley\" \/> {textwrap.shorten(json.dumps(r), 200)}\")\n       if s[\"think\"][\"final\"]:\n           print(f\"<img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ac.png\" alt=\"\ud83d\udcac\" class=\"wp-smiley\" \/> {textwrap.shorten(s['think']['final'], 200)}\")\n\n\nrp = TraceReplayer(sample)\nfor i in range(min(3, len(rp))):\n   rp.play(i)\n\n\nTRAIN = False\nif TRAIN:\n   import torch\n   from transformers import AutoModelForCausalLM\n   from trl import SFTTrainer, SFTConfig\n\n\n   train_subset = ds.select(range(200))\n\n\n   def to_text(batch):\n       msgs = to_openai_messages(batch[\"conversations\"])\n       for m in msgs:\n           if m[\"role\"] == \"tool\":\n               m[\"role\"] = \"user\"; m[\"content\"] = \"[TOOL]n\" + m[\"content\"]\n       batch[\"text\"] = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=False)\n       return batch\n\n\n   train_subset = train_subset.map(to_text)\n\n\n   model = AutoModelForCausalLM.from_pretrained(\n       TOK_ID,\n       torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,\n       device_map=\"auto\" if torch.cuda.is_available() else None,\n   )\n\n\n   cfg = SFTConfig(\n       output_dir=\"hermes-sft-demo\",\n       per_device_train_batch_size=1,\n       gradient_accumulation_steps=4,\n       max_steps=20,\n       learning_rate=2e-5,\n       logging_steps=2,\n       max_seq_length=1024,\n       dataset_text_field=\"text\",\n       report_to=\"none\",\n       fp16=torch.cuda.is_available(),\n   )\n   SFTTrainer(model=model, args=cfg, train_dataset=train_subset, processing_class=tok).train()\n   print(\"Fine-tune demo finished.\")\n\n\nprint(\"n<img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/2705.png\" alt=\"\u2705\" class=\"wp-smiley\" \/> Tutorial complete. You now have parsers, analytics, plots, a replayer, \"\n     \"tokenized + label-masked SFT examples, and an optional training hook.\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>We tokenize the conversations and apply label masking so only assistant responses contribute to training. We analyze the length distributions of reasoning, tool calls, and answers to gain further insights. We also implement a trace replayer to step through agent behavior and optionally run a small fine-tuning loop.<\/p>\n<p>In conclusion, we developed a structured workflow to parse, analyze, and work effectively with agent reasoning traces. We were able to break down conversations into meaningful components, examine how agents reason step by step, and measure how they interact with tools during problem solving. Using the visualizations and analytics, we gained insights into common patterns and behaviors across the dataset. In addition, we converted the data into a format suitable for training language models, including handling tokenization and label masking for assistant responses. Also, this process provides a strong foundation for studying, evaluating, and improving tool-using AI systems in a practical, scalable way.<\/p>\n<hr class=\"wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide\" \/>\n<p>Check out\u00a0the\u00a0<strong><a href=\"https:\/\/github.com\/Marktechpost\/AI-Agents-Projects-Tutorials\/blob\/main\/Agentic%20AI%20Codes\/hermes_agent_reasoning_traces_tutorial_marktechpost.py\" target=\"_blank\" rel=\"noreferrer noopener\">Full Codes with Notebook<\/a><\/strong>.<strong>\u00a0<\/strong>Also,\u00a0feel free to follow us on\u00a0<strong><a href=\"https:\/\/x.com\/intent\/follow?screen_name=marktechpost\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Twitter<\/mark><\/a><\/strong>\u00a0and don\u2019t forget to join our\u00a0<strong><a href=\"https:\/\/www.reddit.com\/r\/machinelearningnews\/\" target=\"_blank\" rel=\"noreferrer noopener\">130k+ ML SubReddit<\/a><\/strong>\u00a0and Subscribe to\u00a0<strong><a href=\"https:\/\/www.aidevsignals.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">our Newsletter<\/a><\/strong>. Wait! are you on telegram?\u00a0<strong><a href=\"https:\/\/t.me\/machinelearningresearchnews\" target=\"_blank\" rel=\"noreferrer noopener\">now you can join us on telegram as well.<\/a><\/strong><\/p>\n<p>Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?\u00a0<strong><a href=\"https:\/\/forms.gle\/MTNLpmJtsFA3VRVd9\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Connect with us<\/mark><\/a><\/strong><\/p>\n<p>The post <a href=\"https:\/\/www.marktechpost.com\/2026\/05\/02\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\">A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset<\/a> appeared first on <a href=\"https:\/\/www.marktechpost.com\/\">MarkTechPost<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we explore the lambda\/hermes-agent-reasoning-traces dataset to understand how agent-based models think, use tools, and generate responses across multi-turn conversations. We start by loading and inspecting the dataset, examining its structure, categories, and conversational format to get a clear idea of the available information. We then build simple parsers to extract key components such as reasoning traces, tool calls, and tool responses, allowing us to separate internal thinking from external actions. Also, we analyze patterns such as tool usage frequency, conversation length, and error rates to better understand agent behavior. We also create visualizations to highlight these trends and make the analysis more intuitive. Finally, we prepare the dataset for training by converting it into a model-friendly format, making it suitable for tasks like supervised fine-tuning. Copy CodeCopiedUse a different Browser !pip -q install -U datasets pandas matplotlib seaborn transformers accelerate trl import json, re, random, textwrap from collections import Counter, defaultdict import pandas as pd import numpy as np import matplotlib.pyplot as plt from datasets import load_dataset, concatenate_datasets random.seed(0) CONFIG = &#8220;kimi&#8221; ds = load_dataset(&#8220;lambda\/hermes-agent-reasoning-traces&#8221;, CONFIG, split=&#8221;train&#8221;) print(ds) print(&#8220;Config:&#8221;, CONFIG, &#8220;| Fields:&#8221;, ds.column_names) print(&#8220;Categories:&#8221;, sorted(set(ds[&#8220;category&#8221;]))) COMPARE_BOTH = False if COMPARE_BOTH: ds_kimi = load_dataset(&#8220;lambda\/hermes-agent-reasoning-traces&#8221;, &#8220;kimi&#8221;, split=&#8221;train&#8221;) ds_glm = load_dataset(&#8220;lambda\/hermes-agent-reasoning-traces&#8221;, &#8220;glm-5.1&#8243;, split=&#8221;train&#8221;) ds_kimi = ds_kimi.add_column(&#8220;source&#8221;, [&#8220;kimi&#8221;] * len(ds_kimi)) ds_glm = ds_glm.add_column(&#8220;source&#8221;, [&#8220;glm-5.1&#8221;] * len(ds_glm)) ds = concatenate_datasets([ds_kimi, ds_glm]).shuffle(seed=0) print(&#8220;Combined:&#8221;, ds, &#8220;\u2192 counts:&#8221;, Counter(ds[&#8220;source&#8221;])) sample = ds[0] print(&#8220;n=== Sample 0 ===&#8221;) print(&#8220;id :&#8221;, sample[&#8220;id&#8221;]) print(&#8220;category :&#8221;, sample[&#8220;category&#8221;], &#8220;\/&#8221;, sample[&#8220;subcategory&#8221;]) print(&#8220;task :&#8221;, sample[&#8220;task&#8221;]) print(&#8220;turns :&#8221;, len(sample[&#8220;conversations&#8221;])) print(&#8220;system[0] :&#8221;, sample[&#8220;conversations&#8221;][0][&#8220;value&#8221;][:220], &#8220;&#8230;n&#8221;) We install all required libraries and import the necessary modules to set up our environment. We then load the lambda\/hermes-agent-reasoning-traces dataset and inspect its structure, fields, and categories. We also optionally combine multiple dataset configurations and examine a sample to understand the conversational format. Copy CodeCopiedUse a different Browser THINK_RE = re.compile(r&#8221;&lt;think&gt;(.*?)&lt;\/think&gt;&#8221;, re.DOTALL) TOOL_CALL_RE = re.compile(r&#8221;&lt;tool_call&gt;s*({.*?})s*&lt;\/tool_call&gt;&#8221;, re.DOTALL) TOOL_RESP_RE = re.compile(r&#8221;&lt;tool_response&gt;s*(.*?)s*&lt;\/tool_response&gt;&#8221;, re.DOTALL) def parse_assistant(value: str) -&gt; dict: thoughts = [t.strip() for t in THINK_RE.findall(value)] calls = [] for raw in TOOL_CALL_RE.findall(value): try: calls.append(json.loads(raw)) except json.JSONDecodeError: calls.append({&#8220;name&#8221;: &#8220;&lt;malformed&gt;&#8221;, &#8220;arguments&#8221;: {}}) final = TOOL_CALL_RE.sub(&#8220;&#8221;, THINK_RE.sub(&#8220;&#8221;, value)).strip() return {&#8220;thoughts&#8221;: thoughts, &#8220;tool_calls&#8221;: calls, &#8220;final&#8221;: final} def parse_tool(value: str): raw = TOOL_RESP_RE.search(value) if not raw: return {&#8220;raw&#8221;: value} body = raw.group(1) try: return json.loads(body) except: return {&#8220;raw&#8221;: body} first_gpt = next(t for t in sample[&#8220;conversations&#8221;] if t[&#8220;from&#8221;] == &#8220;gpt&#8221;) p = parse_assistant(first_gpt[&#8220;value&#8221;]) print(&#8220;Thought preview :&#8221;, (p[&#8220;thoughts&#8221;][0][:160] + &#8220;&#8230;&#8221;) if p[&#8220;thoughts&#8221;] else &#8220;(none)&#8221;) print(&#8220;Tool calls :&#8221;, [(c.get(&#8220;name&#8221;), list(c.get(&#8220;arguments&#8221;, {}).keys())) for c in p[&#8220;tool_calls&#8221;]]) We define regex-based parsers to extract reasoning traces, tool calls, and tool responses from the dataset. We process assistant messages to separate thoughts, actions, and final outputs in a structured way. We then test the parser on a sample conversation to verify that the extraction works correctly. Copy CodeCopiedUse a different Browser N = 3000 sub = ds.select(range(min(N, len(ds)))) tool_calls = Counter() parallel_widths = Counter() thoughts_per_turn = [] calls_per_traj = [] errors_per_traj = [] turns_per_traj = [] cat_counts = Counter() for ex in sub: cat_counts[ex[&#8220;category&#8221;]] += 1 n_calls = n_err = 0 turns_per_traj.append(len(ex[&#8220;conversations&#8221;])) for t in ex[&#8220;conversations&#8221;]: if t[&#8220;from&#8221;] == &#8220;gpt&#8221;: p = parse_assistant(t[&#8220;value&#8221;]) thoughts_per_turn.append(len(p[&#8220;thoughts&#8221;])) if p[&#8220;tool_calls&#8221;]: parallel_widths[len(p[&#8220;tool_calls&#8221;])] += 1 for c in p[&#8220;tool_calls&#8221;]: tool_calls[c.get(&#8220;name&#8221;, &#8220;&lt;unknown&gt;&#8221;)] += 1 n_calls += len(p[&#8220;tool_calls&#8221;]) elif t[&#8220;from&#8221;] == &#8220;tool&#8221;: r = parse_tool(t[&#8220;value&#8221;]) blob = json.dumps(r).lower() if &#8220;error&#8221; in blob or &#8216;&#8221;exit_code&#8221;: 1&#8217; in blob or &#8220;traceback&#8221; in blob: n_err += 1 calls_per_traj.append(n_calls) errors_per_traj.append(n_err) print(f&#8221;nScanned {len(sub)} trajectories&#8221;) print(f&#8221;Avg turns\/traj : {np.mean(turns_per_traj):.1f}&#8221;) print(f&#8221;Avg tool calls\/traj : {np.mean(calls_per_traj):.1f}&#8221;) print(f&#8221;% with &gt;=1 error : {100*np.mean([e&gt;0 for e in errors_per_traj]):.1f}%&#8221;) print(f&#8221;% parallel turns : {100*sum(v for k,v in parallel_widths.items() if k&gt;1)\/max(1,sum(parallel_widths.values())):.1f}%&#8221;) print(&#8220;Top 10 tools :&#8221;, tool_calls.most_common(10)) fig, axes = plt.subplots(2, 2, figsize=(13, 9)) top = tool_calls.most_common(15) axes[0,0].barh([t for t,_ in top][::-1], [c for _,c in top][::-1], color=&#8221;teal&#8221;) axes[0,0].set_title(&#8220;Top 15 tools by call volume&#8221;) axes[0,0].set_xlabel(&#8220;calls&#8221;) ks = sorted(parallel_widths) axes[0,1].bar([str(k) for k in ks], [parallel_widths[k] for k in ks], color=&#8221;coral&#8221;) axes[0,1].set_title(&#8220;Tool-calls per assistant turn (parallel width)&#8221;) axes[0,1].set_xlabel(&#8220;# tool calls in one turn&#8221;); axes[0,1].set_ylabel(&#8220;count&#8221;) axes[0,1].set_yscale(&#8220;log&#8221;) axes[1,0].hist(turns_per_traj, bins=40, color=&#8221;steelblue&#8221;) axes[1,0].set_title(&#8220;Conversation length&#8221;); axes[1,0].set_xlabel(&#8220;turns&#8221;) cats, vals = zip(*cat_counts.most_common()) axes[1,1].pie(vals, labels=cats, autopct=&#8221;%1.0f%%&#8221;, startangle=90) axes[1,1].set_title(&#8220;Category distribution&#8221;) plt.tight_layout(); plt.show() We perform dataset-wide analytics to measure tool usage, conversation lengths, and error patterns. We aggregate statistics across multiple samples to understand overall agent behavior. We also create visualizations to highlight trends such as tool frequency, parallel calls, and category distribution. Copy CodeCopiedUse a different Browser def render_trace(ex, max_chars=350): print(f&#8221;n{&#8216;=&#8217;*72}nTASK [{ex[&#8216;category&#8217;]} \/ {ex[&#8216;subcategory&#8217;]}]: {ex[&#8216;task&#8217;]}n{&#8216;=&#8217;*72}&#8221;) for t in ex[&#8220;conversations&#8221;]: role = t[&#8220;from&#8221;] if role == &#8220;system&#8221;: continue if role == &#8220;human&#8221;: print(f&#8221;n[USER]n{textwrap.shorten(t[&#8216;value&#8217;], 600)}&#8221;) elif role == &#8220;gpt&#8221;: p = parse_assistant(t[&#8220;value&#8221;]) for th in p[&#8220;thoughts&#8221;]: print(f&#8221;n[THINK]n{textwrap.shorten(th, max_chars)}&#8221;) for c in p[&#8220;tool_calls&#8221;]: args = json.dumps(c.get(&#8220;arguments&#8221;, {}))[:200] print(f&#8221;[CALL] {c.get(&#8216;name&#8217;)}({args})&#8221;) if p[&#8220;final&#8221;]: print(f&#8221;n[ANSWER]n{textwrap.shorten(p[&#8216;final&#8217;], max_chars)}&#8221;) elif role == &#8220;tool&#8221;: print(f&#8221;[TOOL_RESPONSE] {textwrap.shorten(t[&#8216;value&#8217;], 220)}&#8221;) print(&#8220;=&#8221;*72) idx = int(np.argmin(np.abs(np.array(turns_per_traj) &#8211; 10))) render_trace(sub[idx]) def get_tool_schemas(ex): try: return json.loads(ex[&#8220;tools&#8221;]) except: return [] schemas = get_tool_schemas(sample) print(f&#8221;nSample 0 has {len(schemas)} tools available&#8221;) for s in schemas[:3]: fn = s.get(&#8220;function&#8221;, {}) print(&#8221; -&#8220;, fn.get(&#8220;name&#8221;), &#8220;\u2014&#8221;, (fn.get(&#8220;description&#8221;) or &#8220;&#8221;)[:80]) ROLE_MAP = {&#8220;system&#8221;: &#8220;system&#8221;, &#8220;human&#8221;: &#8220;user&#8221;, &#8220;gpt&#8221;: &#8220;assistant&#8221;, &#8220;tool&#8221;: &#8220;tool&#8221;} def to_openai_messages(conv): return [{&#8220;role&#8221;: ROLE_MAP[t[&#8220;from&#8221;]], &#8220;content&#8221;: t[&#8220;value&#8221;]} for t in conv] example_msgs = to_openai_messages(sample[&#8220;conversations&#8221;]) print(&#8220;nFirst 2 OpenAI messages:&#8221;) for m in example_msgs[:2]: print(&#8221; &#8220;, m[&#8220;role&#8221;], &#8220;\u2192&#8221;, m[&#8220;content&#8221;][:120].replace(&#8220;n&#8221;, &#8221; &#8220;), &#8220;&#8230;&#8221;) We build utilities to render full conversation traces in a readable format for deeper inspection. We also extract tool schemas and convert the dataset into OpenAI-style message format for compatibility with training pipelines. This helps us better understand both the structure of tools and how conversations can be standardized. Copy CodeCopiedUse a different Browser from transformers import AutoTokenizer TOK_ID = &#8220;Qwen\/Qwen2.5-0.5B-Instruct&#8221; tok = AutoTokenizer.from_pretrained(TOK_ID) def build_masked(conv, tokenizer, max_len=2048): msgs = to_openai_messages(conv) for m in msgs: if m[&#8220;role&#8221;] == &#8220;tool&#8221;: m[&#8220;role&#8221;] = &#8220;user&#8221; m[&#8220;content&#8221;] = &#8220;[TOOL OUTPUT]n&#8221; + m[&#8220;content&#8221;] input_ids, labels = [], [] for m in msgs: text = tokenizer.apply_chat_template([m], tokenize=False, add_generation_prompt=False) ids = tokenizer.encode(text, add_special_tokens=False) input_ids.extend(ids) labels.extend(ids if m[&#8220;role&#8221;] == &#8220;assistant&#8221; else [-100] * len(ids)) return input_ids[:max_len], labels[:max_len] ids, lbls = build_masked(sample[&#8220;conversations&#8221;], tok) trainable = sum(1 for x in lbls if x != -100) print(f&#8221;nTokenized example: {len(ids)} tokens, {trainable} trainable ({100*trainable\/len(ids):.1f}%)&#8221;) think_lens, call_lens, ans_lens = [], [], []<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"pmpro_default_level":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_pvb_checkbox_block_on_post":false,"footnotes":""},"categories":[52,5,7,1],"tags":[],"class_list":["post-87593","post","type-post","status-publish","format-standard","hentry","category-ai-club","category-committee","category-news","category-uncategorized","pmpro-has-access"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum<\/title>\n<meta name=\"description\" content=\"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/youzum.net\/es\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum\" \/>\n<meta property=\"og:description\" content=\"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19\" \/>\n<meta property=\"og:url\" content=\"https:\/\/youzum.net\/es\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\" \/>\n<meta property=\"og:site_name\" content=\"YouZum\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DroneAssociationTH\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-02T15:53:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\" \/>\n<meta name=\"author\" content=\"admin NU\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin NU\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\"},\"author\":{\"name\":\"admin NU\",\"@id\":\"https:\/\/yousum.gpucore.co\/#\/schema\/person\/97fa48242daf3908e4d9a5f26f4a059c\"},\"headline\":\"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset\",\"datePublished\":\"2026-05-02T15:53:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\"},\"wordCount\":603,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/yousum.gpucore.co\/#organization\"},\"image\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\",\"articleSection\":[\"AI\",\"Committee\",\"News\",\"Uncategorized\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\",\"url\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\",\"name\":\"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum\",\"isPartOf\":{\"@id\":\"https:\/\/yousum.gpucore.co\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\",\"datePublished\":\"2026-05-02T15:53:45+00:00\",\"description\":\"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19\",\"breadcrumb\":{\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage\",\"url\":\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\",\"contentUrl\":\"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/youzum.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/yousum.gpucore.co\/#website\",\"url\":\"https:\/\/yousum.gpucore.co\/\",\"name\":\"YouSum\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/yousum.gpucore.co\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/yousum.gpucore.co\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/yousum.gpucore.co\/#organization\",\"name\":\"Drone Association Thailand\",\"url\":\"https:\/\/yousum.gpucore.co\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/yousum.gpucore.co\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/youzum.net\/wp-content\/uploads\/2024\/11\/tranparent-logo.png\",\"contentUrl\":\"https:\/\/youzum.net\/wp-content\/uploads\/2024\/11\/tranparent-logo.png\",\"width\":300,\"height\":300,\"caption\":\"Drone Association Thailand\"},\"image\":{\"@id\":\"https:\/\/yousum.gpucore.co\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/DroneAssociationTH\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/yousum.gpucore.co\/#\/schema\/person\/97fa48242daf3908e4d9a5f26f4a059c\",\"name\":\"admin NU\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/yousum.gpucore.co\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/youzum.net\/wp-content\/uploads\/avatars\/2\/1746849356-bpfull.png\",\"contentUrl\":\"https:\/\/youzum.net\/wp-content\/uploads\/avatars\/2\/1746849356-bpfull.png\",\"caption\":\"admin NU\"},\"url\":\"https:\/\/youzum.net\/es\/members\/adminnu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum","description":"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/youzum.net\/es\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/","og_locale":"es_ES","og_type":"article","og_title":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum","og_description":"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19","og_url":"https:\/\/youzum.net\/es\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/","og_site_name":"YouZum","article_publisher":"https:\/\/www.facebook.com\/DroneAssociationTH\/","article_published_time":"2026-05-02T15:53:45+00:00","og_image":[{"url":"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png","type":"","width":"","height":""}],"author":"admin NU","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"admin NU","Tiempo de lectura":"10 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#article","isPartOf":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/"},"author":{"name":"admin NU","@id":"https:\/\/yousum.gpucore.co\/#\/schema\/person\/97fa48242daf3908e4d9a5f26f4a059c"},"headline":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset","datePublished":"2026-05-02T15:53:45+00:00","mainEntityOfPage":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/"},"wordCount":603,"commentCount":0,"publisher":{"@id":"https:\/\/yousum.gpucore.co\/#organization"},"image":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage"},"thumbnailUrl":"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png","articleSection":["AI","Committee","News","Uncategorized"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/","url":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/","name":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset - YouZum","isPartOf":{"@id":"https:\/\/yousum.gpucore.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage"},"image":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage"},"thumbnailUrl":"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png","datePublished":"2026-05-02T15:53:45+00:00","description":"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e42\u0e14\u0e23\u0e19","breadcrumb":{"@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#primaryimage","url":"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png","contentUrl":"https:\/\/s.w.org\/images\/core\/emoji\/17.0.2\/72x72\/1f4ad.png"},{"@type":"BreadcrumbList","@id":"https:\/\/youzum.net\/a-coding-implementation-to-parsing-analyzing-visualizing-and-fine-tuning-agent-reasoning-traces-using-the-lambda-hermes-agent-reasoning-traces-dataset\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/youzum.net\/"},{"@type":"ListItem","position":2,"name":"A Coding Implementation to Parsing, Analyzing, Visualizing, and Fine-Tuning Agent Reasoning Traces Using the lambda\/hermes-agent-reasoning-traces Dataset"}]},{"@type":"WebSite","@id":"https:\/\/yousum.gpucore.co\/#website","url":"https:\/\/yousum.gpucore.co\/","name":"YouSum","description":"","publisher":{"@id":"https:\/\/yousum.gpucore.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yousum.gpucore.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/yousum.gpucore.co\/#organization","name":"Drone Association Thailand","url":"https:\/\/yousum.gpucore.co\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/yousum.gpucore.co\/#\/schema\/logo\/image\/","url":"https:\/\/youzum.net\/wp-content\/uploads\/2024\/11\/tranparent-logo.png","contentUrl":"https:\/\/youzum.net\/wp-content\/uploads\/2024\/11\/tranparent-logo.png","width":300,"height":300,"caption":"Drone Association Thailand"},"image":{"@id":"https:\/\/yousum.gpucore.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DroneAssociationTH\/"]},{"@type":"Person","@id":"https:\/\/yousum.gpucore.co\/#\/schema\/person\/97fa48242daf3908e4d9a5f26f4a059c","name":"admin NU","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/yousum.gpucore.co\/#\/schema\/person\/image\/","url":"https:\/\/youzum.net\/wp-content\/uploads\/avatars\/2\/1746849356-bpfull.png","contentUrl":"https:\/\/youzum.net\/wp-content\/uploads\/avatars\/2\/1746849356-bpfull.png","caption":"admin NU"},"url":"https:\/\/youzum.net\/es\/members\/adminnu\/"}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"admin NU","author_link":"https:\/\/youzum.net\/es\/members\/adminnu\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/youzum.net\/es\/category\/ai-club\/\" rel=\"category tag\">AI<\/a> <a href=\"https:\/\/youzum.net\/es\/category\/committee\/\" rel=\"category tag\">Committee<\/a> <a href=\"https:\/\/youzum.net\/es\/category\/news\/\" rel=\"category tag\">News<\/a> <a href=\"https:\/\/youzum.net\/es\/category\/uncategorized\/\" rel=\"category tag\">Uncategorized<\/a>","rttpg_excerpt":"In this tutorial, we explore the lambda\/hermes-agent-reasoning-traces dataset to understand how agent-based models think, use tools, and generate responses across multi-turn conversations. We start by loading and inspecting the dataset, examining its structure, categories, and conversational format to get a clear idea of the available information. We then build simple parsers to extract key components&hellip;","_links":{"self":[{"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/posts\/87593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/comments?post=87593"}],"version-history":[{"count":0,"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/posts\/87593\/revisions"}],"wp:attachment":[{"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/media?parent=87593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/categories?post=87593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/youzum.net\/es\/wp-json\/wp\/v2\/tags?post=87593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}