Skip to content

Architecture

LM Foundry is a single-page web app in front of a set of Java services. The backend is Java 21, Spring Boot and Spring AI, on reactive (WebFlux) services, built as one Gradle multi-module project. Each service owns its database; the only exception is the knowledge base and its indexer, which share one.

Browser ─► Foundry UI (React SPA) ──── OIDC sign-in ────► Identity provider
                │
                │ HTTPS + bearer token
                ▼
          API gateway        /api/<service>/v1/...  →  <service> /v1/...
                │
                ▼
Services   chat · knowledge-base · web-crawler · agents · tools · prompts · users · ...
                │                     │               │
                │      RabbitMQ (indexing jobs, crawl events)
                │                     │
                ▼                     ▼
Internal   builtin-tools        knowledge-indexer · crawler topology ──► verified websites
                │                     │
                ▼                     ▼
Stores     MongoDB · PostgreSQL + pgvector (or Azure AI Search) · Blob storage · URLFrontier

External   Models: Azure OpenAI or any OpenAI-compatible endpoint (LM Studio) · MCP servers
ServiceGateway routeRole
Foundry UIn/aReact 19 single-page app; signs users in over OpenID Connect and calls the gateway.
chat-orchestration/api/modelChat completion with streaming, retrieval, tool calling, chat memory, embeddings, images; resolves agents and enforces grounding.
knowledge-base/api/kbKnowledge bases and their items, uploads, indexing requests.
knowledge-indexernone (worker)Consumes indexing jobs: parse, chunk, embed, write vectors.
web-crawler/api/web-crawlerDomain verification, website sources, crawl runs, page review, commits pages to the knowledge base.
web-crawler-topologynone (worker)Fetches pages (Apache StormCrawler), extracts Markdown, stores pages, reports events.
agent-management/api/agentAgents, their grounding settings and the support-agent template.
tools-management/api/toolsTool definitions, MCP server registry and health checks.
builtin-toolsnone (service to service)Calculator, email, web search, fetch page; called only by the chat service.
prompt-management/api/promptPrompt library and gallery.
app-management/api/applicationApplications.
user-management/api/userUsers, tenants, subscriptions and memberships.
authorization-serviceinternalAnswers who a caller is and which subscriptions they belong to.
permission-management-service/api/permissionsPermissions.
deployment-management/api/deploymentModel catalog and deployments (in development).
ComponentUsed for
MongoDBKnowledge base catalogue and items, tools, prompts, agents, applications, crawler state. One database per service.
PostgreSQL with pgvectorVectors, chat memory, tenants and memberships, access control, model catalog.
Azure AI SearchOptional vector index instead of pgvector.
Blob storage (Azure Blob; Azurite locally)Uploaded files, crawled pages, images.
RabbitMQIndexing jobs (with a dead-letter queue), crawl events.
URLFrontierCrawl state, one crawl per website source.
Identity providerOpenID Connect sign-in and token validation. The local stack runs Authentik.
  • One asynchronous boundary for documents. Indexing goes through RabbitMQ; everything else is synchronous HTTP.
  • No shared databases between services, except knowledge-base and knowledge-indexer.
  • Every request is scoped to a subscription, checked once by a shared filter before any controller runs. See Subscriptions and tenants.
  • Services call each other with the user’s token, so access checks apply all the way down. System flows (indexing, crawling) use a service account.

The reasoning behind these choices is in Architecture decisions.