Skip to content

kompile-app ​

The Spring Boot RAG framework with 40+ pluggable modules. This is the largest part of the codebase.

Core interfaces ​

Defined in kompile-app-core:

InterfaceMethodDescription
EmbeddingModelembed(text)Returns INDArray embedding vector
VectorStoreadd/search/deleteDocument storage and similarity search
DocumentRetrieverretrieve(query, k)Returns top-k documents
LanguageModelgenerate(prompt)LLM text generation

Module categories ​

Embeddings (kompile-embedding-*) ​

ModuleBackend
kompile-embedding-anseriniSameDiff encoders (BGE, Arctic Embed, E5)
kompile-embedding-openaiOpenAI API
kompile-embedding-postgresmlPostgreSQL ML
kompile-embedding-samediffDirect SameDiff
kompile-embedding-sentence-transformerPython subprocess

Vector stores (kompile-vectorstore-*) ​

ModuleBackend
kompile-vectorstore-anseriniLucene HNSW (primary)
kompile-vectorstore-pgvectorPostgreSQL pgvector
kompile-vectorstore-chromaChroma client
kompile-vectorstore-vespaVespa

Document loaders (kompile-loader-*) ​

PDF (extended + tables), Office, Tika, web crawler, audio, Excel, email (IMAP, inbox, mail), Slack, Discord, Google Docs/Drive/Gmail/Workspace, Microsoft, OneDrive.

Data sources (kompile-source-*) ​

Confluence, Discord, email, Google Docs/Drive/Gmail/Workspace, Jira, Notion, OneDrive, Reddit, Slack.

Chunkers (kompile-chunker-*) ​

Markdown, recursive-character, sentence, token, table-aware.

LLM providers ​

OpenAI, Anthropic, Gemini, CLI agent passthrough, Spring AI, local SameDiff.

Other notable modules ​

ModulePurpose
kompile-model-managerModel download/cache to ~/.kompile/models/ with SHA256 verification
kompile-model-stagingModel lifecycle service (download, convert, validate, promote, serve)
kompile-graph-neo4jGraph RAG with Neo4j
kompile-knowledge-graphKnowledge graph construction
kompile-kvcachePaged KV cache for local LLM inference
kompile-kclawAgent hub for running CLI agents in the browser
kompile-code-indexerSemantic code search and indexing
kompile-evaluationRAG evaluation harness
kompile-guardrailsInput/output guardrails
kompile-ocr-*OCR pipeline (core, data pipeline, integration, models, post-process)
kompile-a2aAgent-to-Agent protocol
kompile-tool-*MCP/Spring AI tools (RAG, filesystem, graph, crawler, workflow, etc.)

Plugin architecture ​

Modules are activated via Spring conditional beans:

java
@Component
@ConditionalOnProperty(name = "kompile.vectorstore.type", havingValue = "myvectorstore")
public class MyVectorStoreImpl implements VectorStore { ... }

Building ​

bash
# Build kompile-app-main only (never build the entire parent)
cd kompile-app/kompile-app-main
mvn clean package

# With UI (default)
mvn clean package

# Backend-only (faster iteration)
mvn clean package -Dskip.ui

Adding a new module ​

When adding a new kompile-app sub-module referenced by kompile-app-main:

  1. Parent POM (kompile-app/pom.xml): Add <module> and <dependency> in <dependencyManagement>
  2. Main app POM (kompile-app/kompile-app-main/pom.xml): Add dependency
  3. Sample project POM (kompile-rag-builds/kompile-sample/project/pom.xml): Add dependency
  4. RagPomGenerator (kompile-cli/.../RagPomGenerator.java): Add @CommandLine.Option field and addDependency() call

Released under the Apache-2.0 License.