niclas wunder

AI assistant for the knowledge of a school.

A chat that answers questions from the internal wiki and a legal reference work of around 1,400 pages – in German and with sources. Built alone, from requirements to operation.

Context
School, education sector
Service
Knowledge Assistants (RAG)
Role
AI Engineer & Fullstack
Period
04/2026 – 08/2026
Setup
Solo, from requirements to operation

01 — Starting point

The answer was in there somewhere. But where?

The question behind it

“Is that in the wiki or in the reference work?”

The school’s knowledge lived in two places: an internal wiki and a legal reference work of around 1,400 pages as a PDF. Anyone who needed an answer first had to know where to look – and then read. A keyword search only helps if you already know the right word.

02 — Solution

Ask a question, see the source.

An assistant that knows both sources of knowledge, answers in German and shows where each answer comes from.

  1. 01

    Both sources, always up to date

    The wiki is read in automatically every night, and the reference work is split along its sections. Nobody has to maintain content for the assistant by hand.

  2. 02

    A search that understands German

    Semantic search and German full-text search work together: the assistant finds what you mean – and the exact technical term.

  3. 03

    The right source for the question

    Every question is classified first: wiki, reference work or both. A custom reranking step sorts the hits before the AI answers.

  4. 04

    Answers with sources

    The answer appears live in the chat, with a reference to the passage in the wiki or the reference work. Anyone who wants to can check it.

03 — Architecture

From the source to the answer.

Simplified. Two sources of knowledge, one search, one chat – and measurement in production.

Architecture · anonymized

A · Sources

Internal wiki

Behind a login. Read in again every night.

Scraping · nightly

Reference work

Legal, around 1,400 pages.

PDF · Sections

B · Preparation

Ingestion

Reads in both sources and splits them into sections.

Python · OpenAI API

Index

Vectors and German full text in one database.

PostgreSQL · pgvector

C · Search

Query routing

Assigns the question: wiki, reference work or both.

LangChain

Search

Vector · Full text

Reranking

Custom

D · Answer

Backend

The model writes the answer from the hits, with sources.

FastAPI · SSE

Chat

Live answer, source to check, login per user.

React · TypeScript

E · Operation

Every answer is logged, and users rate it right in the chat. Langfuse, self-hosted.

04 — My role

One person, the whole system.

Solely responsible: gathering requirements, building, rolling out, operating. No handover to a second developer.

  1. 01

    Requirements

    Which questions get asked, which sources count and who gets access.

  2. 02

    Data & search

    Ingestion for wiki and PDF, hybrid search, reranking and routing across two sources.

  3. 03

    Backend & chat

    API with streaming and source citations, user management, chat interface.

  4. 04

    Operation

    Automated deployment and feedback per answer in the monitoring.

05 — Result

What has changed.

I only share concrete usage numbers with the school’s approval. I’m happy to tell you more in a conversation.

1,400 pages, one question
Before, you had to search the reference work yourself. Now you ask a question and get the passage along with the answer.
Up to date every morning
New and changed wiki pages are in the assistant the next morning. Without maintenance by hand.
In production
Feedback per answer shows where the system works well and where it needs sharpening.

06 — Tech

The stack.

For technical readers, teams and agencies.

AI & search
LangChain, OpenAI API, pgvector, hybrid search, reranking
Backend
Python, FastAPI, server-sent events
Data
PostgreSQL, scraping, PDF parsing
Interface
React, TypeScript
Operation
Docker, Traefik, GitHub Actions, Langfuse

Technical details

How ingestion, search, chat and operation are built in detail.

Reading a wiki behind a login

The wiki runs on HumHub. The nightly ingestion reads the CSRF token, logs in with a session, filters out navigation and comments, follows linked resources and deduplicates content. This boundary to the wiki is covered by deterministic tests against mocked HTTP transports.

Reference work with pages and section path

The PDF is split along its sections. Every chunk carries the edition year, page range and section path and lives in its own vector table.

Hybrid search right in PostgreSQL

No separate vector database: pgvector (cosine distance) and PostgreSQL’s German full-text search (websearch_to_tsquery) run in one database. A deterministic reranker weighs the vector score, keyword ranking and term overlap in content and headings.

Routing across two corpora

Legal material is only included when the question carries legal signals – such as “§” or the German words for “law” or “parental leave” – or its score passes a higher threshold. That keeps everyday answers clean and legal questions well-founded.

Chat with streaming and structured citations

An LLM condenses follow-up questions and the history into standalone search queries. Answers arrive via server-sent events, citations are structured: wiki URL and title, or edition, pages and section. If there is no matching context, the assistant says so instead of guessing.

Login and administration

Session-based authentication with Argon2, saved chat histories, an admin area with user management and CSV import, and a Typer CLI for operational tasks.

Operation

Database migrations with Alembic, nightly re-ingestion via cron in the app container and self-hosted Langfuse: trace IDs attach users’ feedback to the answer it belongs to. Shipped as one image behind Traefik, with TLS via Let’s Encrypt.

07 — Next

More like this.

The service

Knowledge Assistants (RAG)

Assistants that deliver answers from your wiki, your PDFs and manuals. With sources, access rights and measured quality.

How I build knowledge assistants

Similar project

Multi-agent system at a corporate group

Specialized agents answer analysis questions across several data sources, in a chat interface with live streaming.

Read the case study

Start a project

Your knowledge as a chat – with sources?

Tell me in two or three sentences what it’s about. You’ll get an honest assessment within one business day – even if it says you don’t need AI at all.