Provides configuration patterns for LangChain4J vector stores in RAG applications. Use when building semantic search, integrating vector databases (PostgreSQL/pgvector, Pinecone, MongoDB, Milvus, Neo4j), implementing embedding storage/retrieval, setting up hybrid search, or optimizing vector database performance for production AI applications.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Provides configuration patterns for LangChain4J vector stores in RAG applications. Use when building semantic search, integrating vector databases (PostgreSQL/pgvector, Pinecone, MongoDB, Milvus, Neo4j), implementing embedding storage/retrieval, setting up hybrid search, or optimizing vector database performance for production AI applications.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep
LangChain4J Vector Stores Configuration
Configure vector stores for Retrieval-Augmented Generation applications with LangChain4J.
Overview
LangChain4J provides a unified abstraction for vector stores (PostgreSQL/pgvector, Pinecone, MongoDB Atlas, Milvus, Neo4j) with builder-based configuration, metadata filtering, and hybrid search support.
When to Use
Configuring vector stores for semantic search and RAG applications
Setting up embedding storage with metadata filtering and hybrid search
Optimizing vector database performance for production AI workloads
Instructions
Set Up Basic Vector Store
Configure an embedding store for vector operations:
Use InMemoryEmbeddingStore for local development and testing
Fast setup, no external dependencies
Data lost on application restart
For Production:
PostgreSQL + pgvector: Excellent for existing PostgreSQL environments
Pinecone: Managed service, good for rapid prototyping
MongoDB Atlas: Good integration with existing MongoDB applications
Milvus/Zilliz: High performance for large-scale deployments
Configure Appropriate Index Types
Choose index types based on performance requirements:
// For high recall requirements
.indexType(IndexType.FLAT) // Exact search, slower but accurate// For balanced performance
.indexType(IndexType.IVF_FLAT) // Good balance of speed and accuracy// For high-speed approximate search
.indexType(IndexType.HNSW) // Fastest, slightly less accurate
// Use environment variables@Value("${vector.store.api.key:#{null}}")private String apiKey;
// Validate configuration@PostConstructpublicvoidvalidateConfiguration() {
if (StringUtils.isBlank(apiKey)) {
thrownewIllegalStateException("Vector store API key must be configured");
}
}
References
For comprehensive documentation and advanced configurations, see: