User as Code: Executable Memory for Personalized Agents

· Source: Artificial Intelligence · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, quick

Summary

User as Code (UaC) introduces an executable memory paradigm for personalized AI agents, contrasting with traditional unstructured text, knowledge graph, or flat fact stores that rely on retrieval. UaC models a user as a living software project, utilizing typed Python objects for user state and ordinary Python functions to encode governing rules, allowing representation and reasoning within a single, interpretable medium. Its enabling mechanism is a two-phase pipeline: an append-only log that periodically checkpoints into typed code. This approach significantly enhances memory capabilities, matching prior systems on recall (78.8% on LOCOMO) while demonstrating superior performance on aggregate questions over user history, achieving 99% accuracy where retrieval-based methods yield only 6-43%. Furthermore, UaC can surface unsolicited, safety-critical alerts, such as drug-allergy conflicts, a capability absent in query-driven memory systems.

Key takeaway

For AI Engineers designing personalized agents, traditional retrieval-based memory systems often fall short on complex reasoning and proactive alerts. You should explore User as Code's executable memory paradigm to build more robust user models. This approach, using typed Python objects and functions, enables accurate aggregate queries and critical unsolicited safety alerts, significantly enhancing agent intelligence and reliability beyond simple fact recall.

Key insights

User as Code proposes executable memory for AI agents, using Python objects and functions for dynamic, rule-based user modeling.

Principles

Method

A two-phase pipeline: an append-only log captures facts, which are periodically checkpointed into typed Python code representing user state and rules.

In practice

Topics

Best for: Research Scientist, AI Architect, AI Product Manager, AI Scientist, Machine Learning Engineer, AI Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.