AI / LangChain4j interview questions
What are the core modules of LangChain4j?
LangChain4j is organized into several Maven modules so you only pull in what you actually need. The main ones you will encounter in real projects are:
| Module | Artifact ID | Purpose |
|---|---|---|
| Core | langchain4j-core | Interfaces and abstractions (ChatLanguageModel, EmbeddingModel, ChatMemory, etc.) — no provider-specific code |
| Main | langchain4j | High-level features: AI Services, PromptTemplate, RAG pipeline components, chains, tools |
| Provider starters | langchain4j-open-ai, langchain4j-anthropic, etc. | One module per LLM provider — concrete implementations of core interfaces |
| Embedding stores | langchain4j-chroma, langchain4j-pgvector, langchain4j-pinecone, etc. | Vector database integrations for RAG |
| Document loaders | Built into main module | FileSystemDocumentLoader, UrlDocumentLoader, AmazonS3DocumentLoader, etc. |
| Spring Boot starter | langchain4j-spring-boot-starter | Auto-configuration, bean injection, properties binding for Spring applications |
| Quarkus extension | quarkus-langchain4j | CDI integration and native compilation support for Quarkus |
The design intentionally separates interfaces (core) from implementations (provider modules) so your application code can remain provider-agnostic. If you start with OpenAI and later want to switch to Anthropic or an on-premise Ollama instance, you swap the dependency and update a few configuration properties — the AI Services interface code stays unchanged.
More Related questions...