Content Intelligence Platform

Year2026
TechnologyJava, Spring Boot, PostgreSQL, Kafka, OpenSearch, pgvector, Gemini, OpenAI, Flyway
OUTBOX · KAFKA · OPENSEARCH · PGVECTOR

Content Intelligence Runtime

A database-first publication pipeline that versions content once, then builds independent search, RAG and subscriber projections from committed events.

DESIGN INTENTOne authoritative write with replayable downstream projections
SYSTEM FLOW / LIVE TRACE

Publish request path

AUTHORITATIVE WRITE
TRANSACTIONAL EVENT FLOW
READ PROJECTIONS
READYTRACE READYStart the trace to follow this requestSTEP 01 / 07
EXECUTION PLAN07 STAGES
  1. 01
    Admin Console

    An admin publishes a reviewed content revision

  2. 02
    Admin Content Service

    The command is validated and authorized

  3. 03
    Content System of Record

    Source, version, audit and outbox rows commit together

  4. 04
    Reliable Outbox Relay

    The relay claims the committed publication event

  5. 05
    Event Backbone

    Kafka fans out versioned projection contracts

  6. 06
    OpenSearch Indexer

    The search worker fetches the committed source

  7. 07
    Search Projection

    The current OpenSearch document is replaced idempotently

01
SELECTED COMPONENT

Admin Console

ROLE

Creates, edits and publishes versioned portfolio content.

DATA

Draft metadata, rich content and publish command

RELIABILITY

Authenticated mutations and explicit publication state

Project

Platform Case Study · Content Intelligence

Content Intelligence Platform

From Admin Commit to Search and RAG Projections

This system turns one authoritative content mutation into independently rebuildable search and retrieval projections. The synchronous write path ends at PostgreSQL; Kafka carries post-commit work to OpenSearch and pgvector without coupling authoring latency to model or index availability.

1. Problem and Design Thesis

A portfolio article must be editable and immediately durable, but search enrichment, semantic chunking and embeddings are slower and less reliable than a database transaction. Calling those dependencies inline would make publishing fragile and create a dual-write problem.

Commit the source of truth once, then derive every search and AI projection asynchronously.

2. Architecture

flowchart LR Admin[Admin UI] --> API[Admin Service] API --> TX[(Postgres transaction)] TX --> Source[Content tables + versions] TX --> Outbox[Transactional outbox] Outbox --> Kafka{{Kafka content topics}} Kafka --> Search[Search Indexer] Kafka --> RAG[RAG Indexer] Search --> Enrich[Gemini doc2query] Search --> OS[(OpenSearch BM25 index)] RAG --> Chunk[Chunk + embed] Chunk --> Vector[(pgvector knowledge chunks)] OS --> Query[Search API] Vector --> Agent[Agent retrieval]

3. Write and Publication Contract

StageResponsibilityGuarantee
ValidateJWT allow-list, schema and optimistic versionUnauthorized or stale writes are rejected
CommitSource row, content version, audit and outboxOne atomic PostgreSQL transaction
PublishPost-commit outbox dispatcherAt-least-once Kafka delivery
ProjectSearch and RAG consumersIdempotent upsert by source ID and version

4. Search Projection

The search consumer fetches the committed source document, applies deterministic field mapping and optionally generates query expansions. It writes a versioned document to OpenSearch. Retrieval combines BM25 fields, query-time synonyms and bounded expansion terms; failed enrichment degrades to the original document instead of blocking indexing.

5. RAG Projection

The RAG consumer normalizes HTML, splits content into stable chunks and creates embeddings. New chunks become ACTIVE only after the new version is complete. Previous chunks can then be retired, preventing a partially indexed article from becoming visible to the agent.

  • Chunk identity is derived from source ID, version and ordinal.
  • Embedding calls are retryable and isolated from the admin request.
  • The projection can be rebuilt from source content without data loss.
  • Retrieval permission filters run before candidate ranking.

6. Failure and Replay Model

stateDiagram-v2 [*] --> PENDING PENDING --> PROCESSING PROCESSING --> DONE PROCESSING --> RETRYABLE: transient dependency failure RETRYABLE --> PROCESSING: backoff elapsed PROCESSING --> FAILED: retry budget exhausted FAILED --> PENDING: admin retry or replay

Consumers acknowledge only after a durable projection write. Poison events move to a dead-letter path with the source ID, version and failure category. Admin operators can retry a single job or replay from source data after an index mapping change.

7. Observability

Every content version shares correlation fields across the outbox, Kafka headers, indexing jobs and target documents. Dashboards expose queue age, indexing latency, retry count, zero-result rate and projection version drift.

8. Trade-offs

The design accepts eventual consistency: a published article can be durable before it becomes searchable. In return, authoring remains available during model or OpenSearch outages, and every derived store remains disposable and rebuildable.

9. Engineering Outcome

The platform unifies admin CRUD, versioning, OpenSearch and RAG behind one event-driven content lifecycle while preserving clear ownership: PostgreSQL owns truth; consumers own projections; Kafka owns delivery between them.