Skip to content

About

Structured personalized memory and proactive clarification for long-horizon LLM agents — research project and reference runtime (Apr–Jul 2026).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

AutoPersona

Proactively Resolving Implicit Requirements in Tasks through Structured Personalized Memory

Qijia Zhuang · Zihan Shen · Rui Liu · Yuxiang Ren

Research project · April–July 2026

Paper CI Python Tests

Overview · Motivation · Method · Analysis · Code Scope · Quick Start

Overview

Long-horizon personal assistants often receive an explicit task while user preferences, workspace state, and execution constraints remain unstated. A useful memory system must do more than retrieve similar history: it must determine which evidence applies to the current task, identify missing information, and decide when to ask rather than guess.

AutoPersona addresses this problem with a three-layer memory bank and a dedicated PersonaAgent. The framework separates historical task evidence, workspace state, and reusable personalization strategies; retrieves relevant evidence for the current task node; requests targeted clarification when the evidence is insufficient; and injects the resulting constraints into dependency-aware execution.

Structured memory Proactive reasoning Long-horizon execution
Separates trajectory evidence, workspace state, and reusable persona strategies. Detects missing implicit requirements and asks a targeted question instead of guessing. Injects personalized constraints at the relevant nodes of a dependency-aware task graph.

Motivation

Motivating comparison between traditional memory and AutoPersona

Figure 1. Traditional retrieval can repeat already rejected recommendations; AutoPersona combines structured memories with targeted clarification to recover the user's actual constraints.

Research Experience

The AutoPersona research project was conducted from April to July 2026. My work included:

  • proposing a proactive personalized-memory framework for resolving implicit requirements in long-horizon agent tasks;
  • designing a structured architecture with Trajectory Memory, Workspace Memory, and Persona Memory for execution traces, environment state, task context, user preferences, and reusable assistance strategies;
  • building evaluation settings that study incomplete context, noisy memories, evolving preferences, hidden intents, memory retrieval, constraint adherence, and personalization consistency;
  • developing a two-stage learning pipeline that combines supervised fine-tuning with Group Relative Policy Optimization (GRPO) to improve memory summarization and proactive clarification behavior;
  • integrating node-level personalization into dependency-aware task execution so that constraints are applied where they matter instead of being appended once to the initial prompt.

The full research workflow included training and benchmark evaluation. The public repository intentionally exposes only the framework-independent runtime described below; Code and research alignment records the boundary in detail.

Method

AutoPersona memory, training, and task-execution framework

Figure 2. AutoPersona connects a three-layer memory pool, PersonaAgent training, and node-level personalization during task execution. Click the figure to inspect the full-resolution diagram.

1. Construct the memory bank

A completed task is refined into three complementary representations:

Layer Contents Runtime role
Trajectory User request, key actions, outcome, reusable insight Traceable historical evidence
Workspace Task state, environment interactions, current state Task continuity and environment context
Persona Applicable topic, preference or constraint, assistance strategy Reusable personalization guidance

New workspace and persona items are compared with existing memories and resolved through add, update, delete, or no-op decisions.

2. Retrieve and decide

MemoryRetriever selects evidence separately for each memory layer. PersonaAgent consumes the retrieved bundle and returns one of two explicit decisions:

  • final: return personalized guidance for execution;
  • clarify: pause and ask a concrete question because required information is missing.

3. Execute a personalized task graph

MemoryAwareExecutor validates and topologically orders task nodes. Before each node runs, it invokes PersonaAgent; predecessor outputs and relevant memories are then passed to the task runner. Execution pauses safely if clarification is required.

A paused ExecutionState can be resumed with the user's clarification answer. Completed node outputs are validated and reused, so external tool calls are not repeated.

Clarification Analysis

Clarification reward and proactive clarification accuracy analysis

Figure 3. Clarification-reward sensitivity and the development of proactive clarification accuracy during training.

The paper studies how clarification-reward weighting affects overall performance and how proactive clarification accuracy changes across training steps. This repository displays the paper figure for research context; the released runtime does not include the training stack or claim an independent reproduction of these experiments.

Code Scope

Included in this repository

  • the AutoPersona preprint with a browser-readable PDF link;
  • all three paper figures as full-resolution README assets;
  • typed memory models and per-user JSONL persistence;
  • trajectory, workspace, and persona refinement;
  • embedding-based retrieval separated by memory layer;
  • memory add, update, delete, and no-op orchestration;
  • a Persona2Web record adapter;
  • proactive clarification decisions;
  • memory-aware DAG execution and runtime metrics;
  • deterministic, API-free tests and a minimal runnable example;
  • an API-free clarification-policy evaluator with per-case retrieval diagnostics, precision, recall, F1, and exact layer-set match.

Part of the research, not included here

  • SFT data construction and model training;
  • the GRPO reward, optimization loop, and model integration;
  • benchmark datasets and redistribution-controlled assets;
  • end-to-end evaluation harnesses and judge-model integrations;
  • checkpoints, raw predictions, experiment logs, and unpublished tables.

The distinction matters: this repository is suitable for inspecting and testing the runtime abstractions, but it is not an artifact-complete reproduction package.

Quick Start

The package requires Python 3.10+ and has no runtime dependencies outside the standard library.

git clone https://github.com/Ailta666508/AutoPersona.git
cd AutoPersona
python3.10 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
python -m unittest discover -s tests -v
python examples/minimal_demo.py
python examples/evaluate_clarification.py
python examples/resume_after_clarification.py

The examples use deterministic local stand-ins for embedding, memory resolution, and policy decisions. They do not call an LLM API or reproduce research experiments.

Core API

from autopersona_memory import (
    JsonlMemoryStore,
    MemoryRetriever,
    MemoryUpdater,
    PersonaAgent,
    RawTaskRecord,
    ingest_task_history,
)

store = JsonlMemoryStore("./memory")
embed = lambda text: [float("open-source" in text.lower()), 1.0]
resolve = lambda memory_type, new, candidates: {"operation": "add", "memory": new}
updater = MemoryUpdater(store, embed, resolve)

ingest_task_history(
    store,
    updater,
    RawTaskRecord(
        user_id="demo-user",
        query="Find related work",
        outcome="completed",
        persona=[{
            "topic": "paper search",
            "preference": "Prefer open-source work",
            "strategy": "Check code availability and reproduction cost",
        }],
    ),
)

Repository Guide

autopersona_memory/
  models.py             # Typed requests, decisions, and three memory layers
  store.py              # Per-user JSONL persistence
  refinement.py         # Raw history to structured memories
  extraction.py         # Memory update orchestration
  retrieval.py          # Per-layer similarity retrieval
  persona_agent.py      # Retrieval and clarify/final decision boundary
  execution.py          # Memory-aware DAG execution
  metrics.py            # Lightweight runtime metrics
  evaluation.py         # Synthetic clarification-policy evaluation
  adapters/persona2web.py
examples/minimal_demo.py
examples/evaluate_clarification.py
examples/resume_after_clarification.py
tests/
docs/

Engineering Validation

The release checks verify:

  • all 12 maintained core source files against a SHA-256 manifest;
  • Python syntax and editable installation;
  • 46 deterministic unit tests covering crash-durable and concurrent storage, corrupt JSONL and UTF-8 rejection during mutations and migration, collision-resistant user paths, validated storage and resolver indices, retrieval and evaluation labels, updates, clarification, resumable DAG execution, adapters, and metrics;
  • the API-free minimal example;
  • integrity verification for the allowlisted preprint and its three extracted figures, plus exclusion of local credentials, other document artifacts, checkpoints, results, and an unrelated vendored verl source tree.

GitHub Actions runs the test and release-verification suite on Python 3.10, 3.11, and 3.12.

Citation

If you use the ideas or released runtime in academic work, please cite the current preprint:

@misc{zhuang2026autopersona,
  title  = {AutoPersona: Proactively Resolving Implicit Requirements in Tasks through Structured Personalized Memory},
  author = {Qijia Zhuang and Zihan Shen and Rui Liu and Yuxiang Ren},
  year   = {2026},
  note   = {Preprint}
}

Maintainer and Release Boundary

  • Repository maintainer and Git contributor: Zihan Shen (Ailta666508).
  • The included preprint is authored by Qijia Zhuang, Zihan Shen, Rui Liu, and Yuxiang Ren; please credit all authors when citing the research.
  • No venue name or submission identifier is asserted by this repository.
  • No standalone result tables, raw predictions, or claims of independent reproduction are included.
  • Venue, DOI, and final citation details can be added when an appropriate public record becomes available.

License

No open-source license has been assigned to this release. Copyright and reuse permissions remain reserved until the relevant rights holders approve a license.

Note: This project was initially developed locally. The Git repository was created when the codebase was prepared for publication, so the early development history is unavailable. Subsequent updates are tracked in this repository.

Retrieval relevance and repeated searches

MemoryRetriever.retrieve(user_id, searches, top_k=3, min_similarity=0.8) returns only positive cosine matches at or above the selected threshold. The default 0.0 preserves existing behavior. A threshold of 1.0 selects only unit-similarity matches. Tune this value for your embedder using public or synthetic evaluation cases; it is not calibrated confidence. top_k applies per search, and results are deduplicated per memory type.

Repeated queries and memory texts reuse embeddings within one call, and each requested memory bank is read once. The cache is discarded afterward, so new writes and another user's memory bank remain visible on the next call.

Atomic batch append

store.add_many(user_id, "persona", records) appends an iterable with one atomic replacement per user/bank. Iterator, serialization or replacement failures before publication leave the existing file intact. Empty batches do not write; mismatched bank types are rejected. Unix file locks coordinate separate store instances; Windows coordination remains limited to a single store instance.

Runnable clarification evaluation

Run python examples/evaluate_retrieval_clarification.py for a data-free, API-key-free example that evaluates both a relevant-memory final response and a low-relevance clarification. The printed JSON includes decision and retrieval metrics and is labeled with synthetic case names.

Applications can also override retrieval_top_k and retrieval_min_similarity on an individual PersonaRequest, allowing a high-risk decision to demand stronger evidence without changing the agent's default policy.

store.snapshot(user_id) reads trajectory, workspace, and persona banks while holding their locks in a stable order. This provides one consistent export boundary for backup or evaluation and fails without modifying files if any bank is corrupt.

store.snapshot_fingerprint(user_id) returns a SHA-256 digest of that canonical snapshot. It can be used as a cache key or to detect whether an export needs to be refreshed without exposing memory contents.

Atomic snapshot export CLI

python -m autopersona_memory.export_snapshot ./memory-store alice ./exports/alice.json

The existing store is read under bank locks once; schema version 1, per-bank counts, a SHA-256 fingerprint, and the captured memories are written via atomic replacement. The fingerprint hashes UTF-8 canonical JSON of memories with sorted keys and separators (',', ':'). Stdout reports only counts and digest. Exports contain the selected user's actual memory contents: keep them outside public repositories. Destinations inside the memory store are rejected. Corrupt input or failure before replacement preserves any prior export. An empty user produces an explicitly empty snapshot; export does not imply restore support.

About

Structured personalized memory and proactive clarification for long-horizon LLM agents — research project and reference runtime (Apr–Jul 2026).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages