Back to search

Chalmers University of Technology

Self-Improving LLM Contexts for Agentic AI

Abstract

dc:description.abstract

Large language model (LLM) agents have become increasingly capable systems for solving complex tasks through reasoning, tool use, and interaction with external environments. Recent work has shown that the LLM agents can be improved not only through parameter fine-tuning, but also through modifying the context. This thesis investigates context adaptation for domain-specific LLM agents in a threat intelligence environment. In collaboration with Recorded Future, we implement and evaluate a framework based on Agentic Context Engineering (ACE) for optimizing a search-oriented LLM agent through iterative generation, reflection and curation. The framework is further extended with ReAct-style reflection and the incorporation of external domain documentation during optimization. The approach is evaluated on datasets constructed from realistic threat intelligence tasks and compared against baseline agents with either minimal or handcrafted context. Experimental results show that the context adaptation substantially improves agent performance, achieving higher search accuracy and grounding. The best performing framework, with the new contributions and without ground truth supervision, achieves 15.1 percentage points increase in pass@1. Overall, the findings demonstrate that context engineering is an effective approach for adapting LLM agents to specialized enterprise domains. Furthermore, indication is given that ground truth supervision might be substitutable for environment interaction.

Degree

thesis:*
Level thesis:degree_level
H
Department dc:contributor.department
Chalmers tekniska högskola / Institutionen för matematiska vetenskaper
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Authors dc:creator
  • Frisk, William
  • Hansson, Isac
Advisor dc:contributor.supervisor
  • Lagerberg, Aron
Committee member dc:contributor.committeemember
  • Jonasson, Johan

Subjects

dc:subject × 1

Rights

Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Coursecode
MVEX03

Chain of custody

source
Harvested from
Chalmers University of Technology
Base URL
odr.chalmers.se/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Frisk, William; Hansson, Isac. Self-Improving LLM Contexts for Agentic AI. H thesis, 2026. https://hdl.handle.net/20.500.12380/311136