GoodMem
ReferenceCLIMemory

Memory Create

Memory Create CLI command reference

goodmem memory create

Create a new memory

Synopsis

Create a new memory in the GoodMem service.

Content can be provided in one of three ways:

  1. Using the --content flag for inline text (defaults to "text/plain" content type)
  2. Using the --file flag to read from a file (content type is inferred from file extension)
  3. Providing content via stdin (pipe or interactive)
goodmem memory create [flags]

Examples

  # Create a memory with a client-provided ID and inline text content
  goodmem memory create --id "550e8400-e29b-41d4-a716-446655440000" --space-id 123e4567-e89b-12d3-a456-426614174000 --content "This is a test memory"

  # Create a memory with inline text content (server-generated ID)
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content "This is a test memory"

  # Create a memory with explicit content type
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "text/plain" --content "This is a test memory"

  # Create a memory from a file (content type automatically inferred from extension)
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --file document.pdf

  # Create a memory from a file with explicit content type
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "application/pdf" --file document.pdf

  # Create a memory from stdin (defaults to "text/plain" content type)
  cat document.txt | goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000

  # Create a memory from stdin with explicit content type
  cat document.txt | goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "text/plain"

  # Skip page-image extraction for this upload
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --file document.pdf --no-extract-page-images

  # Add metadata using key=value format
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "text/plain" --content "Test" --metadata "source=user" --metadata "category=note"

  # Add metadata using JSON format
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "text/plain" --content "Test" --metadata '`{"source":"user","category":"note"}`'

  # Add metadata from a JSON file
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --content-type "text/plain" --content "Test" --metadata @metadata.json

  # Create memory with custom chunking strategy
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --file document.txt --chunking recursive --chunk-size 1024 --chunk-overlap 128

  # Create memory with sentence-based chunking
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --file document.txt --chunking sentence --max-chunk-size 2000 --min-chunk-size 200

  # Disable chunking for small files
  goodmem memory create --space-id 123e4567-e89b-12d3-a456-426614174000 --file small.txt --chunking none

  # Get detailed chunking help
  goodmem memory create --chunking-help

Options

      --chunk-overlap uint32     Overlap between chunks (characters or tokens) (default 64)
      --chunk-size uint32        Maximum chunk size (characters or tokens) (default 512)
      --chunking string          Chunking strategy: none, recursive, sentence (default "recursive")
      --chunking-help            Show chunking strategies and detailed help
      --content string           Inline text content
      --content-type string      Content type of the memory (e.g., 'text/plain', 'application/pdf'). Defaults to 'text/plain' when using --content.
      --extract-page-images      Request page-image extraction for eligible documents (enabled by default)
      --file string              Path to file containing content
  -h, --help                     help for create
      --id string                Optional: Client-provided UUID for the memory (16 bytes). Server generates if omitted.
      --include-history          Include background job processing history in the response output when available
      --keep-separator string    Separator retention: start, end (default "end")
      --length-unit string       Length measurement unit: chars, tokens (default "chars")
      --metadata stringArray     Metadata in key=value format, JSON object, or @file.json to load from file
      --no-extract-page-images   Disable page-image extraction for this upload
      --no-history               Suppress background job processing history in the response output
      --separator strings        Custom separators (defaults: \\n\\n, \\n, space, empty string)
      --separator-regex          Treat separators as regex patterns
      --space-id string          ID of the space to create the memory in

Options inherited from parent commands

      --api-key string   API key for authentication (can also be set via GOODMEM_API_KEY environment variable)
      --server string    GoodMem server address (gRPC API)

SEE ALSO