-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpaper.tex
More file actions
142 lines (121 loc) · 4.55 KB
/
Copy pathpaper.tex
File metadata and controls
142 lines (121 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
\documentclass[11pt]{article}
% Encoding
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% Professional preprint style: fonts, geometry, headings, title, header.
\usepackage{arxiv}
% Content packages
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{subcaption}
\usepackage{enumitem}
\usepackage{natbib}
% hyperref loaded late, then coloured to match the palette.
\usepackage{hyperref}
\usepackage{url}
\hypersetup{
colorlinks=true,
linkcolor=arxivaccent,
citecolor=arxivaccent,
urlcolor=arxivaccent,
filecolor=arxivaccent,
breaklinks=true,
}
% Python code listing style
\definecolor{codebg}{rgb}{0.95,0.95,0.97}
\definecolor{codegreen}{rgb}{0.0,0.5,0.0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{codeblue}{rgb}{0.0,0.0,0.7}
\lstdefinestyle{pythonstyle}{
backgroundcolor=\color{codebg},
basicstyle=\ttfamily\small,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
commentstyle=\color{codegreen},
keywordstyle=\color{codeblue}\bfseries,
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
language=Python,
showstringspaces=false,
numbers=left,
numbersep=5pt,
frame=single,
rulecolor=\color{codegray},
tabsize=4,
morekeywords={dataclass, List, Optional, date, assert, Dict, field}
}
\lstdefinestyle{treestyle}{
basicstyle=\ttfamily\small,
frame=none,
numbers=none,
breaklines=false,
backgroundcolor=\color{codebg},
}
% Style for conversation transcript excerpts (italic dialogue, framed).
\definecolor{convbg}{rgb}{0.98,0.97,0.92}
\definecolor{speakerblue}{rgb}{0.10,0.30,0.60}
\lstdefinestyle{conversationstyle}{
backgroundcolor=\color{convbg},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
language={}, % plain transcript: no Python string/keyword colouring
keywordstyle={},
stringstyle={},
commentstyle={},
showstringspaces=false,
numbers=none,
frame=single,
rulecolor=\color{codegray},
tabsize=2,
}
% Style for runtime output / alert blocks (red border, fixed-width).
\definecolor{alertbg}{rgb}{1.00,0.96,0.94}
\definecolor{alertred}{rgb}{0.70,0.10,0.10}
\lstdefinestyle{alertstyle}{
backgroundcolor=\color{alertbg},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
commentstyle=\color{codegreen},
keywordstyle=\color{alertred}\bfseries,
showstringspaces=false,
numbers=none,
frame=single,
rulecolor=\color{alertred},
tabsize=2,
morekeywords={CRITICAL,WARNING,INFO,ALERT,DRUG-ALLERGY,CONFLICT},
}
\lstset{style=pythonstyle}
% Allow the one-column preprint to absorb long model names and citation groups
% without protruding into the margin.
\setlength{\emergencystretch}{3em}
\title{User as Code: Executable Memory for Personalized Agents}
\author{
Bojie Li \\
Pine AI
}
\date{}
\runningtitle{User as Code: Executable Memory for Personalized Agents}
\begin{document}
\maketitle
\begin{abstract}
An agent that remembers 100 trips should answer not only where a user traveled, but how often they visited Europe. Textual memories accessed through top-$k$ retrieval can recover individual trips but cannot reliably enumerate all of them, while conventional structured stores require a domain model to be defined and maintained. We introduce \textbf{User as Code} (UaC), which appends session facts and periodically materializes an LLM-generated typed Python view while retaining fact and archive channels for recall. On full 1{,}986-question LOCOMO suites, UaC records the highest observed same-backbone judge accuracy among six persistent-memory systems with GPT-5.6 Luna/Gemini~3 Flash Preview (78.8\%/80.6\% on 1{,}540 answer-bearing questions). Token F1 on those questions (39.4\%/46.9\%) and refusal accuracy on 446 adversarial questions (64.3\%/95.7\%) expose metric-specific tradeoffs. On 100 deterministically scored aggregate queries, both UaC and a raw-record Full Context+REPL reference reach 100\%, versus 43\% for MemMachine and 6\% for Mem0. The results show that an enumerable, code-readable representation enables reliable analytical queries while remaining compatible with retrieval-based factual memory.
\end{abstract}
\begin{center}
\small
Code: \url{https://github.com/19PINE-AI/user-as-code} \\[2pt]
Website: \url{https://01.me/research/user-as-code}
\end{center}
\vspace{-0.6em}
\input{body}
\bibliographystyle{plainnat}
\bibliography{reference}
\end{document}