Get Started with the CLI
Use the GoodMem CLI on a self-hosted server to create an embedder, a space, and an LLM, add a PDF, and run a search.
This guide uses the GoodMem CLI. You will create an embedder, a space, and an LLM, add a PDF, and run a search. To do the same steps in your browser, see Getting Started.
The CLI uses gRPC. It works with a self-hosted server. GoodMem Cloud instances do not expose the gRPC port, so use the Console, an SDK, or REST for Cloud.
Before you start
You need the CLI and a running server. Use one of these options:
-
Self-hosted installation. Install GoodMem. The installer saves your root API key in the active CLI profile, so CLI commands work immediately.
-
Codespace. Open a Codespace from the GoodMem template repository. It includes the server and the CLI:
The Codespace can also install optional tools, such as Jupyter Notebook, the SDK playground, and other languages. In the Codespace terminal, run:
source .devcontainer/optional-feature-installer.shThe template's optional features instructions list the tools and versions.
To show your GoodMem API key, use this command:
goodmem profile current --show-api-keyThe command shows the active CLI profile only. For a local installation, it also shows the Console URL.
The SDKs and the REST API also need this key. The Security Model page explains how API keys and permissions work.
If you operate a hosted or shared server, also read these guides before you accept traffic:
- Disable executable extensions if you do not need custom Java processors. Built-in chat processing and the examples below continue to work.
- Export traces from GoodMem to send server diagnostics to an OpenTelemetry collector.
The default install uses a self-signed certificate. TLS is enabled out of the box, but clients cannot verify the ephemeral certificate. For local development, mkcert creates certificates trusted by your system. Clients with a separate CA bundle, including the Python SDK, also need that CA configured; see Python TLS configuration. The mkcert guide also covers migrating an existing install. See TLS Configuration for all options.
Set up models and a space
-
Get an OpenAI API key from the OpenAI dashboard.
To keep the key out of your shell history, export it as
GOODMEM_CRED_API_KEY. Then omit--cred-api-keyin the commands below. The CLI reads the environment variable when the flag is absent. -
Create an embedder. You must create the embedder before the space:
goodmem embedder create \ --display-name "OpenAI Small Embedder" \ --provider-type OPENAI \ --endpoint-url "https://api.openai.com/v1" \ --model-identifier "text-embedding-3-small" \ --dimensionality 1536 \ --cred-api-key YOUR_OPENAI_API_KEY_FROM_STEP_1The command should output:
Embedder created successfully! ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Display Name: OpenAI Small Embedder Owner: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Provider Type: OPENAI Distribution: DENSE Endpoint URL: https://api.openai.com/v1 API Path: /embeddings Model: text-embedding-3-small Dimensionality: 1536 Modalities: TEXT Created by: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created at: 2026-08-20T21:09:00ZSAVE THE ID
For help with
endpoint_urlorapi_pathfor other providers, see the Endpoint registration guide. -
Create a space that uses that embedder:
goodmem space create \ --name "My OpenAI Small Space" \ --embedder-id YOUR_EMBEDDER_ID_FROM_STEP_2The command should output:
Space created successfully! ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Name: My OpenAI Small Space Owner: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created by: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created at: 2026-08-20T21:08:20Z Embedder: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (weight: 1.0)SAVE THE ID
-
Create an LLM to write answers:
goodmem llm create \ --display-name "My GPT-4o" \ --provider-type OPENAI \ --endpoint-url "https://api.openai.com/v1" \ --model-identifier "gpt-4o" \ --cred-api-key YOUR_OPENAI_API_KEY_FROM_STEP_1The command should output:
LLM created successfully! ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Display Name: My GPT-4o Owner: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Provider Type: OPENAI Endpoint URL: https://api.openai.com/v1 API Path: /chat/completions Model: gpt-4o Modalities: TEXT Capabilities: Chat, Completion, Functions, System Messages, Streaming, Sampling Parameters Created by: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created at: 2026-03-17T23:06:04Z Capability Inference: ✓ Chat Support: true (detected from model family 'gpt-4o') ✓ Completion Support: true (detected from model family 'gpt-4o') ✓ Function Calling: true (detected from model family 'gpt-4o') ✓ System Messages: true (detected from model family 'gpt-4o') ✓ Streaming: true (detected from model family 'gpt-4o') ✓ Sampling Parameters: true (detected from model family 'gpt-4o')SAVE THE ID
Add a document and search
-
Create a memory. This guide uses this sample PDF:
Download it, then run this command:
goodmem memory create \ --content-type "application/pdf" \ --file "PATH_TO_WHERE_YOU_DOWNLOADED_THE_PDF" \ --space-id YOUR_SPACE_ID_FROM_STEP_3It should output:
Memory created successfully! ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Space ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Content Type: application/pdf Page images: enabled Status: PENDING Created by: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created at: 2026-03-17T23:18:33Z Metadata: filename: social_media_study.pdfSAVE THE ID (not the space ID, because you already have that)
-
Wait for processing to complete. The memory starts as
PENDING. GoodMem then extracts the text, divides it into chunks, and embeds them. Search finds the content only after this work completes. To see the status, list the memories in the space:goodmem memory list --space-id YOUR_SPACE_ID_FROM_STEP_3Find the row whose MEMORY ID is the ID from step 1. Run the command again until that row's STATUS is
COMPLETED. Other rows can be older memories in the same space, so do not use their status. If the status isFAILED, make sure that the embedder's provider key is correct. -
Run a search. You can use non-interactive mode or interactive mode.
Non-interactive mode returns the matching chunks:
goodmem memory retrieve \ "what are the top three negative effects of social media?" \ --space-id YOUR_SPACE_ID_FROM_STEP_3Interactive mode opens a screen where you select the LLM from step 4 of the model setup. The LLM then writes an answer from the chunks:
goodmem memory retrieve \ --post-processor-interactive "what are the top three negative effects of social media?" \ --space-id YOUR_SPACE_ID_FROM_STEP_3
Next steps
- Building a Basic RAG Agent does the same steps with cURL or an SDK.
- OCR Quickstart adds text extraction for scanned documents. The OCR add-on is not included in the base install.
- The CLI reference lists all commands.
Getting Started
Open GoodMem Cloud or a self-hosted Console, set up models and a space, upload your first document, run a search, and connect an application.
Install and Upgrade GoodMem
Install GoodMem with the installer script, upgrade an existing installation, or install and upgrade using registry mirrors and offline packages.