<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[laputski]]></title><description><![CDATA[System Design, AI / Solution / Data Architecture]]></description><link>https://laputski.ai</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1766770133223/bdc8f9e0-dd31-44e7-b526-2f297dcb24fe.webp</url><title>laputski</title><link>https://laputski.ai</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 17:55:37 GMT</lastBuildDate><atom:link href="https://laputski.ai/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Advanced RAG Trade-offs]]></title><description><![CDATA[Abstract
Classic RAG addresses contextual search in small, homogeneous knowledge bases. Advanced RAG extends this model to production scale: it adds hybrid search, multi-layer filtering, prompt manage]]></description><link>https://laputski.ai/advanced-rag-trade-offs</link><guid isPermaLink="true">https://laputski.ai/advanced-rag-trade-offs</guid><category><![CDATA[RAG ]]></category><category><![CDATA[llm]]></category><category><![CDATA[advanced rag]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Fri, 27 Mar 2026 22:22:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/1d148b04-f725-4517-a0a8-8dd01b33dd37.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Abstract</h2>
<p><strong>Classic RAG</strong> addresses contextual search in small, homogeneous knowledge bases. <strong>Advanced RAG</strong> extends this model to production scale: it adds hybrid search, multi-layer filtering, prompt management, and protective mechanisms. <a href="https://github.com/laputski/langgraph-rag-guardrails">Github example</a>.</p>
<p>A special role belongs to <strong>Sovereign AI</strong> – deploying a language model entirely within an organization's own infrastructure, including air-gapped environments with no internet access. This approach is mandatory wherever data cannot leave the security perimeter.</p>
<h2>Solution Architecture</h2>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/2886a332-8dd5-4bae-9769-1ec527e4b6cf.png" alt="" style="display:block;margin:0 auto" />

<h3>Gateway &amp; Auth</h3>
<p>The system authenticates and authorizes every request, enforces rate limiting per user and role, validates input data, and protects against prompt injection attacks.</p>
<h3>Query Processing</h3>
<p>Before retrieval, the user's query goes through three optional transformations. <strong>Rewriting</strong> reformulates the query to better match the terminology of the knowledge base. This is especially important when users phrase questions in conversational language. <strong>Decomposition</strong> breaks a complex, multi-part question into several sub-queries, each processed independently with results merged afterward. <strong>HyDE</strong> (Hypothetical Document Embeddings) generates a hypothetical answer to the query and uses its embedding for retrieval – this improves recall in highly specialized corpora where the query and the document are phrased very differently.</p>
<h3>Embedding Model</h3>
<p>Converts query text into a vector representation for dense retrieval. The model is deployed locally (Nomic, BGE, or equivalent). In air-gapped environments, model weights are pre-loaded before network isolation. Embedding quality directly determines dense retrieval quality: switching models requires a full re-indexing of the corpus.</p>
<h3>Hybrid Retrieval</h3>
<p>Search runs in parallel across two indexes. Dense retrieval searches vector embeddings via an HNSW index in the vector database and it captures semantic similarity well. Sparse retrieval via BM25 searches by keywords. It is precise on terms, abbreviations, and numbers where semantic search returns irrelevant results.</p>
<h3>RRF Fusion</h3>
<p>Reciprocal Rank Fusion merges the results of dense and sparse retrieval into a single ranked list. Each document receives a final score based on its positions in both lists, without the need to normalize heterogeneous scores. This enables correct merging of results from two fundamentally different retrieval methods.</p>
<h3>Reranker</h3>
<p>A cross-encoder reranker jointly re-scores each query–chunk pair (unlike bi-encoder embeddings, which encode the query and document independently). This yields significantly more accurate ranking at the cost of additional compute. It is applied to the Top-K results after fusion, not to the entire corpus.</p>
<h3>Guardrails</h3>
<p>Before returning a response, the system checks it for hallucinations, toxicity, and policy compliance. If a check fails, the request is sent for re-generation.</p>
<h3>Semantic Cache</h3>
<p>Similar queries receive a response from cache without invoking the LLM. TTL policies manage data freshness and prevent stale responses from being served.</p>
<h3>Prompt Registry</h3>
<p>A centralized store of versioned prompt templates. It enables A/B testing, rollbacks, and separation of templates by task type. All without changing service code.</p>
<h3>Streaming Response</h3>
<p>The response is delivered to the user token by token as it is generated, without waiting for the full output to complete. This reduces perceived latency. An important constraint: guardrails in streaming mode cannot inspect the full response before delivery begins, bacause this requires either buffering or moving some checks to a post-processing layer.</p>
<h3>Observability</h3>
<p>Self-hosted <strong>Langfuse</strong> traces every request across all pipeline stages, from gateway to streaming response. RAGAS metrics (faithfulness, answer relevance, context recall) evaluate response quality automatically. The feedback loop collects explicit user ratings and links them to specific traces. In air-gapped environments, the entire observability stack is deployed inside the perimeter.</p>
<h3>Sovereign AI &amp; Air-Gapped Deployment</h3>
<p>The language model, embedding model, and reranker are deployed on-premise. Container images and model weights are pre-loaded before network isolation. The vector database, cache, Prompt Registry, and observability stack are hosted inside the perimeter. Guardrails run locally with no calls to external moderation APIs.</p>
<h2>Trade-offs: Classic vs Advanced RAG</h2>
<p>Classic RAG starts quickly and is easy to maintain. It performs well on knowledge bases of up to 10–50K documents with homogeneous content and straightforward queries. Answer accuracy stays around 60–70%, latency is minimal, and the infrastructure requires no specialized expertise.</p>
<p>Advanced RAG addresses problems that Classic RAG cannot solve by design. Dense-only search handles exact terms and abbreviations poorly as sparse retrieval fills that gap. Without a reranker, Top-K results contain irrelevant chunks that degrade generation quality. Without guardrails, hallucinations reach the user. Without semantic cache, every repeated query consumes LLM budget.</p>
<p>The cost of these improvements is measured in latency and operational complexity. The full stack adds 300–700 ms to the base LLM call. The reranker contributes 100–300 ms, guardrails another 50–150 ms, and both require threshold tuning. With proper configuration of semantic cache and async reranking, P95 latency stays within 2–3 seconds, and the number of LLM calls drops by 60–70%. Hybrid retrieval improves accuracy by 15–25% over dense-only, but requires maintaining two synchronized indexes.</p>
<p>Sovereign AI adds operational overhead for managing a GPU cluster and manually updating model weights. Air-gapped deployment requires pre-loading all artifacts before network isolation and eliminates any external dependencies including moderation APIs and cloud-based observability. PII data in traces requires explicit masking when configuring self-hosted Langfuse. Air-gapped environments are particularly resource-sensitive: every component competes for the same CPUs and GPUs inside the perimeter.</p>
<p><strong>Implementation recommendation.</strong> Start with Classic RAG. Run it in a dev environment, load real data, and identify the bottlenecks – where accuracy falls short, where latency is unacceptable, where users receive hallucinations. Only once a specific problem is confirmed should you add the corresponding Advanced RAG component. This is especially relevant for air-gapped environments, where resources are constrained and every additional service requires justification.</p>
<h2>Integration with Existing Systems</h2>
<p>Both Classic and Advanced RAG are deployed as an isolated module behind a dedicated AI Gateway. The rest of the system calls a single API and has no knowledge of which implementation is currently active. This provides several practical advantages.</p>
<p>Switching between implementations is done via blue/green deployment with no changes on the calling service side. Both variants can run simultaneously, with different request types routed to each – for example, Simple RAG for standard FAQ scenarios and Advanced RAG for complex analytical queries. The choice of implementation is made at the API Gateway level based on request header, user role, or query type.</p>
<p>Both variants are stateless services. State is held in external stores: the vector database, cache, and Prompt Registry. This makes horizontal scaling and switching between implementations a configuration-level operation, not a refactoring effort.</p>
<h2>Failure Modes and Degradation</h2>
<p>Advanced RAG is more complex than Classic RAG and has more potential failure points. It is important to define upfront how the system behaves when each component degrades.</p>
<p><strong>Semantic Cache unavailable.</strong> All requests go directly to the LLM. Latency returns to baseline, and call costs grow proportionally with traffic. The system continues to function but loses the primary economic advantage of Advanced RAG.</p>
<p><strong>Guardrails false positive cascade.</strong> Guardrails begin blocking valid responses, so the user receives a rejection where the answer was correct. The system enters a re-generation loop and latency spikes sharply. The fix is threshold tuning and a circuit breaker that disables guardrails when the error rate exceeds a defined threshold.</p>
<p><strong>Reranker degrades or goes down.</strong> Search results are returned without reranking, in the order produced by retrieval. Top-K quality drops, but responses continue to be generated. The reranker is a good candidate for graceful degradation: when unavailable, simply skip the step.</p>
<p><strong>Dense and sparse index desynchronization.</strong> Documents are indexed in one store but not the other. RRF Fusion operates on incomplete data and search quality silently degrades invisible to the user. Detectable only through monitoring of index sizes and RAGAS metrics.</p>
<p><strong>General degradation principle.</strong> If Advanced RAG is too slow, unstable, or generating cascading errors – switch to Simple RAG. This is precisely why both variants are kept behind a single AI Gateway. I would say Simple RAG is not a last-resort fallback, it is more like a fully legitimate operating mode when the complex stack is under stress.</p>
<h2>Resource Estimation</h2>
<p>Providing specific recommendations for CPU, GPU, and memory is not meaningful as consumption depends too heavily on data volume, the choice of embedding model, request frequency, and the vector database in use. Actually, universal numbers do not exist.</p>
<p>Instead, use an iterative approach. Load 1% of your real data into the vector store, then measure latency, resource consumption, and Advanced RAG response quality. Repeat the test at 10%, then 50%, then 100%. At each step, record how system behavior changes. This produces a real scaling curve for your specific data and allows you to forecast production resource requirements before you get there.</p>
<h2>Business Cases</h2>
<p><strong>🏦 Financial Services &amp; Banking</strong></p>
<p>Banks process sensitive customer data and are subject to regulatory requirements (GDPR, PCI DSS, Basel III). Sovereign AI eliminates data transfer to external LLM APIs. Guardrails enforce compliance policy adherence. Hybrid retrieval accurately locates regulatory documents by exact terms and codes.</p>
<p><strong>🏥 Healthcare &amp; MedTech</strong></p>
<p>Medical data falls into a specially sensitive category under HIPAA and local data protection regulations. Hallucination detection is critical, because an incorrect response about dosage or diagnosis is not acceptable. Sparse retrieval accurately locates medical terms and ICD codes where semantic search returns irrelevant results. Air-gapped deployment is mandatory for clinical systems.</p>
<p><strong>⚖️ Legal Tech</strong></p>
<p>Legal systems require precise search across case law and regulatory documents. Prompt Registry stores versioned templates for different types of legal queries. The reranker surfaces relevant precedents above general documents. The feedback loop accumulates attorney ratings and incrementally improves ranking quality.</p>
<p><strong>🏛️ Government &amp; Defense</strong></p>
<p>Government systems require complete isolation from public networks. Air-gapped deployment with pre-loaded model weights is the only acceptable option. Input Rails protect against prompt injection attacks. All components, including observability, operate inside the secured perimeter with no external dependencies.</p>
<p><strong>🏢 Enterprise Knowledge Management</strong></p>
<p>Enterprise knowledge bases contain tens of thousands of documents in varied formats. Semantic Cache reduces costs by 60–70% for recurring employee queries. Metadata enrichment enables filtering by department, date, or document type. Hybrid retrieval performs equally well on technical specifications and unstructured text.</p>
<p><strong>🔬 R&amp;D / Scientific Research</strong></p>
<p>Research organizations work with proprietary scientific data and patents. Query decomposition breaks complex scientific questions into sub-queries and improves recall. HyDE generates hypothetical answers to improve retrieval in highly specialized corpora. Sovereign AI preserves competitive advantage – data never leaves for external providers.</p>
<blockquote>
<p><strong>The selection rule in one sentence:</strong> Advanced RAG justifies the investment in complexity if at least one condition holds – data is confidential, the knowledge base exceeds 50K documents, or answer accuracy is critical to the business or a regulator.</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Reference AI-Native GovTech Architecture]]></title><description><![CDATA[This article describes a reference architecture for a distributed system designed for typical GovTech projects. The key feature of the architecture is the AI-Native approach: sovereign artificial inte]]></description><link>https://laputski.ai/reference-ai-native-govtech-architecture</link><guid isPermaLink="true">https://laputski.ai/reference-ai-native-govtech-architecture</guid><category><![CDATA[AI-native]]></category><category><![CDATA[AI]]></category><category><![CDATA[#ai-tools]]></category><category><![CDATA[#govTech]]></category><category><![CDATA[architecture]]></category><category><![CDATA[Architecture Design]]></category><category><![CDATA[reference-architecture]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Sat, 21 Mar 2026 15:38:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/73c618ae-74b2-4649-a431-90fd8227c57c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article describes a reference architecture for a distributed system designed for typical GovTech projects. The key feature of the architecture is the <strong>AI-Native approach</strong>: <em>sovereign artificial intelligence is embedded as a cross-cutting component at every layer – from data enrichment to analytics and decision-making.</em></p>
<blockquote>
<p><strong>Sovereign AI</strong> – the ability of a state to develop, deploy, and control artificial intelligence technologies using its own infrastructure, data, personnel, and business ecosystems that are independent of external platforms.</p>
</blockquote>
<h2>System Requirements</h2>
<h3>Functional Requirements</h3>
<p><strong>FR-1: Continuous Data Ingestion.</strong> The system ingests data from heterogeneous sources (State Information System, State Information Resource, external APIs, file storage, IoT sensors, manual input). Supported modes include batch loading, streaming, and incremental synchronization (Change Data Capture). Sources may have limited bandwidth and unstable connectivity.</p>
<p><strong>FR-2: Unified Data Storage.</strong> All collected data is consolidated in a single data lake to leverage the benefits of shared data usage. The lake supports structured, semi-structured, and unstructured formats. The storage layer provides ACID transactions, versioning (time-travel), and access control.</p>
<p><strong>FR-3: Multi-Tier Processing Pipelines.</strong> Data passes through three quality tiers: <strong>Bronze</strong> (raw data as-is), <strong>Silver</strong> (cleansed, deduplicated, standardized), and <strong>Gold</strong> (aggregated, enriched, ready for consumption). Sovereign AI may be applied at each tier: classification, entity extraction, metadata generation, anomaly detection.</p>
<p><strong>FR-4: AI Enrichment and Target Logic.</strong> The platform enables the application of a sovereign LLM and proprietary ML models to solve applied tasks: semantic search (RAG), document classification, text recognition (OCR), response generation, predictive analytics, and decision support.</p>
<p><strong>FR-5: Analytics and Visualization.</strong> The system provides OLAP analytics, interactive dashboards, and report generation for leadership. Supported capabilities include ad-hoc SQL queries, multidimensional analysis, drill-down, and export to standard formats. An AI assistant helps formulate queries in natural language.</p>
<p><strong>FR-6: Model Training and Management.</strong> The platform provides a full MLOps lifecycle: experiment versioning, model registry, fine-tuning (LoRA), A/B testing, drift monitoring (Data Drift Monitoring is a tracking changes in incoming data properties), and automatic rollback.</p>
<h3>Non-Functional Requirements</h3>
<p><strong>NFR-1: Deployment Mode.</strong> On-premise, air-gapped environment (full or partial internet isolation). Updates are delivered via Data Diode or local repository. Controlled through architectural audit.</p>
<p><strong>NFR-2: Availability and Consistency.</strong> 99.9% for analytics and dashboard services; 99.5% for AI assistants. Strong consistency for mission-critical documents and eventual consistency for pipeline-generated data. Controlled via Prometheus, Grafana, and regular SLA reporting.</p>
<p><strong>NFR-3: Response Time.</strong> Dashboards and OLAP queries: &lt; 3 sec; RAG queries to LLM: &lt; 5 sec to first token; Batch processing: &lt; 4 hours for a daily batch. Controlled via OpenTelemetry and Jaeger.</p>
<p><strong>NFR-4: Throughput.</strong> ≥ 100 RPS (requests per second) at API Gateway; ≥ 500 concurrent users; ≥ 10 million documents uploaded per month. Controlled via k6 or Locust.</p>
<p><strong>NFR-5: Scalability.</strong> Horizontal scaling of all stateless components. Linear throughput growth when adding nodes. Controlled via Kubernetes HPA and utilization monitoring.</p>
<p><strong>NFR-6: Fault Tolerance.</strong> RPO (Recovery Point Objective) ≤ 1 hour; RTO (Recovery Time Objective) ≤ 4 hours. Data is replicated in 3 copies. Controlled via quarterly DR testing.</p>
<p><strong>NFR-7: Security.</strong> Data encryption at-rest (AES-256) and in-transit (TLS 1.3). RBAC at row and column level. Audit of all data operations. Controlled via penetration testing and log auditing.</p>
<p><strong>NFR-8: Resilience Under Resource Constraints.</strong> System capacity is expanded in increments (procurement occurs once a year). The system operates under partial GPU node loss (graceful degradation): AI functions degrade, but analytics remains available. Controlled via chaos engineering (Litmus).</p>
<p><strong>NFR-9: Observability.</strong> Logs, metrics, traces. Unified monitoring console. Alerts with escalation. Controlled via ELK/Loki + Prometheus + Jaeger.</p>
<p><strong>NFR-10: Compatibility.</strong> API – RESTful (OpenAPI 3.0) and gRPC. Data formats are Parquet, JSON, Avro. Storage is S3-compatible. SQL is ANSI SQL via Trino. Controlled via contract testing (Pact).</p>
<h2>General Architecture Concept</h2>
<p>The proposed architecture is a multi-tier platform that supports the full lifecycle of AI solutions – from data collection and processing to model inference and integration with application systems.</p>
<blockquote>
<p><strong>Note:</strong> The specific technology stack may vary depending on project requirements. The key invariant is the <code>architectural layers</code>, not the specific frameworks, which may be changed or replaced with proprietary solutions. The emphasis is on the use of <code>open-source</code> technologies.</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/9b42a68b-e7cd-45e3-84eb-4891a6c91910.png" alt="" style="display:block;margin:0 auto" />

<p><em>Diagram 1: Architectural layers and technology stack of the GovTech AI-Native platform</em></p>
<h2>Architecture Layer Descriptions</h2>
<h3>L1. Data Ingestion Layer</h3>
<p>This layer addresses <strong>FR-1</strong>: continuous collection of heterogeneous data from multiple government and external systems under conditions of limited bandwidth and unstable connectivity.</p>
<table>
<thead>
<tr>
<th>Ingestion Mode</th>
<th>Technology</th>
<th>When Applied</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Batch</strong></td>
<td>Apache Spark + Airflow</td>
<td>Scheduled exports from SIS, SIR. File arrays. Historical loads.</td>
</tr>
<tr>
<td><strong>Streaming</strong></td>
<td>Kafka Connect</td>
<td>Event streams: transactions, logs, IoT sensor data in real time.</td>
</tr>
<tr>
<td><strong>CDC (Change Data Capture)</strong></td>
<td>Debezium → Kafka</td>
<td>Incremental synchronization with source relational DBs without load on them (WAL log reading).</td>
</tr>
<tr>
<td><strong>Files</strong></td>
<td>SFTP / NFS → Spark</td>
<td>File exchanges with third-party systems.</td>
</tr>
<tr>
<td><strong>Manual</strong></td>
<td>Web forms → API Gateway → Kafka</td>
<td>Manual data entry by operators, document uploads.</td>
</tr>
</tbody></table>
<p>For sources with unstable connectivity, the following mechanisms are in place: a guaranteed-delivery queue (Kafka with acknowledgement), request retries (retry with exponential backoff), and a source-side buffer (lightweight agent based on Filebeat). When the receiver is temporarily unavailable, data accumulates in the queue and is loaded upon recovery.</p>
<h3>L2. Data Storage Layer</h3>
<p>This layer addresses <strong>FR-2</strong>: consolidation of all data types in a single managed storage.</p>
<table>
<thead>
<tr>
<th>Component</th>
<th>Technology</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Object Storage</strong></td>
<td>SeaweedFS (S3-compatible)</td>
<td>Unstructured data: documents, PDF scans, audio, video, ML model weights. Scalable storage for the Bronze layer.</td>
</tr>
<tr>
<td><strong>Data Lakehouse</strong></td>
<td>Apache Iceberg + SeaweedFS</td>
<td>Primary analytical storage. ACID transactions, time-travel (return to any data version), hidden partitioning. Contains Bronze, Silver, and Gold layer tables.</td>
</tr>
<tr>
<td><strong>RDBMS</strong></td>
<td>PostgreSQL</td>
<td>Structured Gold-level data, application and low-code solution metadata.</td>
</tr>
<tr>
<td><strong>Vector Database</strong></td>
<td>Qdrant</td>
<td>Vector embeddings of documents and texts for semantic search (RAG). Metadata filtering.</td>
</tr>
<tr>
<td><strong>Message Queue</strong></td>
<td>Apache Kafka</td>
<td>Event bus covers all inter-component interactions, CDC streams and notifications. Provides loose coupling and replay capability.</td>
</tr>
</tbody></table>
<p>SeaweedFS stores data, Iceberg manages table metadata, Spark and Trino perform computations. This allows storage volume and processing capacity to be scaled independently.</p>
<h3>L3. Data Processing Layer</h3>
<p>This layer addresses <strong>FR-3</strong> and <strong>FR-4</strong>: multi-tier data transformation pipelines with sovereign AI integration.</p>
<table>
<thead>
<tr>
<th>Tier</th>
<th>Actions</th>
<th>Technologies</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Bronze</strong></td>
<td>Data is saved as-is, an exact copy of the source is made. Minimal processing: adding technical metadata (load date, source, batch ID). Schema-on-read approach.</td>
<td>Spark, Flink, Iceberg</td>
</tr>
<tr>
<td><strong>Silver</strong></td>
<td>Data cleansing: deduplication, format standardization (dates, addresses, names), type casting. Quality validation. Text extraction from documents. AI is used for OCR, named entity extraction (NER), document type classification, data normalization. Data quality is ensured via Great Expectations Framework.</td>
<td>Spark, Flink, Airflow, LLM/VLM</td>
</tr>
<tr>
<td><strong>Gold</strong></td>
<td>Aggregation, business metric calculation, building analytical data marts and OLAP cubes. Data enrichment for decision-making. Sovereign AI and proprietary ML solutions are applied for citizen appeal sentiment analysis, risk scoring, anomaly detection, predictive models, and embedding generation for RAG.</td>
<td>Spark, Trino, MLflow</td>
</tr>
</tbody></table>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/339a18cb-8680-4aa7-8bd6-40c1738d2bdf.png" alt="" style="display:block;margin:0 auto" />

<p><em>Diagram 2: Medallion Architecture pipeline</em></p>
<p><strong>Apache Airflow</strong> is a stateless framework that manages scheduling and dependencies of batch pipelines (DAG). <strong>Temporal</strong> is used for long-running processes with state persistence and the ability to resume from the last successful step. Both orchestrators have retry logic and failure notifications. In general, Airflow is better suited for orchestrating Bronze→Silver→Gold transformations, while Temporal is better for reliable event-driven Bronze-layer data consumption and critical downstream notifications.</p>
<p><strong>Resilience under resource constraints (NFR-8)</strong> is achieved through graceful degradation. If GPU nodes are temporarily unavailable, AI pipeline stages enter graceful degradation mode: documents are saved in Bronze and Silver layers, AI enrichment is deferred and executed upon GPU recovery. Analytics on the Gold layer continues to operate on previously prepared data.</p>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/2fb97f8c-7521-4f15-8eb6-6e21c7be3291.png" alt="" style="display:block;margin:0 auto" />

<p><em>Diagram 3: OCR pipeline structure</em></p>
<p><strong>OCR process sequence:</strong></p>
<ol>
<li><p>Document scans for digitization are placed into the Data Lakehouse.</p>
</li>
<li><p>The OCR Producer service periodically retrieves file metadata from S3 and sends it to Kafka.</p>
</li>
<li><p>The OCR Workflow service, acting as a process orchestrator, consumes messages from Kafka and initiates digitization.</p>
</li>
<li><p>In the <strong>Preprocessing</strong> stage, the scan is split into pages and each page is standardized.</p>
</li>
<li><p>In the <strong>Classification</strong> stage, the document type is determined using a predefined classifier.</p>
</li>
<li><p>In the <strong>Extraction</strong> stage, document content is extracted using the most suitable model for that document type.</p>
</li>
<li><p>In the <strong>Validation</strong> stage, the result is verified via Pydantic schemas, checksums, LLM, and Guardrails AI.</p>
</li>
<li><p>In the <strong>Fixing Errors</strong> stage, a human corrects mistakes by annotating data in a labeling client such as Label Studio.</p>
</li>
<li><p>In the <strong>Save Data</strong> stage, the result is saved to the database and vector store.</p>
</li>
<li><p>In the <strong>Transform</strong> stage, the text is transformed according to the project's business logic.</p>
</li>
</ol>
<h3>L4. AI &amp; ML Layer</h3>
<p>This layer addresses <strong>FR-4</strong>: target data processing logic via sovereign AI and proprietary ML models, as well as <strong>FR-6</strong>: the full MLOps lifecycle.</p>
<table>
<thead>
<tr>
<th>Subsystem</th>
<th>Components</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td><strong>LLM Inference</strong></td>
<td>vLLM (production), llama.cpp (edge / fallback), NeMo Guardrails (generation safety)</td>
<td>LLM inference, including national models. Response generation, summarization, classification. Guardrails control output safety.</td>
</tr>
<tr>
<td><strong>RAG Pipeline</strong></td>
<td>LangChain / LangGraph, Embedding Model, Reranker, Semantic Cache (Redis / Valkey), Langfuse</td>
<td>Semantic document search: query → embedding → vector search (Qdrant) → reranking → context assembly → LLM → response. Semantic Cache reduces GPU load by 30–40% for repeated queries.</td>
</tr>
<tr>
<td><strong>ML Training &amp; Serving</strong></td>
<td>MLflow (Tracking, Registry, Serving), Kubeflow (distributed training), Feast (Feature Store)</td>
<td>Experiment versioning, model registry, LoRA fine-tuning orchestration on national data, ML feature management.</td>
</tr>
<tr>
<td><strong>ML Observability</strong></td>
<td>Evidently AI</td>
<td>Data drift and model drift monitoring, automatic quality report generation, retraining triggers.</td>
</tr>
</tbody></table>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/a87b06ca-fdc4-4e37-80b0-824b0c6bc159.png" alt="" style="display:block;margin:0 auto" />

<p><em>Diagram 4: RAG pipeline structure</em></p>
<p><strong>RAG pipeline step-by-step:</strong></p>
<ol>
<li><p>The user submits a natural language query via UI or API.</p>
</li>
<li><p>The AI Gateway authenticates the request, applies rate limiting, and routes it to the RAG service.</p>
</li>
<li><p>A check is performed to see if a semantically similar query exists in the cache. The query is hashed via embedding and a nearest neighbor is searched in the cache.</p>
</li>
<li><p>If a cache hit occurs, the response is returned directly to the client (3a -&gt; 3b); otherwise, control is passed to the RAG pipeline.</p>
</li>
<li><p>The user query is converted to an embedding, using the same model that was used to index the documents.</p>
</li>
<li><p>A vector search is performed to identify the Top-K nearest documents by cosine similarity. Optional metadata filtering is applied.</p>
</li>
<li><p>The Top-K candidates are passed through a cross-encoder model that more accurately evaluates the relevance of each query-document pair. The Top-N best are selected.</p>
</li>
<li><p>A prompt is assembled: system prompt + context from Top-N documents + user query. Prompt templates from the Prompt Registry are applied.</p>
</li>
<li><p>The assembled prompt is sent to the LLM. vLLM performs inference with streaming (token-by-token).</p>
</li>
<li><p>The LLM response passes through safety filters: toxicity check, hallucination detection, policy compliance. If a violation is detected, the response is blocked or modified.</p>
</li>
<li><p>The response is saved to cache with a defined TTL.</p>
</li>
<li><p>The final response is returned to the user.</p>
</li>
</ol>
<blockquote>
<p>It should be noted that NeMo Guardrails and Guardrails AI can perform validation not only after the main LLM request, but at all stages of the request lifecycle.</p>
</blockquote>
<p><strong>Stage 1. User Request:</strong></p>
<ul>
<li><p><em>NeMo – Input Rails:</em> jailbreak attempt detection; toxic and offensive content filtering; off-topic request blocking; personal data detection and masking in the query.</p>
</li>
<li><p><em>Guardrails AI – Input Validation:</em> prompt injection checks; input length and format validation; input schema compliance verification; personal data detection in user query.</p>
</li>
</ul>
<p><strong>Stages 5–7. Vector Search over Knowledge Base:</strong></p>
<ul>
<li><p><em>NeMo – Retrieval Rails:</em> filtering of irrelevant chunks from results; source credibility and admissibility verification; context restriction to permitted documents only; blocking transmission of chunks with prohibited content to LLM.</p>
</li>
<li><p><em>NeMo – Dialog Rails:</em> dialog flow management via Colang scripts; deterministic responses to specific phrases; fallback scenario handling (what to do when LLM doesn't know); topic control throughout the session.</p>
</li>
</ul>
<p><strong>Stage 8. Prompt Construction for LLM:</strong></p>
<ul>
<li><em>NeMo – Execution Rails:</em> control of permitted tool calls; whitelist of allowed external APIs; blocking of unauthorized agent actions; logging of all tool calls for audit.</li>
</ul>
<p><strong>Stages 9–10. Response Generation:</strong></p>
<ul>
<li><p><em>NeMo – Output Rails:</em> hallucination check; personal data removal from final response; toxic content filtering; off-topic response blocking.</p>
</li>
<li><p><em>Guardrails AI – Output Validation:</em> parsing LLM response into structured format; response schema validation; toxicity, relevance, and factual accuracy checks; automatic query retry upon validation failure.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/5107da97-c303-4f09-9127-13d4ab49b491.png" alt="" style="display:block;margin:0 auto" />

<p><em>Diagram 5: Model Training pipeline</em></p>
<p><strong>Model Training pipeline step-by-step:</strong></p>
<ol>
<li><p><strong>Create experiment.</strong> Name, hyperparameters, and dataset reference are defined.</p>
</li>
<li><p><strong>Launch training pipeline</strong> as a DAG in Kubernetes.</p>
</li>
<li><p><strong>Request training features.</strong> Feast ensures point-in-time correct data sampling, preventing data leakage.</p>
</li>
<li><p><strong>Read historical features</strong> from the offline store (Iceberg) and fresh features from the online store (PostgreSQL or Redis).</p>
</li>
<li><p><strong>Prepare data</strong> by forming train/validation/test splits, augmentation, normalization, and class balancing.</p>
</li>
<li><p><strong>Train the model.</strong> For LLMs – LoRA fine-tuning of the base model. For ML – training via XGBoost / CatBoost / scikit-learn.</p>
</li>
<li><p><strong>Log metrics</strong> at each epoch (loss, accuracy, F1), hyperparameters, and artifacts (checkpoints, charts).</p>
</li>
<li><p><strong>Evaluate the model</strong> on the test set. Calculate target metrics. For LLMs – MMLU benchmarks and user dataset evaluations.</p>
</li>
<li><p>If metrics exceed the threshold, the model is <strong>registered in the registry</strong> (version, metadata, metrics) with Staging status.</p>
</li>
<li><p><strong>Promote the model</strong> from Staging to Production after review and/or A/B testing.</p>
</li>
<li><p><strong>Deploy the new version</strong>: LLM to vLLM (LoRA adapter update), ML to MLflow Serving or Triton. Rolling update with zero downtime.</p>
</li>
<li><p><strong>Continuous monitoring</strong> by comparing the distribution of input data and predictions against a reference dataset.</p>
</li>
<li><p>Upon detection of <strong>data drift</strong> or <strong>model drift</strong>, an automatic retraining process is triggered. <em>Data drift</em> refers to changes in the statistical characteristics of input data over time, which can negatively impact model performance. <em>Model drift</em> refers to changes in model behavior or quality over time.</p>
</li>
</ol>
<h3>L5. Presentation Layer</h3>
<p>This layer addresses <strong>FR-5</strong>: analytics, OLAP, and leadership dashboards.</p>
<table>
<thead>
<tr>
<th>Component</th>
<th>Technology</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Web Client with AI Assistant</strong></td>
<td>React / Angular, Chat UI</td>
<td>Interface for dialogue with the corporate LLM: data queries, SQL generation in natural language, report summarization, etc.</td>
</tr>
<tr>
<td><strong>AI / API Gateway</strong></td>
<td>Kong AI Gateway</td>
<td>Single entry point for external consumers: authentication, authorization, rate limiting, routing. OpenAPI 3.0. Centralized limit management and token quota distribution, protection against cascading failures.</td>
</tr>
<tr>
<td><strong>BI &amp; Dashboards</strong></td>
<td>Apache Superset</td>
<td>Interactive dashboards for leadership: KPIs, trends, drill-down. Connections to Trino (Gold layer) and PostgreSQL. Auto-refresh scheduling. Automatic PDF/Excel report generation and distribution on schedule.</td>
</tr>
<tr>
<td><strong>OLAP</strong></td>
<td>Trino</td>
<td>Federated SQL queries to the Gold layer (Iceberg), PostgreSQL, S3. Multidimensional analysis, pivot tables.</td>
</tr>
</tbody></table>
<p>The AI assistant allows leaders to formulate analytical queries in natural language: <em>"Show the trend of citizen appeals by region for the last quarter."</em> The LLM translates the query into SQL, Trino executes it on the Gold layer, and Superset visualizes the result.</p>
<h3>L6. Security, Governance &amp; Observability</h3>
<p>This cross-cutting layer ensures compliance with non-functional requirements <strong>NFR-1, NFR-7, NFR-9</strong>.</p>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Components</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Identity &amp; Access</strong></td>
<td>Keycloak (IAM), RBAC/ABAC</td>
<td>Unified authentication (SSO), row- and column-level authorization, LDAP integration.</td>
</tr>
<tr>
<td><strong>Secrets &amp; Encryption</strong></td>
<td>HashiCorp Vault</td>
<td>Key, certificate, and secret management. Key rotation. At-rest encryption.</td>
</tr>
<tr>
<td><strong>Network Security</strong></td>
<td>Calico / Cilium</td>
<td>Kubernetes network policies: micro-segmentation, zero-trust between pods.</td>
</tr>
<tr>
<td><strong>Data Catalog &amp; Lineage</strong></td>
<td>DataHub</td>
<td>Cataloging of all data, lineage tracking from source through Bronze → Silver → Gold to dashboard. Metadata search.</td>
</tr>
<tr>
<td><strong>Data Quality</strong></td>
<td>Great Expectations</td>
<td>Automated validation at the Bronze/Silver boundary: completeness, format, ranges, business rules. Alerting on violations.</td>
</tr>
<tr>
<td><strong>Observability</strong></td>
<td>ELK / Loki (logs), Prometheus + Grafana (metrics), OpenTelemetry + Jaeger (traces)</td>
<td>Logs, metrics, traces. Unified console. SLA dashboard with availability, latency, and error metrics.</td>
</tr>
<tr>
<td><strong>CI/CD &amp; GitOps</strong></td>
<td>ArgoCD (GitOps), Harbor (Container Registry), Ansible / Terraform (IaC)</td>
<td>Declarative configuration management. Local image registry for air-gapped environment. Reproducible deployments.</td>
</tr>
</tbody></table>
<h2>Key Architectural Decisions</h2>
<p><strong>Event-driven architecture on Kafka.</strong> All inter-component interactions – including data ingestion, index updates, and notifications – are implemented through a message queue. This ensures loose coupling and a complete audit trail of all operations.</p>
<p><strong>Storage-Compute Separation.</strong> The Data Lakehouse based on Apache Iceberg and S3-compatible storage allows storage and processing to be scaled independently. This is critical as the data lake grows to millions of documents per month, where analytical compute capacity must not compete with inference capacity.</p>
<p><strong>Medallion Architecture.</strong> The quality tier separation ensures reproducibility (Bronze – source copy), manageability (Silver – cleansed data), and readiness for use (Gold – analytics). AI enrichment is embedded at the transitions between tiers.</p>
<p><strong>Graceful Degradation.</strong> When GPUs are unavailable, AI pipeline stages are deferred, but core data processing and analytics continue to operate. The system automatically resumes AI enrichment upon resource recovery.</p>
<p><strong>Caching.</strong> Session caching, intermediate LLM result caching, rate limiting. Caching of semantically similar LLM queries reduces GPU load by 30–40% and decreases latency for common questions.</p>
<p><strong>Air-gapped CI/CD.</strong> ArgoCD + Harbor + local Nexus provide a complete deployment cycle without internet access. Updates are delivered via Data Diode and undergo security verification.</p>
<p><strong>Data Lineage (DataHub).</strong> End-to-end tracking of data origin from source through all Medallion Architecture layers to a specific dashboard. Required for audit and regulatory compliance.</p>
<h2>Architecture Decision Records</h2>
<h3>ADR-001: Apache Kafka as the Unified Event Bus</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />The system integrates dozens of heterogeneous data sources. Components must be loosely coupled. Environment: air-gapped, on-premise.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Apache Kafka</strong></td>
<td>Event replay, high throughput, CDC integration via Debezium, mature ecosystem</td>
<td>Operational complexity</td>
</tr>
<tr>
<td>RabbitMQ</td>
<td>Simplicity, low latency</td>
<td>No replay, weak CDC support</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Kafka</p>
<p><strong>Rationale</strong><br />Event replay capability is critical for the Bronze layer: if AI enrichment fails, data is not lost and the pipeline restarts from the correct point. Debezium natively integrates only with Kafka.</p>
<p><strong>Consequences</strong></p>
<p>➕ Loose coupling of all components, full audit trail of operations</p>
<p>➕ CDC without load on source databases</p>
<p>➖ Requires a dedicated cluster and operational expertise</p>
<h3>ADR-002: Apache Iceberg as the Data Lakehouse Format</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />A storage format is needed for Medallion Architecture with ACID support, time-travel, and independent scaling of storage and compute. On-premise, S3-compatible storage.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Apache Iceberg</strong></td>
<td>ACID, time-travel, hidden partitioning, support for Spark, Trino, and Flink</td>
<td>Younger format, more complex than Delta Lake in some scenarios</td>
</tr>
<tr>
<td>Delta Lake</td>
<td>Mature, excellent Spark integration</td>
<td>Tied to Databricks ecosystem, weaker with Trino</td>
</tr>
<tr>
<td>Apache Hudi</td>
<td>Good for CDC upserts</td>
<td>More complex to operate, smaller community</td>
</tr>
<tr>
<td>Parquet + Hive</td>
<td>Simplicity</td>
<td>No ACID, no time-travel</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Apache Iceberg</p>
<p><strong>Rationale</strong><br />Iceberg is an engine-agnostic standard: it is simultaneously read by Spark (processing), Trino (analytics), and Flink (streaming) without data copying. Delta Lake creates a dependency on Databricks, which is unacceptable for a sovereign environment.</p>
<p><strong>Consequences</strong></p>
<p>➕ Storage-Compute Separation: storage and compute scale independently</p>
<p>➕ Time-travel for audit and reproducibility</p>
<p>➖ Requires a metadata catalog (Hive Metastore or Nessie)</p>
<h3>ADR-003: SeaweedFS as Object Storage</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />An S3-compatible, open-source object storage is needed for on-premise deployment. It stores documents, PDF scans, ML model weights, and Bronze-layer data. Volume: tens of millions of files.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>SeaweedFS</strong></td>
<td>Efficient small file storage, built-in Filer, low metadata overhead, S3-compatible</td>
<td>Smaller community, less documentation</td>
</tr>
<tr>
<td>MinIO</td>
<td>De-facto S3 on-premise standard, large community, excellent documentation</td>
<td>High overhead with millions of small files; developer discontinued Community Edition development</td>
</tr>
<tr>
<td>Ceph</td>
<td>Versatility (block + object + file)</td>
<td>High operational complexity</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> SeaweedFS</p>
<p><strong>Rationale</strong><br />Fully open-source. SeaweedFS is architecturally optimized for storing large numbers of small files.</p>
<p><strong>Consequences</strong></p>
<p>➕ Efficiency when storing millions of documents</p>
<p>➖ Smaller community and ecosystem compared to MinIO</p>
<h3>ADR-004: vLLM + llama.cpp as Two-Tier LLM Inference</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />LLM inference is needed in an air-gapped environment. GPU resources are limited and expanded in increments. Graceful degradation is required upon GPU node loss.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>vLLM (primary)</strong></td>
<td>PagedAttention, continuous batching, high throughput, streaming</td>
<td>Requires GPU, high memory consumption</td>
</tr>
<tr>
<td><strong>llama.cpp (fallback)</strong></td>
<td>CPU inference, minimal requirements, quantization</td>
<td>Low speed on large models</td>
</tr>
<tr>
<td>Triton Inference Server</td>
<td>Versatility, multi-model</td>
<td>Configuration complexity, overkill for LLM</td>
</tr>
<tr>
<td>Ollama</td>
<td>Simplicity</td>
<td>Not production-ready for high load</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> vLLM as primary + llama.cpp as edge/fallback</p>
<p><strong>Rationale</strong><br />The two-tier approach addresses NFR-8 (resilience under resource constraints): when GPU is unavailable, the system does not fail but degrades to CPU inference at reduced speed. vLLM provides production throughput via PagedAttention and continuous batching.</p>
<p><strong>Consequences</strong></p>
<p>➕ Graceful degradation: if GPU is unavailable, llama.cpp continues operation</p>
<p>➕ LoRA adapters are updated in vLLM without restart</p>
<p>➖ Two different runtimes require maintaining two configurations</p>
<h3>ADR-005: Langfuse for RAG Observability</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />A tool is needed for tracing and quality evaluation of the RAG pipeline: call chain logging, relevance assessment, prompt A/B testing. Environment: air-gapped.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Langfuse</strong></td>
<td>Open-source, self-hosted, full tracing functionality</td>
<td>Fewer integrations than LangSmith</td>
</tr>
<tr>
<td>LangSmith</td>
<td>Deep LangChain integration, rich UI</td>
<td>Cloud service – incompatible with air-gapped</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Langfuse</p>
<p><strong>Rationale</strong><br />LangSmith is a cloud service, fundamentally incompatible with an air-gapped environment and data sovereignty requirements. Langfuse is deployed on-premise, has open-source code, and covers all required scenarios: tracing, evaluation, and Prompt Registry.</p>
<p><strong>Consequences</strong></p>
<p>➕ Full control over tracing data</p>
<p>➕ Prompt Registry for prompt version management</p>
<p>➖ Requires self-deployment and maintenance</p>
<h3>ADR-006: Airflow and Temporal for Orchestration</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />The system contains two classes of processes: regular batch data transformations (Bronze→Silver→Gold) and long-running event-driven processes (OCR, downstream notifications). A single orchestrator handles both scenarios poorly.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Airflow only</strong></td>
<td>Single tool, mature, large community</td>
<td>Stateless: no resume-from-failure for long-running processes</td>
</tr>
<tr>
<td><strong>Temporal only</strong></td>
<td>Stateful, durable execution, retry from any point</td>
<td>Overkill for simple DAG scheduling</td>
</tr>
<tr>
<td><strong>Airflow + Temporal</strong></td>
<td>Each tool optimized for its task</td>
<td>Two tools in the stack</td>
</tr>
<tr>
<td>Prefect</td>
<td>Modern, simpler than Airflow</td>
<td>Smaller community, weaker for stateful workflows</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Airflow for batch pipelines + Temporal for event-driven processes</p>
<p><strong>Rationale</strong><br />The OCR pipeline can run for hours and must resume from the point of failure without losing progress – this is Temporal's domain. Bronze→Silver→Gold transformations are classic scheduled DAGs – Airflow's domain. Separation of concerns eliminates compromises.</p>
<p><strong>Consequences</strong></p>
<p>➕ Each orchestrator is optimal for its class of tasks</p>
<p>➕ Reliability for long-running processes (OCR, notifications)</p>
<p>➖ The team must be proficient in both tools</p>
<h3>ADR-007: Qdrant as the Vector Database</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />The RAG pipeline requires storage and search of document vector embeddings. Volume: tens of millions of chunks. On-premise, air-gapped. Metadata filtering is required.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Qdrant</strong></td>
<td>Rust implementation (performance), rich payload filtering, on-premise, active development</td>
<td>Smaller ecosystem than Weaviate</td>
</tr>
<tr>
<td>pgvector</td>
<td>PostgreSQL already in stack, simplicity</td>
<td>Degrades at large volumes (&gt;10M vectors)</td>
</tr>
<tr>
<td>Weaviate</td>
<td>Rich functionality, GraphQL API</td>
<td>Go implementation, higher memory consumption</td>
</tr>
<tr>
<td>Milvus</td>
<td>High performance</td>
<td>Deployment complexity, etcd dependency</td>
</tr>
<tr>
<td>ElasticSearch (kNN)</td>
<td>Already in stack</td>
<td>Not optimized for vector search</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Qdrant</p>
<p><strong>Rationale</strong><br />At 10M+ documents per month, pgvector loses performance. Qdrant is written in Rust, demonstrates the best latency/throughput ratio in benchmarks, supports metadata filtering (critical for document-level RBAC), and deploys as a simple single binary.</p>
<p><strong>Consequences</strong></p>
<p>➕ High performance at large volumes</p>
<p>➕ Metadata filtering for access control</p>
<p>➖ Additional component in the stack (PostgreSQL cannot be reused)</p>
<h3>ADR-008: Medallion Architecture</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />Data arrives from dozens of heterogeneous sources of varying quality. A storage strategy is needed that ensures reproducibility, quality manageability, and analytics readiness. AI enrichment may be unavailable (no GPU).</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Medallion (Bronze/Silver/Gold)</strong></td>
<td>Reproducibility, quality isolation, AI graceful degradation</td>
<td>Data stored in multiple copies</td>
</tr>
<tr>
<td>Data Vault</td>
<td>Auditability, flexibility</td>
<td>High modeling complexity</td>
</tr>
<tr>
<td>Kimball DWH</td>
<td>Mature approach, familiar to analysts</td>
<td>Rigid schema, poor fit for unstructured data</td>
</tr>
<tr>
<td>Single storage</td>
<td>Simplicity</td>
<td>No quality isolation, difficult to roll back</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> Medallion Architecture</p>
<p><strong>Rationale</strong><br />Bronze as an immutable source copy is insurance against transformation and AI enrichment errors. When GPU is unavailable, documents accumulate in Bronze/Silver, and AI enrichment is executed upon resource recovery. The Gold layer is always available for analytics on previously prepared data.</p>
<p><strong>Consequences</strong></p>
<p>➕ Reproducibility: any stage can be restarted</p>
<p>➕ Graceful degradation: analytics does not depend on AI availability</p>
<p>➖ Storing data in three copies increases disk space requirements</p>
<h3>ADR-009: NeMo Guardrails + Guardrails AI as Two-Tier LLM Protection</h3>
<p><strong>Status:</strong> Accepted</p>
<p><strong>Context</strong><br />The government system handles citizens' personal data. The LLM may generate toxic content, hallucinations, or personal data leaks. Protection is needed at all stages of the request lifecycle.</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody><tr>
<td><strong>NeMo Guardrails</strong></td>
<td>Colang scripts for dialog flow, input/output/retrieval/execution rails, from NVIDIA</td>
<td>Ties to NVIDIA ecosystem</td>
</tr>
<tr>
<td><strong>Guardrails AI</strong></td>
<td>Structured output validation, Pydantic schemas, retry on failure</td>
<td>Does not cover dialog flow</td>
</tr>
<tr>
<td>Prompt engineering only</td>
<td>Simplicity</td>
<td>Unreliable, easily bypassed</td>
</tr>
<tr>
<td>Custom filters</td>
<td>Full control</td>
<td>High development and maintenance cost</td>
</tr>
</tbody></table>
<p><strong>Decision:</strong> NeMo Guardrails (dialog/flow protection) + Guardrails AI (structural validation)</p>
<p><strong>Rationale</strong><br />The tools cover different aspects: NeMo manages dialog logic and blocks undesirable scenarios at the flow level; Guardrails AI validates the structure and content of output against schemas. Together they form a layered defense critical for a government system handling personal data.</p>
<p><strong>Consequences</strong></p>
<p>➕ Protection at all stages: input → retrieval → prompt → output</p>
<p>➕ Full auditability of all blocking decisions</p>
<p>➖ Latency overhead at each stage (~100–200ms total)</p>
<p>➖ Requires maintaining Colang scripts when business logic changes</p>
]]></content:encoded></item><item><title><![CDATA[Спиральная динамика архитектур и закон Конвея]]></title><description><![CDATA[Закон Конвея
Закон Конвея: "Организации проектируют системы, которые копируют структуру коммуникаций в этой организации".
Мартин Фаулер отмечает, что невнимание к закону Конвея может искажать архитект]]></description><link>https://laputski.ai/spiral-dynamics-and-conway-law</link><guid isPermaLink="true">https://laputski.ai/spiral-dynamics-and-conway-law</guid><category><![CDATA[Spiral Dynamics]]></category><category><![CDATA[conway law]]></category><category><![CDATA[Architecture Design]]></category><category><![CDATA[System Design]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Sun, 04 Jan 2026 19:57:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/689196669dd9824954f09ec8/d3e81e80-7a81-41ee-abc7-4a53da000a60.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Закон Конвея</h2>
<p><a href="https://www.melconway.com/Home/Committees_Paper.html">Закон Конвея</a>: <em>"Организации проектируют системы, которые копируют структуру коммуникаций в этой организации"</em>.</p>
<p>Мартин Фаулер <a href="https://martinfowler.com/bliki/ConwaysLaw.html">отмечает</a>, что невнимание к закону Конвея может искажать архитектуру системы. Если архитектура разработана вразрез со структурой организации-разработчика, то в структуре ПО возникают противоречия. Взаимодействие модулей, которое изначально задумывалось как простое, становится сложным, поcкольку команды, ответственные за него, плохо взаимодействуют друг с другом. Полезные альтернативные варианты проектирования даже не рассматриваются, потому что необходимые группы разработчиков не общаются друг с другом.</p>
<p>Существует и обратный маневр Конвея, который гласит, что <em>необходимо изменить модели общения разработчиков, чтобы способствовать созданию желаемой архитектуры программного обеспечения</em>.</p>
<p>Выходит, нужно проектировать не только архитектуры, но и структуру коммуникаций. Причем можно сначала прикинуть архитектуру согласно функциональным и нефункциональным требованиям, а затем выстроить подходящую проекту структуру коммуникаций. Очевидно, что организационная структура компаний не меняется по щелчку пальцев, есть корпоративная культура, "то, как тут всё устроено". Желательно вооружиться неким системным видением оргструктуры бизнеса, чтобы уметь эффективно выполнять обратный маневр Конвея.</p>
<h2>Спиральная динамика для бизнеса</h2>
<p>Одной из самых проработанных систем, упорядочивших структуру и динамику бизнес-организаций, является адаптация спиральной динамики к современным компаниям (см. книгу <a href="https://oz.by/books/more101235833.html">Спиральная динамика для бизнеса</a>).</p>
<p>Необходимо отметить, что это не строгая научная теория. Скорее, набор психологических паттернов поведения, типичных для различных корпоративных ситуаций. Но и сам по себе закон Конвея соединяет два сущностно различных мира: мир человеческих коммуникаций и мир технологической архитектурной строгости. Это как пытаться соединить застольную беседу и теорему Ферма. И тем не менее, связь существует, ведь именно люди делают проекты, и именно из-за их несогласованности зачастую рушатся системы. Наверняка проблема исчезнет, когда AI начнет создавать сложные распределенные системы от первичной диаграммы до автотестов, но пока в разработке участвуют люди, они привносят неустранимый фактор межличностного взаимодействия.</p>
<p>Базовая гипотеза такова, что у <strong>организаций лучше получаются системы, которые соответствуют их доминирующему уровню в спиральной динамике для бизнеса</strong> (далее СДБ).</p>
<p>Организационно-коммуникационная структура диктует каким должен быть проект, а выбранная в самом начале технологическая архитектура может этому образу совершенно не соответствовать. Если проект требует технологической архитектуры более высокого СДБ-уровня, нежели текущий, то лучше сначала поднять уровень бизнеса, а затем реализовывать проект.</p>
<p>Если бизнес игнорирует закон Конвея, то возникает драма несовпадения организационной и технологической архитектур. Если реальный СДБ-уровень ниже, чем уровень технологической архитектуры проекта, то бизнес будет неосознанно разрушать её, низводя до своего уровня. Если выше, то будет поднимать через серии рефакторингов.</p>
<h2>Уровни СДБ</h2>
<p>Подробнее об уровнях СДБ можно прочитать в <a href="https://oz.by/books/more101235833.html">книге</a>. Здесь же приведем только необходимый минимум.</p>
<img src="https://avatars.dzeninfra.ru/get-zen_doc/8269145/pub_6479caf9d0c3ba3396af7f54_6479ce9b23dcde7ca7af094f/scale_1200" alt="Игра в Игру" />

<p>Большинство организаций находятся на красном, синем и оранжевом уровнях.</p>
<h2>Принципы СДБ</h2>
<p>Взяты <a href="https://xn--90aifdrfbekc3aabb3m.xn--p1ai/articles/10-osnovnykh-printsipov-spiralnoy-dinamiki/">отсюда</a>.</p>
<ol>
<li><p><strong>Доминанта</strong>. В организации, как правило, нет единой цельной культуры, но всегда есть доминирующая культура, которая задает принципы управления организацией.</p>
</li>
<li><p><strong>Конкурентоспособность</strong>. Нет плохих или хороших типов культур. Есть конкурентоспособные и неконкурентоспособные культуры.</p>
</li>
<li><p><strong>Последовательность</strong>. Развитие корпоративной культуры происходит последовательно, нельзя "перепрыгнуть" через уровень.</p>
</li>
<li><p><strong>Фундамент</strong>. Новый уровень корпоративной культуры внедряется за счет хорошо работающих инструментов предыдущего уровня - эти инструменты являются фундаментом для следующего уровня.</p>
</li>
<li><p><strong>Кризис</strong>. В ходе развития организации меняется тип корпоративной культуры, это происходит через кризисы управляемости.</p>
</li>
<li><p><strong>Препятствие</strong>. Те принципы, за счет которых корпоративная культура развивалась и становилась сильнее, через какое-то время становятся главным препятствием, разрушающим организацию.</p>
</li>
<li><p><strong>Фон</strong>. При переходе к новому типу корпоративной культуры старый тип никуда не девается, а остается в организации как вполне обыкновенное и всем привычное явление (фон), являющее основой для остальных типов культур.</p>
</li>
<li><p><strong>Маятник</strong>. Развитие происходит от индивидуалистичной культуры к коллективной, а потом обратно.</p>
</li>
<li><p><strong>Мимикрия</strong>. Организация может деградировать (мимикрировать) на ниже находящиеся уровни культуры вследствие непрохождения кризисов. Причем может "проваливаться" сразу на два уровня вниз. Например, это может произойти из-за того, что старые проверенные инструменты предыдущих уровней развития оказываются незаслуженно забытыми.</p>
</li>
<li><p><strong>Лидерство</strong>. Для развития организации лидер должен находиться на 0,5-1 уровень выше, чем культура организации. Развитие корпоративной культуры организации происходит только за счет улучшения менеджмента лидеров организации.</p>
</li>
</ol>
<h2>Наблюдения о связи СДБ и архитектур</h2>
<p><strong>Стеклянный потолок</strong>. Организационно незрелая компания не способна перейти на более высокий технологический уровень, поскольку не видит преимуществ. Техлиды могут по собственной инициативе переходить на более высокие СДБ-уровни и внедрять соответствующие архитектуры только при молчаливом согласии начальства, которе не до конца понимает смысл реформ, но по какой-то причине лояльно к ним.</p>
<p><strong>Конфликт двух миров</strong>. Флуктуации корпоративных культур и переходы между СДБ-уровнями индивидуальны для каждой компании. Нет общей тенденции к тому, чтобы каждый бизнес неизбежно выходил на синий, затем на оранжевый, затем на зеленый уровень и выше. В то время как IT-архитектуры во всем мире имеют перманентную тенденцию к усложнению, что создает потребность в соответствующей корпоративной культуре. Получается, архитектура тянет за собой культуру, если претендует на то, чтобы быть полноценно реализованной.</p>
<p><strong>Матрешка</strong>. СДБ-уровни вкладываются друг в друга как матрешка, то есть следующий уровень не отменяет, а вбирает в себя всё лучшее с предыдущих. Подобных эффект справедлив и для эволюции архитектур. Лучшие практики и фреймворки остаются как база, но к ним добавляются те, что соответствуют вызовами более высоких уровней СДБ.</p>
<h2>Естественный маппинг СДБ на архитектуры</h2>
<p>Ниже, попытка указать какие архитектурные практики наиболее естественны для каждого СДБ-уровня. Это не значит, что маппинг жёсткий, <strong>на любом уровне можно внедрить любую архитектуру, но не факт, что она приживется</strong>.</p>
<h3>Бежевый уровень</h3>
<p><em>Структура коммуникаций</em> отсутствует, равно как и разделение ответственности.</p>
<p>Программа запускается и нормально.</p>
<p><em>Риски</em>: хардкод, спагетти-код, анти-паттерны проектирования.</p>
<p><em>Пример</em>: Proof-of-Concept для проверки имеет ли идея право на жизнь.</p>
<h3>Фиолетовый уровень</h3>
<p><em>Структура коммуникаций</em> хаотична, "кажется Вася делал эту фичу, но это не точно".</p>
<p>Каждый вновь пришедший на проект разработчик делает "как видит", игнорируя мнение других, нет ни общего центра координации усилий ни процессов.</p>
<p>Шаблоны проектирования (структурные, порождающие, поведенческие) не используются или используются ограничено. Документация отсутствует как класс, она живет только в головах посвященных.</p>
<p>Могут ли на фиолетовом уровне быть внедрены микросервисы? Безусловно, может быть внедрено что угодно, но нет никакой гарантии, что кто-нибудь будет следовать чужим подходам.</p>
<p><em>Риски</em>: высокая связность кода (high coupling), каждое серьёзное изменение требует структурного и функционального рефакторинга.</p>
<p><em>Пример</em>: крупная legacy-система, которая не планирует расширение.</p>
<h3>Красный уровень</h3>
<p><em>Структура коммуникаций</em> в форме звезды или осьминога (в центре начальник, по краям все остальные).</p>
<p>Доминирует централизованное управление системой, здесь всё полностью зависит от характера и квалификации первого лица. Архитектурно это не обязательно монолит, но точно появится централизованный блок управления, который соответствует видению мира боссом (по его воле или даже вопреки ей). Никто не заботится о качестве кода, модульности и отказоустйчивости, если только босс специально не обратит на это внимание.</p>
<p><strong>Пример</strong>: <em>Имел возможность наблюдать такую ситуацию в одной из компаний с ярко выраженным красным контуром управления, которая внедрила микросервисы и обобщенные библиотеки для использования на многих проектах. Как оказалось, каждая из них содержала не только обобщенный код, но и хардкод, специфичный для отдельных систем. Просто некому было закрыть технический долг и выполнить декомпозицию, поскольку все решения принимал один человек, который "знает лучше". Модель управления была такой, что руководитель лично оценивал загрузку сотрудников и тасовал их между проектами в обход тимлидов. Если бы у проектов были по-настоящему самостоятельные лиды, то они не допустили бы загрязнения своего кода логикой чужих проектов.</em></p>
<p>Документация, как и на фиолетовом уровне, по-прежнему только в головах, но теперь преимущественно в одной единственной.</p>
<p>Риски удобно классифицировать согласно <strong>PAEI</strong> модели менеджмента Адизеса:</p>
<ul>
<li><p><strong>P</strong> доминанта - сиюминутные решения, сопротивление инновациям, как следствие рост техдолга, появление единой точки отказа</p>
</li>
<li><p><strong>A</strong> доминанта - забюрокраченность, отсутствие Agile/Lean, сопротивление инновациям, как следствие рост техдолга и низкая адаптивность системы</p>
</li>
<li><p><strong>E</strong> доминанта - рисковые необоснованные решения, система развивается слишком быстро и в непредсказуемых направлениях, архитектура не успевает адаптироваться</p>
</li>
<li><p><strong>I</strong> доминанта - функциональные и нефункциональные требования подчинены удобству работы команд (это тот случай, когда можно завести микросервисы под команды, чтобы они не поругались, но при этом могут игнорироваться DDD, нагрузка, потоки данных)</p>
</li>
</ul>
<p><em>Пример</em>: стартап, построенный вокруг компетенций CTO и CEO в одном лице.</p>
<h3>Синий уровень</h3>
<p><em>Структура коммуникаций</em> иерархическая, внедрены процессы и роли, на всё есть спецификация и подробная документация.</p>
<p>На этом уровне естественна работа по стандартам: Twelve-Factor App, шаблоны проектирования, чёткие согласованные API и протоколы взаимодействия, Service Oriented Architecture, Reactive Manifesto, шины событий, версионирование, CI/CD пайплайны, SDLC, zero-trust.</p>
<p>При доминанте синего уровня организация довольствуется текущем уровнем автоматизации. Отсутствуют или ограничены механизмы внедрения инноваций, способные преодолеть бюрократию. Маловероятны масштабные рефакторинги.</p>
<p>Agile и Scrum не настроены по-настоящему итеративно, надежность системы важнее и достигается через бюрократический запрет слабопредсказуемых изменений. Рано или поздно всё скатывается в waterfall разработку с редкими и крупными релизами.</p>
<p><em>Риски</em>: забюрокраченность, отсутствие инноваций, тяжёлая waterfall разработка.</p>
<p><em>Пример</em>: мобильный клиент для крупного банка-монолиста.</p>
<h3>Оранжевый уровень</h3>
<p><em>Структура коммуникаций</em> матричная, с горизонтальными (кросс-функциональные команды) и вертикальными (отделы) связями.</p>
<p>Это высоко конкурентная среда, которой свойственны меритократия и соперничество автономных команд (you build it, you run it).</p>
<p>Именно на этом уровне микросервисы становятся естественной архитектурной базой, повторяющей топологию команд. Вводятся чёткие API контракты как язык взаимодействия между командами.</p>
<p>Появляется реальная потребность в модульной low-coupling архитектуре, Agile и Scrum истинно итеративны, регулярно закрывается техдолг, культура роста проявляется в том, что инновации внедряются регулярно и через бэклог, появляются IaaS/PaaS/SaaS/DaaS (Data-as-a-Service).</p>
<p>Именно на этом уровне внедрение SRE практик становится необходимостью, появляются четкие метрики производительности, трассировка, наблюдаемость. нужно уметь эффективно измерять не только успех, но и конкуренцию. Система оптимизируется под метрики бизнеса и масштабирование. На более низких уровнях SLO/SLA могут не быть четко артикулированы, там систему нужно "просто сдать”, “просто не уронить”, “просто поддерживать".</p>
<p><em>Риски</em>: возможна конкуренция подсистем, нет высокоуровневой смысловой оркестрации процессов и общего направления эволюции системы.</p>
<p><em>Пример</em>: корпорация уровня Amazon или Netflix со множеством подсистем и внутренне конкурирующих продуктов.</p>
<h3>Зеленый уровень</h3>
<p><em>Структура коммуникаций</em> одноранговая сетецентричная.</p>
<p>Цель такой системы - поддерживать миссию компании. Базовая клиентоориентированность диктует потребность в по-настоящему гибкой и адаптируемой архитектуре.</p>
<p>Здесь естественны Event-Driven Architecture, Data Mesh (Data as a Product), Service Mesh (Data Plane + Control Plane), Event Sourcing, платформы управления API (типа WSO2), FinOps.</p>
<p>Система строится скорее вокруг потоков данных, нежели функций. Создаются платформенные команды (Platform Engineering), обслуживающие продуктовые.</p>
<p>"Миссия" самой системы может заключаться в высокоуровневой оркестрации процессов посредством раздачи инструкций о реконфигурации системы (policy-as-code). Программное ядро оформляется в IDP (Internal Developer Platform) - параметризованный расширяемый фреймворк с достаточным количеством степеней свободы, чтобы у миссии компании было пространство для манёвра.</p>
<p><em>Риски</em>: если компания слишком часто меняет направление, то это приводит к архитектурным пивотам, что парализует стратегическое планирование и в конечном итоге хаотизирует архитектуру.</p>
<p><em>Пример</em>: Spotify с моделью Squads.</p>
<h3>Жёлтый и бирюзовый уровни</h3>
<p><em>Структура коммуникаций</em> "нейрональная", а именно:</p>
<ul>
<li><p>децентрализация управления,</p>
</li>
<li><p>умные динамические связи между акторами, делающие возможным единый сигнал, проходящий по коммуникационной сети,</p>
</li>
<li><p>динамические Ad-hoc команды, создаваемые специально под задачу,</p>
</li>
<li><p>высокий EQ и культура взаимодействия инженеров,</p>
</li>
<li><p>компетентность ценится выше должности.</p>
</li>
</ul>
<p>Здесь естественны эволюционная архитектура (Evolutionary Architecture), базовая децентрализация процессов и точек управления (например через блокчейн, Edge Computing), Serverless подход. Система должна быть фундаментально устойчива к сбоям (Chaos Engineering) и изменениям требований. Появляется потребность в self-healing.</p>
<p>Это пожалуй первый уровень, где действительно к месту роевой интеллект AI агентов как точек принятия локальных решений с возможностью эволюционного трансформирования системы. Всё, что было до этого, может обойтись и без AI агентов. На красном уровне есть только один агент - начальник. На синем разлилось царство согласованных инструкций, там не потерпят AI-галлюцинаций в стратегических вопросах. На оранжевом уровне могут применить агентов в погоне за улучшенными метриками, но это же и рискованно, когда требуется гарантированный результат. На зеленом уровне миссия диктует решения. Желтый же уровень в силу своей высокой базовой адаптивности не боится ошибок и сбоев в подсистемах. Возможно, настоящий self-healing подход будет реализован именно через агентов.</p>
<p><em>Риски</em>: сложно достигнуть и ещё сложнее удержаться.</p>
<p><em>Примеры</em>: желтая - Google и Googleyness, бирюзовая - Valve (по крайней мере согласно их Handbook for new employees).</p>
<h2>Выводы</h2>
<p>Мы строим архитектуру согласно требованиям заказчика, но зачастую далее оказывается, что наша организация не готова к такого рода проекту в силу своего внутреннего устройства.</p>
<p>Во-первых, стейкхолдеры должны об этом знать.</p>
<p>Во-вторых, используя спиральную динамику бизнеса, мы можем продуманно выполнить обратный маневр Конвея.</p>
]]></content:encoded></item><item><title><![CDATA[Если бы я начинал сейчас]]></title><description><![CDATA[Все в панике. AI радикально изменил рынок труда для джунов, сократив количество вакансий на 50%. У меня нет рецепта как найти работу кроме как дольше учиться и делать свои пет-проекты. Это базовая стратегия для повышения уровня абсолютно на любой сту...]]></description><link>https://laputski.ai/junior-2026</link><guid isPermaLink="true">https://laputski.ai/junior-2026</guid><category><![CDATA[Junior developer ]]></category><category><![CDATA[Career]]></category><category><![CDATA[Career Growth]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Thu, 01 Jan 2026 10:56:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767264782511/be581e94-a9d9-4528-8087-1b87a9d88535.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://restofworld.org/2025/engineering-graduates-ai-job-losses/">Все в панике</a>. AI радикально изменил рынок труда для джунов, сократив количество вакансий на 50%. У меня нет рецепта как найти работу кроме как <strong>дольше учиться и делать свои пет-проекты</strong>. Это базовая стратегия для повышения уровня абсолютно на любой ступеньке профессиональной лестницы.</p>
<p>В общем случае, чужой опыт не применим к моему. Ни чей опыт не релевантен для другого. Максимум что можно сделать - это препарировать чужой опыт и забрать себе некоторые ингредиенты в виде моделей поведения. Но без контекста они ничего не стоят. А контекст всегда уникален. И тем не менее, что бы посоветовал сам себе, если бы вышел на свою первую работу в 2026?</p>
<ol>
<li><p>Лучше добирать знания сразу в процессе работы. Если нужно прикрутить Kafka к Spring Boot и обрабатывать входящие сообщения, а такого опыта нет, то типичная рабочая ситуация - ищу релевантную статью, применяю, двигаюсь к следующей задаче. Никто не даст время на изучение новой технологии, но именно это и стоит сделать сразу же, не отходя от кассы. В свободное время, но сделать. Иначе, через пару лет окажется, что поработал со множеством технологий, но ни одной толком не знаешь.</p>
</li>
<li><p>Стоит держать в голове истинную проблему заказчика, а не только совершенство кода. Бывает, что заказчик сам не до конца понимает свою главную проблему. Нужно ему в этом помочь. Возможно, с его стороны это будет выглядеть как критика его священных идей, но это лучше, чем просто молчать.</p>
</li>
<li><p>Писать код так, чтобы заказчик не мог от вас отказаться, потому что в этом коде никто больше не разберется, - это довольно низко. Лучше делать работу так, чтобы заменить вас было крайне легко, поскольку любой, кто придет на ваше место, сразу разберется как всё работает. Это же касается управления командами и проектами - после вас должна остаться система, а не набор костылей, который рушится как только вынимается главная подпорка. Это может показаться невыгодной стратегией, но зачем вам работодатель, который не понимает ценности вашей работы?</p>
</li>
<li><p>Есть активности, которые тратят заряд внутренней батарейки, и те, что восстанавливают. Очень высаживают заряд перманентные негативные эмоции. Они, как утечка памяти, могут быть незаметны в моменте, но эффект обязательно накопится и тогда потребуется глубокая перезарядка. Необходимо сканировать себя на предмет стресс-факторов и по возможности устранять их. Лучше всего восстанавливает заряд любимое дело. Даже если это сложный физический или когнитивный труд, он все равно повышает заряд за счёт правильных эмоций.</p>
</li>
<li><p>Зачем постоянно изучать новое, держать руку на пульсе и т.д. если не видишь достойной цели? Не потерять работу - это не цель, а выживание. В аутсорсинге вы решаете чужие проблемы, приближаете сбычу мечт кого-то другого, результат вашего труда не принадлежит вам. Это само по себе перманентная утечка энергии. Но если придумать как можно интегрировать этот труд в личную миссию, тогда вы не гребете на галере, а пользуетесь ею как общественным транспортом, который останавливается в нужных вам местах. Вы помогаете и себе и компании.</p>
</li>
<li><p>Линия поведения <em>"мы боремся не друг с другом, мы боремся с проблемой"</em> не бессмысленна, её стоит придерживаться даже когда коллеги или заказчики явно борются против вас. Во-первых, с бОльшей долей вероятности будет решена сама проблема. Во-вторых, станут очевидны люди, которые вносят деструктив.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Книги 2025]]></title><description><![CDATA[Suleyman - The Coming Wave. Автор прогнозирует, что новая технологическая волна, помимо невиданных за счет взаимного усиления AI и SynBio открытий, будет нести левые и правые риски. Риски слева - это опасность неконтролируемого распространения технол...]]></description><link>https://laputski.ai/books-2025</link><guid isPermaLink="true">https://laputski.ai/books-2025</guid><category><![CDATA[books]]></category><category><![CDATA[2025]]></category><category><![CDATA[review]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Sat, 27 Dec 2025 19:30:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767259407714/90488ac9-69d4-4371-bd3d-55d61c3c94c5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong><em>Suleyman - The Coming Wave</em></strong>. Автор прогнозирует, что новая технологическая волна, помимо невиданных за счет взаимного усиления AI и SynBio открытий, будет нести левые и правые риски. Риски слева - это опасность неконтролируемого распространения технологий, которые становятся доступны каждому. Риски справа - это системы тотального цифрового надзора с социальным рейтингом и всеми аттракционами. Сулейман предлагает десять шагов к сдерживанию волны, подход надоподобие договора о нераспространении ядерного оружия.</p>
<p><strong><em>Тиль - От нуля к единице</em></strong>. Семь вопросов, которые должен задавать себе каждый предприниматель. Пойти создать монополию, что ли?</p>
<p><strong><em>Моженокв - Ген команды</em></strong>. Про построение эффективных команд. Несмотря на то, что всё описано на примере продающих команд (продажи автомобилей Audi), советы можно рассматривать как универсальные.</p>
<p><strong><em>Адизес - Управление в условиях кризиса</em></strong>. О создании команды, где сбалансированы все PAEI роли. Сначала лучше прочитать "Идеальный руководитель. Почему им нельзя стать и что из этого следует".</p>
<p><strong><em>Гупта, Сачер - Сила в доверии</em></strong>. Uber не доверял сотрудникам и пользователям и поплатился, не будьте как Uber.</p>
<p><strong><em>Гладуэлл - Сила мгновенных решений</em></strong>. Мгновенные срезы (первое впечатление) решают.</p>
<p><strong><em>Ленсиони - Пять пороков команды</em></strong>. Топ-менеджеры - это тоже команда. Пять пороков: взаимное недоверие, уход от конфликтов, необязательность, нетребовательность к другим, безразличие к общему результату.</p>
<p><strong><em>Ленсиони - Правда о вовлеченности сотрудников</em></strong>. Люди ненавидят свою работу по трем причинам: безликость (сотрудник как ресурс), бессмысленность (не ясно кому помогает моя работа), безоценочность (нет четкой метрики успешности труда).</p>
<p><strong><em>Логан, Кинг, Фишер-Райт - Лидер и племя</em></strong>. Выдающаяся книга, никакой воды, каждый абзац написан по делу. Теперь хочется работать только в компаниях пятого уровня или создавать их. Никак не меньше четвертого. Но таких к сожалению исчезающе мало.</p>
<p><strong><em>Стребулаев, Ланг - Венчурное мышление</em></strong>. Так вот как оно устроено. Ценная информация прежде всего для стартаперов.</p>
<p><strong><em>Рис - Бережливый стартап</em></strong>. Разработка через быстрое и дешевое тестирование гипотез.</p>
<p><strong><em>Кавасаки - Быстрый старт</em></strong>. Советы стартаперам.</p>
<p><strong><em>Коллинз, Лазье - Больше чем бизнес</em></strong>. Лучше сначала прочитать “От хорошего к великому“.</p>
<p><strong><em>HBR - Лидерство</em></strong>. Сборник классических статей.</p>
<p><strong><em>HBR - Личная эффективность</em></strong>. Сборник классических статей.</p>
<p><strong><em>Добелли - Искусство ясно мыслить</em></strong>. Сборник когнитивных искажений, некоторые кажутся спорными, поскольку сформулированы в вакууме, без привязки к контексту.</p>
<p><strong><em>Стрелеки - Кафе на краю земли</em></strong>. Зачем ты здесь?</p>
<p><strong><em>Элмор - Восемь парадоксов эффективного лидера</em></strong>. Весьма тонко подмеченные противоречия в том, что ожидают от лидера. Но это же и ключ к правильной интерпретации роли лидера.</p>
<p><strong><em>Бехтерев, Бехтерева - Спиральная динамика для бизнеса</em></strong>. Как и книги Адизеса, как "Лидер и племя", производит эффект зажегшейся в мозгу лампочки, раскладывает всё по полкам. Концепция спиральной динамики действительно работает, начинаешь понимать многие корпоративные процессы, которые раньше казались нелогичными. Но главное, становится ясно куда развиваться из текущего состояния.</p>
<p><strong><em>Сартр - Тошнота</em></strong>. Про айцишника на галере и его переживания. Не важно, что события происходят в 1932, сейчас абсолютно также.</p>
<p><strong><em>Юнгер - Перед стеной времени</em></strong>. Юнгер в своих произведениях оперирует особыми, ни на что не похожими образами - гештальтами. Неизвестный солдат, Рабочий, Одиночка, Анарх. Это совокупные философско-социально-антропологические образы, которые выражают суть эпохи. В данном эссе также есть центральный образ - стена времени, за которой ожидает что-то принципиально новое.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766861439350/da77c29e-acb9-410d-904c-9a4afca82a53.png" alt class="image--center mx-auto" /></p>
<p>Каждая из прочитанных книг по-своему интересна, но если выбирать личный топ, то из достигаторских книг - это "Лидер и племя" и "Спиральная динамика для бизнеса", из философских - однозначно "Перед стеной времени" Юнгера.</p>
<h3 id="heading-interpretaciya-esse-pered-stenoj-vremeni">Интерпретация эссе "Перед стеной времени"</h3>
<p>Время интуитивно ассоциируется с текучей субстанцией, например рекой. Но в образе стены означает границу эпохи, за которой находится ситуация принципиально не похожая на текущую. За стеной нас ожидает царство титанов, поднявшихся из бездны Тартар. Титаны - это техника, создающая сама себя из неорганизованной материи через посредство человека.</p>
<p>Новая эпоха будет царством коллективизма, прямая аналогия с царством количества Генона. Индивидуализм и целостность личности будут маргинализированы и уступят место "коллективному интеллекту" в качестве нового субъекта исторического процесса. В правовом, социологическом и теологическом смысле это действительно будут новые атомы, из которых конструируются массы.</p>
<p>Эссе написано в 1959, но с течением времени становиться всё актуальнее. Сегодняшнее томительное ожидание AGI сродни ожиданию поднимающегося титана, жар которого уже можно ощутить на поверхности.</p>
<p><em>Гравюра "Прометей коммитит огонь на github":</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766861722186/26fa63a0-e8c0-4ce2-9d70-06f408c8d945.jpeg" alt="Гравюра &quot;Прометей коммитит огонь на github&quot;" class="image--center mx-auto" /></p>
<p>Прометей (предвидящий) похитил на Олимпе огонь и принес людям. За это Зевс послал людям Пандору, которая засунула нос куда не следовало и человечество поразили неисчислимые беды. В принципе, если эмулированная за счет предсказания токенов функция рассуждения - это похищенный огонь разума, то примерно понятно, что полезет из ларца Пандоры: массовая невостребованность, класс прекариат как норма, неограниченное продление жизни для элит и ББД для масс, человекоданные, социальный рейтинг. Всё это - как левые, так и правые риски из книги Мустафы <s>Монда</s> Сулеймана.</p>
<p>Гигантские датацентры, как плавильные печи Гефеста из которых похищается огонь, доступны только Олимпу, то есть бигтехам. А еще Прометей, согласно мифу, вылепил из глины человека и оживил огнем. В новой версии это очень похоже на постчеловека Ника Бострома.</p>
<p>Если левацки настроенный Прометей раздает опенсорсный децентрализованный огонь всем и каждому, то правая версия Прометея только MAGA-позитивным с золотой картой. Но в любом случае, нервом новой эпохи становится децентрализация. При переходе через стену времени иерархии схлопываются, компрометируются сетецентричными структурами.</p>
]]></content:encoded></item><item><title><![CDATA[GITEX Global 2025 🌍]]></title><description><![CDATA[🔧 It seems that literally every country is striving to create its own sovereign AI ecosystem. These will be closed autonomous AI-based computing infrastructures using open-source AI to ensure data sovereignty. This is perhaps the main trend in GovTe...]]></description><link>https://laputski.ai/gitex-global-2025</link><guid isPermaLink="true">https://laputski.ai/gitex-global-2025</guid><category><![CDATA[GITEX 2025]]></category><category><![CDATA[AI]]></category><category><![CDATA[#govTech]]></category><category><![CDATA[Sovereignty]]></category><category><![CDATA[Multi-Agent Systems (MAS)]]></category><category><![CDATA[Tech Trends]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Sun, 19 Oct 2025 17:10:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760892764478/b3de119e-7cdc-441a-86ac-35d9b8f4613a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>🔧 It seems that literally every country is striving to create its own <strong>sovereign AI ecosystem</strong>. These will be closed autonomous AI-based computing infrastructures using open-source AI to ensure data sovereignty. This is perhaps the main trend in GovTech. Countries that succeed in this race will build more adaptive and less bureaucratized governance systems, giving them a productivity boost in literally every area of public administration. Machines have bureaucracy too (like BPMN), but unlike systems consisting of people, such systems adapt their behavior much more easily.</p>
<p>🤖 Agent autonomy is good, but <strong>reliability</strong> is more important. Agents are <em>increasingly refining their specialization</em> to the stage where they can perform sufficiently reliable atomic operations that don't require continuous human control. It's necessary to descend to this level to feel solid ground under your feet, push off from it, and start building multi-agent systems whose reliability is no lower than that of the weakest link.</p>
<p>🎨🧠 Previously, technology only extended human physicality, but for the first time it has reached cognitive function as well. It's now evident that the objectified reasoning function implemented in LLMs is quietly becoming the foundation of a new technological paradigm. This process forcibly localizes everything unpredictable and non-deterministic in humans within the intentional act, which, more than ever before, deserves to be called creativity. After all, <strong>creativity</strong> is precisely what translates chaos into order. AI only repeats after humans. As a result, <em>natural sciences are becoming more like humanities</em>, with a clearly defined creative act at the center, while <em>humanities are becoming mechanized</em>, allowing the most predictable creative tasks to be translated into technical ones (Midjourney, Sora, etc.). Somewhere in the middle, they will meet. Apparently, professions will now be divided not so much into humanities and technical fields, but rather into algorithmizable and non-algorithmizable ones.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760893296735/2d31e51b-e6fe-44ad-8802-d1ce3a073e8b.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Digital Transformation of Government Agencies]]></title><description><![CDATA[Abstract
This paper explores the main challenges that government agencies face and suggests a distributed platform architecture for data integration, cleaning, and analysis, incorporating artificial intelligence and machine learning algorithms. It di...]]></description><link>https://laputski.ai/digital-transformation-of-govtech</link><guid isPermaLink="true">https://laputski.ai/digital-transformation-of-govtech</guid><category><![CDATA[government]]></category><category><![CDATA[#govTech]]></category><category><![CDATA[agentic AI]]></category><category><![CDATA[Enterprise AI]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Sun, 05 Oct 2025 22:01:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767259489774/56062dec-a509-4fa9-98a5-fe54ba8754f9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-abstract">Abstract</h2>
<p>This paper explores the main challenges that government agencies face and suggests a distributed platform architecture for data integration, cleaning, and analysis, incorporating artificial intelligence and machine learning algorithms. It discusses the platform's infrastructure and software core, as well as the idea of using enterprise AI with vector data storage. We describe scenarios where users analyze data using AI agents and where AI agents manage business processes with a controlled feedback loop. The solution is designed for partially or fully isolated environments, using an open-source-first approach and planned capacity allocation.</p>
<h2 id="heading-introduction">Introduction</h2>
<p>The complexity and fragmentation of government information systems require a method to unify data from multiple sources, enabling analytics and management capabilities that were previously out of reach. The proposed platform creates a unified pipeline for ingesting, storing, cleaning, normalizing, and analyzing data, as well as executing and optimizing processes. It includes enterprise AI that offers contextually relevant answers and secure access to action tools. We focus on practical design choices suitable for single-cluster, resource-constrained, and isolated deployments.</p>
<h2 id="heading-current-challenges">Current Challenges</h2>
<p>Based on years of experience building systems for government agencies, we have identified the following priorities:</p>
<ol>
<li><p><strong>Data integration and processing</strong>. There is a need to combine and process data from fragmented systems to enhance decision-making and gain a complete analytical view that <strong><em>no single system can provide</em></strong>.</p>
</li>
<li><p><strong>Document Digitization</strong>. This involves digitizing, analyzing, and classifying large volumes of documents, including long-term archives. It requires strong OCR capabilities, structured entity extraction, topic classification, deduplication, and maintaining legal validity.</p>
</li>
<li><p><strong>Process unification</strong>. Linking agency workflows on a single platform to boost operational efficiency and improve decision-making quality.</p>
</li>
<li><p><strong>Document routing optimization</strong>. Improve the routing of documents through approvals, reviews, and administrative procedures by using machine learning and AI-assisted process design.</p>
</li>
<li><p>All solutions must work with limited or <strong><em>no internet connectivity</em></strong>, prioritize open-source components, and follow planned resource allocation.</p>
</li>
</ol>
<p>We propose a complete solution that combines reliable production components with new enterprise AI features.</p>
<h2 id="heading-architecture-overview">Architecture Overview</h2>
<p>The architecture includes:</p>
<ul>
<li><p>🖥️ A software and infrastructure core for a distributed, fault-tolerant system.</p>
</li>
<li><p>🌊 A centralized data lake that integrates internal and external sources.</p>
</li>
<li><p>🔄 Multiple ingestion modes: API subscriptions, streaming and batch loads, and user-driven uploads.</p>
</li>
<li><p>🧹 Data cleansing and transformation, including ML-driven enrichment and classification.</p>
</li>
<li><p>🤖 An enterprise, agent-based AI that works with platform data and supports user-defined business scenarios.</p>
</li>
<li><p>📊 An analytics platform.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766773674763/e3db780a-38b6-4fb3-9bd9-43bab53dc54c.png" alt class="image--center mx-auto" /></p>
<p>The <strong>infrastructure</strong> <strong>core</strong> is designed as a distributed, fault-tolerant system with interconnected tools that offer system administration, information security, authentication and authorization, and a low-code editor for managing data structures. The microservice architecture ensures horizontal scalability and isolates failures [1][2][3]. It includes built-in GitLab CI/CD and observability features like metrics, logs, and traces.</p>
<p>The <strong>centralized data lake</strong> combines internal and external sources, with distinct areas for raw data, cleaned data, and consumer data marts. Metadata is added to the data lake along with the main data stream and is utilized in the low-code editor.</p>
<p><strong>ETL and ELT</strong> channels are set up using API subscriptions, event buses, streaming, batch loading, and user uploads with validation [4]. Cleaning and transformation include normalization, enrichment, deduplication, feature extraction, and ML classification and regression tasks. We focus on regularly addressing technical debt for data, models, and infrastructure [5]. Data loaders, the ML model software core, and CI/CD follow an Agile development approach within the project development lifecycle (SDLC).</p>
<p><strong>Enterprise AI</strong> relies on LLM, vector data storage, and the n8n process orchestrator. Using LLM greatly reduces training time for specific business tasks due to their few-shot learning capability [6]. Few-shot learning is a method where models can perform tasks well with only a few training examples, helping them adapt to new tasks without much extra training. Currently, the n8n process orchestrator can use tools like microservice API calls and email sending. The feedback loop lets system administrators make controlled changes to business process rules using AI agents, supporting ongoing development.</p>
<p>The <strong>analytics subsystem</strong> offers tools for managing data representation through diagrams and graphs, report generation, dashboards, and OLAP data marts, all with artifact versioning and regulatory compliance.</p>
<p>Overall, the architecture follows the 12-Factor methodology, which includes configuration through the environment, immutable builds, build/release/run separation, and logging as event streams [7]. It also adheres to The Reactive Manifesto, focusing on asynchronous messaging, elasticity, resilience, and responsiveness [8].</p>
<h2 id="heading-technologies-overview">Technologies Overview</h2>
<p>The platform core uses a microservice architecture built on <em>Kubernetes</em>, <em>Java</em>, <em>Spring Framework</em>, <em>TypeScript</em>, <em>Angular</em>, <em>Keycloak</em>, <em>Gradle</em>, and <em>Docker</em>. It also includes a proprietary framework with a special constructor (low-code structure editor) that allows users to create and visualize data structures and integrate them into business processes without extra programming.</p>
<p>The data lake utilizes tools like <em>MinIO</em> and <em>MongoDB</em> for raw and intermediate data and metadata, <em>PostgreSQL</em> for cleaned data, Elasticsearch for log storage, and <em>Redis</em> for caching. Data is added to the lake through <em>Kafka</em>, <em>RabbitMQ</em>, <em>Spring Cloud Data Flow, gRPC</em>. A separate channel for critical data addition involves document digitization from various file formats, including graphics like PDF, JPG, and PNG.</p>
<p>Data cleaning and transformation are carried out using <em>Python, PyTorch, scikit-learn, transformers, BERT, PyCaret, CatBoost, XGBoost, Optuna</em>, and <em>Apache Airflow</em> for process orchestration.</p>
<p>Enterprise AI is built on <em>Spring AI</em>, using <em>Mistral-24b</em> and <em>gpt-oss-20b</em> as LLMs, <em>llama.cpp</em> for cloud deployment, <em>Ollama</em> for local deployment, <em>Qdrant</em> for embedding storage, <em>Docker</em>, and <em>Kubernetes</em>. Currently, working prototypes are being developed using <em>LangGraph</em>, <em>n8n</em>, and <em>pgvector</em> technologies for hybrid search scenarios.</p>
<p>The analytics platform employs <em>Stimulsoft Reports, Stimulsoft Dashboards, JasperReports, BIRT</em>, and proprietary developments.</p>
<h2 id="heading-architecture-decision-records">Architecture Decision Records</h2>
<p><strong>ADR-001. Microservices on Kubernetes.</strong> We adopt a microservices architecture orchestrated by Kubernetes to achieve horizontal scalability, fault isolation, and independent releases. Services are built in Java with Spring, containerized with Docker, and delivered via GitLab CI/CD. This decision balances operational control with elasticity suitable for a single-tenant, isolated government cluster.</p>
<p><strong>ADR-003. MongoDB-centered lake.</strong> We do not introduce Apache Iceberg because resources are constrained and the data is predominantly government-specific JSON. We choose MongoDB to support fast ingestion, flexible schema evolution, convenient APIs, and multi-document transactions for consistent data handling, even with many temporary artifacts. We implement our own custom Bronze/Silver/Gold layering on MongoDB and MinIO.</p>
<p><strong>ADR-004. RAG as the foundational enterprise AI pattern.</strong> We standardize on Retrieval-Augmented Generation with Qdrant as the vector store to keep knowledge fresh without retraining LLMs. This pattern provides controllable grounding of responses and supports offline operation, provided that rigorous offline/online evaluations are conducted to manage hallucination risk.</p>
<p><strong>ADR-005. BPMN for business orchestration and n8n for technical workflows.</strong> We use BPMN (e.g., Camunda) to orchestrate end-to-end business processes and n8n to execute technical steps, with an AI agent proposing changes that are subject to human approval. This separation maintains business traceability while allowing quick updates to integrations and automations.</p>
<p><strong>ADR-006. Security for isolated government environments.</strong> We adopt a zero-trust approach with OIDC via Keycloak, encryption in transit and at rest with managed keys, data masking for PII. Trust boundaries are explicitly defined to reflect isolated clusters, and external interfaces are minimized while maintaining necessary interoperability.</p>
<p><strong>ADR-007. In-house ML pipeline</strong>. We create our own model training and inference pipeline, storing intermediate datasets and features in MongoDB to save resources and maintain full control over execution, scheduling, and debugging. This approach reduces external dependencies, keeps costs predictable, and aligns with the need to self-host all components within the isolated perimeter.</p>
<p><strong>ADR-008. Observability.</strong> We implement observability using Prometheus for metrics, Grafana for visualization, Zipkin for tracing, and ELK for logs, ensuring end-to-end visibility across APIs, data pipelines, and AI components. We deliberately exclude Istio because the deployment targets a single Kubernetes cluster in an isolated environment, and adding a service mesh would increase complexity without proportional operational benefit.</p>
<h2 id="heading-slosli">SLO/SLI</h2>
<p>All monitoring is implemented with self-hosted, open-source tools and stored within an isolated environment.</p>
<ul>
<li><p><strong>Platform Availability SLO</strong>: 99.5% monthly in single-cluster isolated mode. SLI is measured using uptime probes and request success rates.</p>
</li>
<li><p><strong>Data Ingestion SLO</strong>: 95th percentile end-to-end latency is under 30 minutes for daily batch loads and 8 hours for history batch loads (previous years data). SLIs are measured from the first byte received to when the data is stored.</p>
</li>
<li><p><strong>AI Response SLO</strong>: 95th percentile inference latency is under 5 seconds for retrieval and generation on local models. SLI includes vector search latency and token generation rate.</p>
</li>
<li><p><strong>Operations</strong>: Mean Time to Recovery is under 2 hours. Change failure rate is under 15%.</p>
</li>
</ul>
<h2 id="heading-enterprise-ai">Enterprise AI</h2>
<p>Let's explore how AI is used in the platform. The process starts with centralized data being ingested into the data lake, while content is indexed in vector storage at the same time. Indexing considers different source types like text, tables, and mixed documents.</p>
<p>Users create prompts for the LLM, specifying business scenarios and indicating which documents to consider directly in the user interface. The agent searches the vector storage, gathers relevant fragments, and generates results in the desired format.</p>
<p>The agent can then use system tools through MCP interfaces-calling microservice REST APIs, saving results to databases, sending email reports, starting the next process stage, or passing control to agents with different master-prompt instructions. This method allows for automatic system updates based on a thorough understanding of its state.</p>
<p>Currently, we use n8n as an experimental workflow automation tool. Users create n8n schemes to implement business scenarios. A specialized process orchestration agent suggests corrections to these n8n schemes (such as changing the order of steps, parameters, and routing), which are then reviewed by system administrators. <strong>This creates a managed feedback loop where the system evolves based on data analysis and AI recommendations.</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766773712396/41f0d4ad-63fc-4161-99ff-6603d0d36023.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-example-use-case">Example Use Case</h2>
<p>Consider a control example implementing a freight transportation data scenario. The test data corpus includes one thousand documents each of three types: freight transportation requests, work completion certificates, and invoices.</p>
<p>The business process is implemented as a BPMN scheme (request, carrier selection, transportation, work completion certificate, invoice) and can be integrated into the platform using frameworks like Camunda. Several n8n schemes with AI participation are implemented that analyze transportation requests and initiate cooperation, calculate quotes based on cargo data and current tariffs, send transportation status messages to social networks, generate transportation documents, and distribute them to counterparties. Here BPMN acts as the overall process orchestrator, while n8n executes specific technical actions that can be initiated by BPMN handlers, external actors (customer, carrier), or simply on schedule.</p>
<p>The business scenario agent receives a user prompt to analyze three document types and formulate a cost optimization strategy. The result should be saved as a report. The user works with this agent until obtaining an acceptable strategy.</p>
<p>The orchestration agent analyzes customer behavior (correspondence, work reviews), transportation incidents, efficiency of each transportation stage for specific routes, n8n integration fault tolerance, and formulates proposals for updating BPMN and n8n schemes. The result includes a text report and new versions of .<em>bpmn</em> and .<em>json</em> files.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>We have examined current government agency challenges and proposed a comprehensive solution through creating a software platform using artificial intelligence. This platform provides comprehensive data source integration, document digitization and intelligent processing, and AI-based business process management. The architecture relies on proven distributed system design practices and supports a managed feedback loop for systematic improvement of data and process orchestration. This development creates a technological foundation for regulated digital transformation of government agencies.</p>
<h2 id="heading-references">References</h2>
<ol>
<li><p>Bass L., Clements P., Kazman R. Software Architecture in Practice. – 4th ed. – Boston: Addison-Wesley, 2021. – 624 p.</p>
</li>
<li><p>Tanenbaum A. S., Steen M. Distributed Systems: Principles and Paradigms. – 2nd ed. – Upper Saddle River, NJ: Pearson; Prentice Hall, 2007. – 765 p.</p>
</li>
<li><p>Newman S. Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith. – Sebastopol, CA: O’Reilly Media, 2019. – 272 p.</p>
</li>
<li><p>Kleppmann M. Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems. – Beijing; Boston; Farnham; Sebastopol; Tokyo: O’Reilly Media, 2017. – 616 p.</p>
</li>
<li><p>Sculley D., Holt G., Golovin D., Davydov E., Phillips T., Ebner D., Chaudhary V. [et al.]. Hidden Technical Debt in Machine Learning Systems / D. Sculley [et al.] // Advances in Neural Information Processing Systems. – 2015. – Vol. 28. – P. 2503–2511.</p>
</li>
<li><p>Brown T. B., Mann B., Ryder N., Subbiah M., Kaplan J., Dhariwal P., Neelakantan A. [et al.]. Language Models are Few-Shot Learners / T. B. Brown [et al.] // Advances in Neural Information Processing Systems. – 2020. – Vol. 33. – P. 1877–1901.</p>
</li>
<li><p>Wiggins A. The Twelve-Factor App. – URL: <a target="_blank" href="https://12factor.net">https://12factor.net</a>.</p>
</li>
<li><p>Bonér J., Farley D., Kuhn R., Thompson M. The Reactive Manifesto. – URL: <a target="_blank" href="https://www.reactivemanifesto.org">https://www.reactivemanifesto.org</a>.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Job Security: Not Just Learning AI]]></title><description><![CDATA[Everyone keeps saying it’s not AI that will replace you, but the person who uses it. And so you’re told: use AI, keep developing nonstop, and then you won’t get fired. But to me, the real subject here is not so much the employee as the business owner...]]></description><link>https://laputski.ai/job-security-not-just-ai</link><guid isPermaLink="true">https://laputski.ai/job-security-not-just-ai</guid><category><![CDATA[AI]]></category><category><![CDATA[Futureofwork]]></category><category><![CDATA[jobs]]></category><category><![CDATA[teamwork]]></category><category><![CDATA[Teampire]]></category><dc:creator><![CDATA[Alexander Laputski]]></dc:creator><pubDate>Wed, 10 Sep 2025 13:53:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767260764727/c7faea17-b17d-412e-a8c7-640422e242da.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Everyone keeps saying it’s not AI that will replace you, but the person who uses it. And so you’re told: use AI, keep developing nonstop, and then you won’t get fired. But to me, the real subject here is not so much the employee as the business owner and his bugs in the head.</p>
<p>How many stakeholders out there are actually ready to reshape the business and declare new ambitious goals so there’s enough meaningful work for everyone and the team can be kept? Or just admit that now we can work less and, say, move to a four‑day week? Such people are clearly a minority. And those will be teams where they ALREADY value real collaboration and fight not each other, but the PROBLEM.</p>
<p>Accelerated tech learning (when squirrel spinning the wheel faster and faster) guarantees nothing. It’s only a necessary condition in the employment criterion. The sufficient one is belonging to a Stage 4 team (see the book “Tribal Leadership”), where people direct ambition not toward competing with colleagues but toward attacking the problem.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766773855152/816c05a7-9533-444f-afcc-3eb344590dfb.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>