Self-Improving LLM Contexts for Agentic AI

dc.contributor.authorFrisk, William
dc.contributor.authorHansson, Isac
dc.contributor.departmentChalmers tekniska högskola / Institutionen för matematiska vetenskapersv
dc.contributor.examinerJonasson, Johan
dc.contributor.supervisorLagerberg, Aron
dc.date.accessioned2026-06-08T13:51:46Z
dc.date.issued2026
dc.date.submitted
dc.description.abstractLarge 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.
dc.identifier.coursecodeMVEX03
dc.identifier.urihttps://hdl.handle.net/20.500.12380/311136
dc.language.isoeng
dc.setspec.uppsokPhysicsChemistryMaths
dc.subjectAgentic context engineering (ACE), large language models (LLM), AI agents, context adaptation, prompt optimization.
dc.titleSelf-Improving LLM Contexts for Agentic AI
dc.type.degreeExamensarbete för masterexamensv
dc.type.degreeMaster's Thesisen
dc.type.uppsokH
local.programmeData science and AI (MPDSC), MSc

Ladda ner

Original bundle

Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
Master_Thesis_William_Frisk_Isac_Hansson.pdf
Size:
2.46 MB
Format:
Adobe Portable Document Format

License bundle

Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
license.txt
Size:
2.35 KB
Format:
Item-specific license agreed upon to submission
Description: