ReferenceCLI
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:
- Using the --content flag for inline text (defaults to "text/plain" content type)
- Using the --file flag to read from a file (content type is inferred from file extension)
- 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"
# 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-helpOptions
--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.
--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: none, 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-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 inOptions 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) (default "https://localhost:9090")SEE ALSO
- goodmem memory - Manage GoodMem memories