Built-in LangChain4j Providers
Maven Coordinates
No additional dependencies are required beyond the LangChain4j integration core dependencies.
Content Retriever
Provider key: lc4j-content-retriever.
In LangChain4j RAG, ContentRetriever is the component that takes a user
query, retrieves relevant content from an underlying data source, and returns
ranked content used to augment the prompt.
In Helidon, this provider creates LangChain4j content retrievers from
configuration. If type is not set, Helidon uses the default
embedding-store-content-retriever
(ContentRetrieverType.EMBEDDING_STORE_CONTENT_RETRIEVER) and wires it using
the configured embedding model and embedding store.
In a typical RAG setup (see RAG), a named retriever references:
- an
EmbeddingModel(embedding-model) - an
EmbeddingStore<TextSegment>(embedding-store)
Each entry under langchain4j.content-retrievers becomes a named singleton
declarative service bean in the Helidon service registry. You can attach it to
AI services or agents using @Ai.ContentRetriever("name"), or inject it
directly by name.
Configuration properties:
Configuration options
| Key | Type | Default | Description |
|---|---|---|---|
embedding- | String | Explicit embedding model to use in the content retriever | |
display- | String | Display name for this content retriever configuration | |
embedding- | String | Embedding store to use in the content retriever | |
max- | Integer | Maximum number of results to return from the retriever | |
type | Content | EMBEDDING_ | Type of content retriever to create |
enabled | Boolean | true | If set to false, component will be disabled even if configured |
min- | Double | Minimum score threshold for retrieved results |
In-Memory Embedding Store
Provider key: lc4j-in-memory.
In LangChain4j in-memory embedding store integration,
InMemoryEmbeddingStore is an in-process vector store implementation suitable
for local or lightweight use cases.
In Helidon, this provider creates InMemoryEmbeddingStore<TextSegment>
instances from langchain4j.embedding-stores.<name> configuration entries.
Each entry becomes a named singleton declarative service bean in the Helidon service registry. That named embedding store can be referenced by configured content retrievers and can also be injected by name into other service beans.
If from-file is configured, Helidon initializes the store by loading
previously persisted embeddings and segments using LangChain4j
InMemoryEmbeddingStore.fromFile(...). If from-file is not configured, the
store starts empty.
Configuration properties:
Configuration options
| Key | Type | Default | Description |
|---|---|---|---|
from- | Path | Path to a JSON file used to initialize the in-memory embedding store via In | |
enabled | Boolean | true | Whether this embedding store component is enabled |