Skip to main content
Chronologue enables agents and systems to retrieve structured memory context via the MemPort export protocol. The context export interface allows external tools, planner agents, or runtime environments to pull memory traces across time, tempo, and task boundaries. This protocol supports summary-level, full, linked, and delta exports. It serves as the memory transfer layer for hydrating agent runtimes, exporting for review or analysis, and restoring or transferring state between agents or models.

Use Cases

  • Hydrate agent runtime with relevant trace context before task execution
  • Share trace summaries with external planning or evaluation tools
  • Reconstruct causal chains from memory (linked_trace_ids)
  • Export historical trace logs for auditing, reflection, or simulation
  • Recover lost agent state by time-bound export and rehydration

Context Export Schema

Core fields used in context export queries: Optional query fields:
  • group_by: day, task, trace_type
  • include_feedback: boolean
  • max_token_count: integer (for summaries)

Export Modes

summary

  • Token-optimized export for use in LLM prompts
  • Includes trace type, task_id, timestamp, and compressed content

full

  • Raw memory trace export (JSON schema)
  • Used for persistence, archival, or external analysis

linked

  • Recursively collects traces connected via linked_trace_ids
  • Useful for reconstructing causal chains

diff

  • Computes trace differences between two timepoints or exports
  • Used for incremental syncing, audit deltas, or simulation replay

Endpoint Specification

GET /memport/export

Query Parameters: All responses are returned in JSON format. Content-Type: application/json

Example Requests & Responses

Example: Export Daily Summary

GET /memport/export?user_id=u001&start_time=2025-05-11T00:00:00Z&end_time=2025-05-11T23:59:00Z&export_format=summary Response:

7. FastAPI Implementation Notes

  • Use @router.get("/memport/export") with dependency injection for auth
  • Validate input with ExportQueryParams Pydantic model
  • Internally call query_traces() and apply formatting logic
  • For summary, include token-count-aware compression if needed
  • Support pagination or limit/offset for long exports
  • Use linked_trace_ids to support linked export mode with trace recursion

Redis Acceleration Layer (Optional)

Chronologue supports Redis-backed export acceleration: When enabled:
  • Exports check Redis cache before querying database
  • Summaries are cached for 15–30 minutes by default
  • Reduces response time for repeated or overlapping queries
Best practices:
  • Use TTLs to prevent memory bloat
  • Store Redis as cache, not source of truth
  • Clear cache on user-triggered edits or trace updates

Security and Data Handling

  • All export endpoints require valid API key (Authorization header)
  • User-level access: users can only export their own context
  • Agents acting on behalf of users must be scoped with correct permissions
  • Apply content filtering for sensitive fields (e.g., authored_by, chat_url)
  • Versioned exports can be tagged and checkpointed for reproducibility