Professional work

GANI.AI

Retrieval infrastructure behind a production legal AI platform for legal, tax, and compliance work.

Role
Software Engineer - Backend and AI Systems
Status
Active
Website
gani.ai/

What this project shows

Context

Client work focused on legal AI, retrieval, and RAG systems.

My contribution

Worked on preprocessing, embeddings, retrieval, reranking, index optimization, and cost-aware RAG improvements.

Why it matters

Production experience across retrieval systems, backend engineering, and AI infrastructure.

Public evidence

Highlights

  • Retrieval infrastructure for legal, tax, and compliance workflows
  • Embedding, retrieval, reranking, and context selection
  • Retrieval quality and index optimization
  • Cost-aware RAG engineering
  • Backend and AI infrastructure

Legal AI Platform - Retrieval Systems - RAG Infrastructure - Backend Engineering

Overview

GANI.AI is an AI-powered legal technology platform designed to support legal, tax, and compliance workflows through domain-specific knowledge retrieval and AI-assisted document intelligence.

Public product materials describe capabilities including a private knowledge base, semantic search, document intelligence, and custom Retrieval-Augmented Generation (RAG) pipelines.

As part of the Technopartner Indonesia engineering team (my current role, since September 2024), I contribute to the backend and retrieval infrastructure supporting the product, with a focus on retrieval systems, backend services, distributed systems, and production-oriented AI/LLM workflows.

My work focuses on the engineering layer between proprietary domain knowledge and downstream language-model workflows: preparing information, building retrieval-oriented representations, retrieving relevant candidates, reranking context, and improving the efficiency of the overall retrieval lifecycle.


Engineering Challenge

Legal, tax, and compliance applications operate in knowledge-intensive environments where information relevance and domain grounding are critical.

A general-purpose language model should not be treated as the authoritative source for specialized legal or regulatory knowledge. The system therefore requires a retrieval layer capable of grounding AI workflows in curated and contextually relevant information.

From an engineering perspective, this introduces several challenges:

  • transforming heterogeneous source information into retrieval-ready representations;
  • maintaining useful semantic representations as the knowledge base grows;
  • retrieving relevant candidates efficiently from increasingly large indexes;
  • distinguishing semantically similar but contextually different information;
  • ranking retrieved candidates before they are supplied to the model;
  • controlling embedding, indexing, retrieval, reranking, and inference-related costs;
  • maintaining predictable behavior across the retrieval lifecycle;
  • operating retrieval infrastructure as part of a broader production system.

The engineering problem is therefore larger than simply connecting a vector database to a language model.

The retrieval system must operate as an information pipeline with explicit trade-offs between relevance, latency, scalability, maintainability, and operational cost.


My Role & Contribution

I contribute to the retrieval foundation behind GANI.AI, working on the path that transforms source knowledge into usable context for downstream AI workflows.

My engineering scope covers several stages of the retrieval lifecycle.

Pre-Retrieval Processing

I worked on the preparation layer responsible for transforming source information into forms suitable for embedding, indexing, and retrieval.

The objective is to improve the quality of the information entering the retrieval system so that downstream retrieval and ranking operate over useful representations rather than relying on the language model to compensate for poorly prepared context.

Engineering considerations include:

  • information segmentation;
  • retrieval-oriented preprocessing;
  • document normalization;
  • metadata and contextual representation;
  • preparation of information for embedding;
  • reducing redundant or low-value retrieval candidates;
  • maintaining consistency between ingestion and retrieval behavior.

Embedding Pipeline

I contributed to the embedding pipeline used to transform domain knowledge into representations suitable for semantic retrieval.

The pipeline connects processed information with the indexing layer while balancing representation quality with practical production constraints.

Key engineering concerns include:

  • embedding quality;
  • indexing efficiency;
  • consistency between ingestion and query representations;
  • scalable processing as the knowledge base grows;
  • avoiding unnecessary re-embedding;
  • controlling compute and storage overhead;
  • maintaining predictable indexing workflows.

Retrieval & Reranking

Initial retrieval is only one stage of a production-oriented RAG pipeline.

I worked on retrieval and reranking workflows designed to improve the relevance of the final context supplied to downstream language models.

At a high level, the retrieval flow can be represented as:

Source knowledge is processed, embedded, and indexed, then candidates are retrieved, reranked, and selected as context for the language-model workflow.

Mermaid preview

The pipeline separates candidate discovery from final context selection.

Rather than forwarding every semantically similar result directly to the model, the system narrows and prioritizes retrieved candidates before the generation stage.

This creates a useful separation of responsibilities:

  • retrieval identifies potentially relevant information;
  • reranking improves ordering among retrieved candidates;
  • context selection determines which information is ultimately supplied to the downstream model.

This multi-stage approach provides more control over relevance than relying on first-stage similarity alone.


Index & Retrieval Optimization

I also worked on optimization around the indexing and retrieval layers.

As a knowledge base grows, retrieval cannot be evaluated purely in terms of search quality.

Several system-level factors influence both performance and operating cost:

  • index size;
  • storage requirements;
  • embedding workloads;
  • retrieval behavior;
  • reranking workloads;
  • query latency;
  • compute utilization;
  • downstream context size;
  • model token consumption.

My contribution therefore involved examining the retrieval pipeline as an end-to-end system rather than optimizing individual components in isolation.

The engineering objective is to preserve useful retrieval while balancing:

  • retrieval relevance;
  • query latency;
  • index efficiency;
  • compute utilization;
  • embedding workload;
  • reranking overhead;
  • context size;
  • infrastructure complexity;
  • operational cost.

Retrieval Architecture

At a high level, the retrieval subsystem sits between domain knowledge sources and downstream AI workflows.

Knowledge sources flow through processing, embedding, and indexing, while a request moves from candidate retrieval through reranking and context selection into the AI workflow and application layer.

Mermaid preview

The architecture separates the system into two major paths:

  1. preparing and indexing information;
  2. retrieving and selecting context during an AI request.

My contribution spans several parts of this workflow, particularly around information preparation, embedding, indexing, retrieval quality, reranking, and cost-aware optimization.


Ingestion Path

The ingestion path transforms source knowledge into retrieval-ready representations.

Source documents are normalized, segmented, and enriched with metadata before embedding, indexing, and storage in the retrieval store.

Mermaid preview

This stage affects the quality of every downstream retrieval operation.

Poorly structured information can produce weak retrieval regardless of the quality of the model used later in the pipeline.

For that reason, retrieval quality begins before the query is executed.


Online Retrieval Path

When the application needs domain knowledge, the online retrieval path identifies and refines the most relevant context.

A user query is processed, matched against the index for candidates, reranked, narrowed by context selection and passed to the language-model workflow.

Mermaid preview

Candidate retrieval provides breadth, while reranking and context selection progressively narrow the information passed downstream.

This helps avoid treating semantic similarity as the final relevance decision.


End-to-End Retrieval Lifecycle

The broader retrieval lifecycle can be viewed as two connected workflows.

Knowledge preparation builds the index while query processing reads from it, after which candidate retrieval, reranking, context selection and generation produce the application response.

Mermaid preview

The indexing path determines what knowledge can be discovered.

The online path determines what knowledge is selected for a specific request.

Both influence the quality and cost of the final AI workflow.


Engineering Principles

Retrieval Before Generation

For domain-specific AI systems, improving the information supplied to the model can be more important than relying on increasingly capable language models to compensate for weak retrieval.

The retrieval layer therefore acts as an explicit boundary between proprietary domain knowledge and the generative model.

The model is responsible for working with selected context, while the retrieval system is responsible for identifying useful information.


Multi-Stage Relevance

Semantic similarity alone does not guarantee that a retrieved document is the most useful context for a particular request.

Separating first-stage retrieval from reranking allows the system to progressively reduce the search space and prioritize stronger candidates before invoking downstream generation.

Conceptually:

A large knowledge space is reduced to retrieved candidates, then reranked candidates, then selected context for the model.

Mermaid preview

Each stage reduces the amount of information that needs to be processed by the following stage.


Cost as a System Property

The operating cost of a RAG system is not limited to LLM inference.

Cost can be introduced throughout the retrieval lifecycle:

Document processing, embedding, index storage, retrieval, reranking, context size and model inference each add cost to the pipeline.

Mermaid preview

Relevant cost factors include:

  • document processing;
  • embedding generation;
  • re-embedding;
  • index storage;
  • retrieval operations;
  • reranking compute;
  • network and service overhead;
  • context size;
  • downstream model token usage.

Optimization therefore needs to consider the entire system rather than only model inference cost.


Operational Simplicity Matters

A theoretically sophisticated retrieval pipeline is not automatically a better production system.

Architecture decisions must balance retrieval quality with:

  • observability;
  • maintainability;
  • latency;
  • infrastructure requirements;
  • service boundaries;
  • failure behavior;
  • deployment complexity;
  • operational cost.

A useful production system needs to be both technically effective and practical to operate.


Backend & System Context

The retrieval pipeline exists within a broader backend system.

Conceptually, the application can be viewed as several cooperating layers:

The application layer calls backend services, which call AI and retrieval services that own the retrieval pipeline, the language-model workflow, the knowledge index and supporting services.

Mermaid preview

This separation allows retrieval and AI workflows to exist as part of a larger service-oriented backend rather than as isolated model calls.

My work contributes to this intersection between backend engineering, retrieval infrastructure, and AI systems.


Reliability Boundaries

A production RAG system benefits from treating different parts of the pipeline as separate engineering responsibilities.

Knowledge preparation, retrieval, reranking, context construction and generation are separate responsibilities with different failure modes.

Mermaid preview

Problems at different stages have different failure modes.

For example:

  • weak preparation can reduce the quality of indexed knowledge;
  • weak retrieval can omit important candidates;
  • weak reranking can prioritize less relevant information;
  • excessive context can increase cost and introduce irrelevant information;
  • generation quality still depends on the selected context and downstream model behavior.

Thinking about these stages independently makes it easier to identify where quality improvements should occur.


Public Product Context

According to GANI.AI’s public product materials, the platform provides capabilities including:

  • private knowledge bases;
  • semantic search;
  • document intelligence;
  • custom RAG pipelines.

Technopartner’s public portfolio entry presents the project as an AI Wrapper App and Tailor-made System, with the GANI.AI Lawyer Dashboard listed among its deliverables.

Public References


Scope, Limits & Confidentiality

GANI.AI is a proprietary commercial product.

This case study intentionally describes my contribution at the engineering-domain and system-design level rather than exposing internal implementation details.

The following are intentionally omitted:

  • proprietary source code;
  • private architecture diagrams;
  • internal infrastructure topology;
  • customer or legal data;
  • production credentials;
  • internal model configuration;
  • retrieval configuration details;
  • proprietary algorithms and heuristics;
  • undocumented internal APIs;
  • internal benchmarks;
  • deployment configuration;
  • confidential team responsibilities.

The architecture diagrams on this page are conceptual representations intended to explain the engineering domain involved.

They are not reproductions of GANI.AI’s private production architecture.

Descriptions of the product itself are limited to publicly available information, while descriptions of my contribution focus on the engineering areas I worked on without exposing confidential implementation details.


Why This Work Matters

Building an AI application for legal, tax, and compliance workflows involves a fundamentally different engineering problem from building a generic conversational interface.

The usefulness of the system depends not only on what the language model can generate, but also on:

  • what information enters the knowledge system;
  • how that information is represented;
  • how efficiently it can be retrieved;
  • how retrieved candidates are ranked;
  • which context is ultimately selected;
  • how much context reaches the model;
  • how reliably the surrounding infrastructure operates.

A production RAG system therefore sits at the intersection of several engineering disciplines:

information retrieval, backend engineering, distributed systems, data processing, search infrastructure, AI infrastructure, LLM orchestration, and production operations.

My contribution to GANI.AI focuses on that intersection: improving the retrieval path that connects specialized domain knowledge with downstream AI workflows while balancing relevance, scalability, maintainability, latency, and operational cost.

Search this site