Skip to main content
The context command manages conversation context for AI agents.

Usage

Commands

compact and export operate on the process-local get_global_store(). That store is empty unless this same process populated it, so an ordinary praisonai context compact run over a store an agent run filled in another process will find nothing. See Why is my store empty? below.

Examples

Show current context

Add file to context

Clear context

Compact the store

compact cleans per-agent history only. It prints Compaction complete (N agent(s)). and exits 0 when work was done.

Export the store

Empty store

The CLI is explicit about empty-state situations instead of reporting false success:

Why is my store empty?

get_global_store() is an in-memory singleton scoped to the current process. The agent runtime does not write to it automatically — it only holds what a caller populated in this process via the context API. A separate CLI process cannot see a store an agent run filled elsewhere; move it across processes with snapshot() / restore(). See Context Management API → Scope.
This CLI context compact is not the runtime ContextCompactor (the /context compact slash command / ExecutionConfig(context_compaction=True)). The CLI operates on the process-local get_global_store(); the runtime compactor trims a live agent’s chat_history. See Context Compaction.

See Also