Skip to content
ALGOLOGIX

AI engineering

RAG & knowledge systems

Retrieval systems that answer from your documents and show their working. An answer without a citation is an assertion, and in most of the places this gets deployed an assertion is not good enough.

  • Ingestion pipelines
  • Embeddings
  • Hybrid & vector search
  • Rerankers
  • Graph RAG
  • Freshness

What we build

Ingestion and chunking pipelines
Parsing, structure-aware chunking and incremental re-indexing as sources change.
Hybrid retrieval
Dense and keyword search combined, because exact-match queries defeat embeddings alone.
Reranking and filtering
A second pass that reorders candidates and drops the ones that only look relevant.
Citation and attribution
Span-level links back to the source, so any claim can be checked in one click.
Permission-aware retrieval
Results filtered by the asking user's access, enforced at query time.
Retrieval evaluation suite
Scored recall, precision and faithfulness, run in CI against a labelled set.

Problems this solves

  • Problem
    It answers confidently from a document that does not say that.
    Approach
    Score faithfulness against retrieved spans, require citations, and let the system answer that it does not know.
    Outcome
    Unsupported answers are caught by the eval suite rather than by a customer.
  • Problem
    Search misses the document a person would have found by name.
    Approach
    Run hybrid keyword and dense retrieval with a reranker, and evaluate on the queries users actually type.
    Outcome
    Exact-match and conceptual queries both land, instead of one being traded for the other.
  • Problem
    The index goes stale and nobody notices.
    Approach
    Incremental re-indexing on source change, with freshness monitored and alerted like any other service metric.
    Outcome
    Answers reflect the current document set, and staleness is a page rather than a surprise.

How we approach it

  1. Discover

    We look at the documents before we look at the model. Format, freshness and who is allowed to see what decide the architecture, and they are the three things a demo never has to handle.

  2. Design

    Chunking, hybrid retrieval and reranking are designed together against a question set your team wrote. Permissions are part of the query, never a filter applied to the answer afterwards.

  3. Engineer

    Ingestion is a pipeline with re-runs and backfills rather than a script somebody ran once. Retrieval quality is visible in the interface while we are still building it.

  4. Evaluate & harden

    Retrieval is measured separately from generation, because a wrong passage and an ungrounded answer are different bugs with different fixes. Refusing to answer counts as correct when nothing supports one.

  5. Launch & operate

    Citations get clicked, and the clicks show where the corpus is thin. The evaluation set grows from real questions rather than the ones we imagined at the start.

What we build it with

Dense and lexical retrieval merged in one query, reranked, and raising rather than answering when nothing supports an answer.

retrieval/hybrid.py
"""Dense plus lexical, reranked, and never answered uncited."""

SEARCH = """
with dense as (
    select id, 1 - (embedding <=> %(vec)s) as score
    from passages where tenant_id = %(tenant)s
    order by embedding <=> %(vec)s limit 50
), lexical as (
    select id, ts_rank(tsv, plainto_tsquery(%(q)s)) as score
    from passages where tenant_id = %(tenant)s limit 50
)
select id, sum(score) as score
from (select * from dense union all select * from lexical) hits
group by id order by score desc limit 20
"""


def retrieve(question, tenant):
    vector = embed(question)
    hits = db.fetch(SEARCH, q=question, vec=vector, tenant=tenant)
    ranked = rerank(question, hits, model="rerank-v3")[:5]

    # No passage, no answer. The citation is the contract, so
    # refusing is a correct outcome rather than a failure.
    if not ranked:
        raise NoGroundedAnswer(question)

    return ranked

Languages

  • Python

Retrieval & vector

  • pgvector
  • Elasticsearch / OpenSearch
  • Embeddings — OpenAI, Voyage, Cohere, BGE, E5
  • Rerankers — Cohere Rerank, BGE-reranker
  • Hybrid BM25 + dense
  • GraphRAG

Databases

  • PostgreSQL

Observability & evaluation

  • Ragas
The full inventory

Related work

  • Healthcare · 2026

    A knowledge assistant that shows its sources

    A retrieval assistant over clinical policy and procedure documents, answering staff questions with span-level citations and refusing to answer when the documents do not support one.

    Answers carrying a verifiable citation
    • rag knowledge systems
    • generative ai
    • data engineering analytics
    Read a knowledge assistant that shows its sources

Questions we get asked

Which vector database do you recommend?

pgvector, in the Postgres you already run, unless the evals show you need more. One fewer system to operate is usually worth more than the last few points of recall — and if scale later justifies a dedicated store, the retrieval interface makes that a swap rather than a rebuild.

How do you stop it inventing answers?

Retrieval-grounded generation with span-level citations, a faithfulness score in the eval suite, and an explicit path for the system to say it does not know. We treat an uncited claim as a bug, not a style preference.

Can it respect our existing permissions?

Yes. Access is enforced at query time against your identity provider, so results are filtered per user rather than trusting a prompt not to mention something. Permission changes take effect on the next query.

How do you keep it up to date?

Incremental re-indexing triggered by source changes rather than a nightly full rebuild, with freshness tracked as a monitored metric so a broken connector shows up as an alert instead of quietly stale answers.

Tell us what you are trying to ship.

A first call is 30 minutes and costs nothing. Bring the problem rather than a spec — the useful part is usually working out whether this is the right shape of solution at all.