< Return to PDA Terminal

[SYSTEM DOCS] Project FAQ

Technical overview of the Retrieval-Augmented Generation (RAG) system built for S.T.A.L.K.E.R. OP-2.2.

1. Project Overview & Motivation

Who am I?

I am César Blanc, a Data Engineer/Scientist passionate about Artificial Intelligence, processing complex datasets and creating models based on real-world use cases. I am currently looking for a job as a Data Scientist. Check out my page with my resume for more information and my if you want to contact me

Why choose a video game mod (OP-2.2) for a data project?

S.T.A.L.K.E.R. OP-2.2 is notoriously known as one of the most complex and data-dense modifications in the S.T.A.L.K.E.R. community. It's an esoteric and obscure mod featuring thousands of interlocked quests, items, coordinates, and hidden mechanics spread across unstructured community wikis and raw spreadsheets. Since I love both the base game and the mod, and since it's impossible to play without spending hours on the wiki, I came up with the idea of creating a personal assistant to help me and other players to beat the game. All data used in this projet comes from

Data Engineering Perspective: This game acts as a perfect proxy to show what I can do. Building an assistant for it required solving real-world business problems: extracting noisy, unstructured data, chunking it, creating semantic vector embeddings, crossing it with structured relational databases and a graph.

Affiliation

I am in no way affiliated with the holder of the S.T.A.L.K.E.R. license , the creators of the mod OP-2.2 or the OP-2 fandom wiki . This is a standalone fan project which I use for my portfolio and as a personal assistant.

2. Technical Stack

Python 3 Docker FastAPI SQLAlchemy LangChain LangGraph OpenAI API Qdrant (Vector DB) PostgreSQL (Relational DB) NetworkX google cloud plateform Vanilla JS / HTML / CSS

3. Key Engineering Challenges Solved

Hybrid Search (Vector + Relational + Graph)

The system is not just a standard semantic search engine. The LLM acts as an autonomous agent capable of deciding which tool to use: it queries the Qdrant Vector Database for unstructured narrative data (quest guides, tactics...), queries the PostgreSQL Database for exact numerical statistics (weapon damage, armor carry-weight...) and search in the NetworkX Graph for quest routing and pathfinding. This hybrid approach eliminates hallucinations on critical data points.

Agentic Workflow & State Orchestration (LangGraph)

To overcome the limitations of traditional linear RAG pipelines (such as truncation on massive wiki tables or inaccurate answers because they were unverified and rushed), the agent has been migrated from a simple single-pass execution to a cyclical StateGraph using LangGraph:

LLM Memory Management & Cost Optimization

Initially, preserving conversation history caused memory leaks and `400 Bad Request` crashes due to the LLM returning massive internal metadata blocks. I implemented a strict memory middleware that intercepts the LLM's raw output, extracts only the sanitized user-facing text, and dynamically truncates the context window to a rolling 10-message limit. This guarantees server stability and drastically reduces API token costs.

Automated Data Pipeline & Health Monitoring

A RAG system based on a fan-driven wiki must be up to date. To prevent outdated information and ensure synchronization with the ever-evolving community data, I engineered a fully automated data pipeline:

Hallucination Prevention & Traceability

For a RAG system to be trustworthy, traceability is mandatory. I utilized Few-Shot Prompt Engineering to strictly enforce source citations. The agent is hardcoded to dynamically generate Markdown links pointing exactly to the originating Wiki page URL or the specific Google Sheet / Database table used for its answer. This way, the user can verify the information and understand how the RAG generates its answers.

Security & API Stability

The FastAPI backend is built for production readiness, featuring:

Lightweight UX / UI

Instead of relying on heavy modern frameworks (React/Vue), the frontend was deliberately built using vanilla HTML/CSS/JavaScript. It relies on a single external dependency (`marked.js`) to parse Markdown in real-time. This decision was made because I wanted to create a Minimum Viable Product and prioritizing backend complexity and data delivery over frontend overhead. Also, I like the raw look, which reminds me of the interface of S.T.A.L.K.E.R. PDAs.