Skip to content
imlrzPublic

About

Jetriever: Jev-based agent memory retrieval system and research artifacts

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

Jetriever

Similarity ✗  ·  Utility ✓

Code License arXiv:2611.21478

English · 简体中文

Jetriever is an agent-memory retrieval service that asks a utility-oriented reranker which stored interactions are useful for the current query. It stores the raw chunks supplied through Add, exhaustively scores every chunk scoped to the exact user_id, and returns the five highest-scoring evidence chunks. It does not generate the final answer or expand results with neighboring turns.

The repository contains the complete Add/Search API, persistent SQLite store, bounded provider concurrency, retry and rate-limit handling, privacy-preserving audit logs, Docker packaging, and contract tests.

Paper: Jetriever: Shifting Agent Memory Retrieval from Similarity to Utility · PDF

Method

For each query-memory pair, Jetriever calls OpenRouter's Decisions API with ~typesafe/jev-latest and requests a Noul utility score. Search then:

  1. loads only chunks belonging to the exact user_id;
  2. scores every candidate with a global concurrency bound;
  3. requires every candidate score to succeed, so incomplete reranking is never returned as a valid top-5;
  4. sorts by utility and returns at most min(top_k, 5) raw evidence chunks.

See the method card for the evidence boundary and competition-specific adaptations.

API

The service exposes:

  • POST /v1/memories/add
  • POST /v1/memories/search
  • GET /health

/add and /search are compatibility aliases. Add is synchronous and idempotent by request_id; HTTP 200 means every submitted message is stored and immediately searchable. Retrieval isolation always uses the exact user_id. session_id is retained as source metadata, not as an isolation scope.

Quick start

Requirements: Docker Compose and an OpenRouter key with access to the Decisions API.

cp .env.example .env
# Fill OPENROUTER_API_KEY and choose a private JETRIEVER_API_KEY in .env.
docker compose up --build -d
curl http://127.0.0.1:8000/health

Run the live smoke test after startup:

export JETRIEVER_API_KEY="the same local service key"
python scripts/smoke_test.py http://127.0.0.1:8000

Never commit .env, API keys, databases, audit logs, or evaluation payloads.

Configuration

Variable Default Purpose
OPENROUTER_API_KEY required Server-side provider credential
JETRIEVER_API_KEY optional outside Compose Credential protecting Add/Search
JEV_MODEL ~typesafe/jev-latest Decisions model
JEV_CONCURRENCY 32 Global concurrent candidate scores
JEV_TIMEOUT_SECONDS 20 Timeout for one provider attempt
JEV_MAX_RETRIES 5 Maximum attempts per candidate
BACKEND_RETRY_AFTER_SECONDS 15 Retry delay returned for backend failures
JETRIEVER_RESULT_LIMIT 5 Fixed response cap
RETENTION_DAYS 30 Automatic data-retention window

The service maps transient provider or storage failures to HTTP 429 with a Retry-After header. Provider-native 429 responses retain their supplied retry delay. Audit logs contain event metadata and hashed identifiers, never memory text, queries, provider responses, or credentials.

Development

The project supports Python 3.9 or newer. This repository's experiments use the longmemeval Conda environment:

conda run -n longmemeval python -m pip install -r requirements-dev.txt
conda run -n longmemeval python -m ruff check app tests
conda run -n longmemeval python -m pytest

Tests mock the provider API and cover synchronous visibility, idempotency, user isolation, authentication, raw-chunk granularity, option forwarding, top-5 ordering, retry behavior, all-or-nothing reranking, and log redaction.

Previous work

Jetriever continues our work on agent memory:

  • ReFind — paper · code. ReFind ranked second on the first Agent Memory Leaderboard Academic Textual track and studies agent-controlled search over raw chat logs.
  • InMind — paper · code · project page. InMind evaluates memories whose relevance depends on implicit world-knowledge associations.

Citation

If you use Jetriever, please cite the paper. Citation metadata is also available in CITATION.cff.

@misc{li2026jetriever,
  title         = {{Jetriever}: Shifting Agent Memory Retrieval from Similarity to Utility},
  author        = {Li, Ruizhe and Zhang, Licheng and Du, Mingxuan and Mao, Zhendong},
  year          = {2026},
  eprint        = {2611.21478},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL},
  url           = {https://arxiv.org/abs/2611.21478}
}

License

Jetriever is released under the MIT License.

About

Jetriever: Jev-based agent memory retrieval system and research artifacts

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages