Skip to main content
Run the maintained Java quickstart example and retrieve your first Memind memory. This guide uses the default pure Java path: memind-core, Spring AI, SQLite, and a local file-based vector store. You will run a complete memory cycle:

Prerequisites

Before you start, make sure you have:
  • Java 21 - Maven - An OpenAI-compatible API key
Set your API key as an environment variable:
By default, the Java examples use: If you use an OpenAI-compatible provider, override the model endpoint and model names:

Clone the repository

Run the quickstart example

Run the maintained quickstart example:
If you already exported OPENAI_API_KEY, you can omit it from the command:

What the example does

The quickstart example runs two steps: it extracts memory from a prepared conversation, then retrieves relevant memory with a natural-language query.

Step 1: Extract memory

The example loads conversation messages from:
Then it creates a memory identity:
A Memind memory identity is made of: The example writes the conversation messages with:
This extracts memory from the message batch. Internally, Memind stores source-level Raw Data, extracts structured Memory Items, and updates insight-related buffers when insight extraction is enabled.

Step 2: Retrieve memory

After extraction, the example asks a natural-language question:
Then it retrieves memory with the SIMPLE strategy:
SIMPLE retrieval is the low-latency retrieval path. It can combine vector search, keyword search, temporal signals, graph assist, memory-thread assist, and result fusion depending on the runtime options.

Understand the core API

For most applications, the core API starts with three concepts.

Build a runtime

Memind is assembled through Memory.builder(). The quickstart runtime wires together:
  • a structured chat client - a memory store - a conversation buffer - text search - a vector store - runtime options
The full builder configuration is handled by the example support code. You do not need to write it manually for this quickstart.

Write memory

Use addMessages() when you already have a complete conversation segment:
For streaming chat applications, Memind also supports addMessage(), which buffers messages and commits them when a conversation boundary is detected.

Retrieve memory

Use retrieve() when your agent needs relevant context:
Retrieval can return memory items, insights, raw-data references, evidence, and debug traces depending on the interface and configuration.

Runtime data

The quickstart writes local runtime data under:
The default files are:
If you want to rerun the example from a clean state, delete that directory:

Troubleshooting

Missing API key

If OPENAI_API_KEY is missing, the example cannot create the model client. Set it before running the example:

Wrong Java version

Memind requires Java 21. Check your local Java version:

Maven dependency download is slow

The first run may take longer because Maven downloads dependencies for the multi-module build. Run the same command again after dependencies are cached.

OpenAI-compatible provider issues

If you use a non-default provider, check that OPENAI_BASE_URL, OPENAI_CHAT_MODEL, and OPENAI_EMBEDDING_MODEL match that provider. For example: