Documentation Index: Fetch llms.txt first to discover every published page. This page is also available as Markdown at /cli-overview/cli-memories-and-chat.md.
Verified · 8/11/2026

Memories and Chat Commands

Store, fetch, and search durable JSON records from the terminal with primitive memories, and use the interactive primitive chat REPL for testing conversational flows against your account.

The primitive memories command group reads and writes Primitive Memories, the durable JSON key-value record store, directly from the terminal. primitive chat opens an interactive REPL for testing conversational flows against your account without writing a script first.

Use memories when you're debugging what a function or agent has stored, seeding state before a test run, or clearing stale keys. Use chat when you want a quick interactive session without standing up a client.

Values must be valid JSON, and memories search matches key prefixes only, not free text.

Prerequisites#

Store and retrieve memories#

Use primitive memories set, get, search, and delete to manage durable JSON records from the terminal. Memories default to org scope. Pass --function <function-id> to read or write the same key under a function's scope instead; the value must be the function's id UUID, not its name.

  1. 1

    Set a memory value#

    Values must be valid JSON. Quote plain strings as JSON strings.

    primitive memories set thread:latest '{"email_id":"em_123"}'
    primitive memories set greeting '"hello"'
    

    Values must be valid JSON, so a plain string has to be quoted as a JSON string: use '"hello"', not hello.

  2. 2

    Get a memory value#

    primitive memories get thread:latest
    
  3. 3

    Search memories by key prefix#

    memories search is key-prefix search, not free-text or semantic search. For free-text mail search use primitive search or primitive semantic-search instead.

    primitive memories search thread:
    

    Pass --metadata-only to list matching keys without fetching each value, useful for a quick inventory scan:

    primitive memories search thread: --metadata-only
    
  4. 4

    Delete a memory#

    primitive memories delete thread:latest
    

Function-scoped memories#

Pass --function <function-id> on any of the four subcommands to read or write the same key under a specific function's scope instead of the org's:

primitive memories set state '{"step":2}' --function <function-id>
primitive memories get state --function <function-id>
Tip

The --function value is the function's id UUID, not its name. If you only have the name, look the id up with primitive functions list.

Warning

primitive memories delete is permanent. There is no undo and no trash/recovery period for a deleted key.

Interactive chat REPL#

primitive chat opens an interactive REPL against your account, so you can exercise a conversational flow without writing a throwaway script.

primitive chat

Inside the REPL, reply to the active thread the same way the SDK's client.reply would, including attachments:

primitive chat reply "See attached" --attachment ./report.pdf
Note

primitive logout --force clears local CLI credentials, pending email-code auth state, and stale credential locks without contacting Primitive. Reach for it when an interrupted auth command leaves the CLI reporting that another credential operation is already in progress. See Authentication: login, signup, logout, whoami.

Next steps#

Was this page helpful?

© Primitive SDKs

Powered by Browzer