← All work

RAG Problem Tree Generator

AI-Powered Regional Policy & Causality Decomposition

Role
Creator & AI/Systems Experimenter
Period
2024 - 2025
Organisation
Independent

Overview

An experimental AI system that parses regional planning documents and socio-economic datasets to generate verified causal problem trees (Masalah → Penyebab → Intervensi) using retrieval-augmented generation.

Context

Drafting policy problem trees typically requires weeks of manual document cross-referencing. This experiment tests whether local LLMs combined with vector embeddings can accurately construct valid causal graphs from unstructured government reports.

Problem

Traditional LLMs hallucinate non-existent regional regulations and invent unsubstantiated causes when asked to generate policy recommendations directly.

Approach

Architected a grounded RAG pipeline using ChromaDB vector stores and local Ollama embeddings to constrain the model strictly to verified regulatory texts and statistical datasets.

Flow

  1. Data

    Regional Policy Data

    Regional documents, RKPD reports, and statistical datasets

  2. Retrieval

    Information Retrieval

    Dense semantic search via ChromaDB vector embeddings

  3. RAG

    AI Synthesis Pipeline

    LangChain orchestration with domain-constrained prompt templates

  4. Problem Tree

    Structured Output

    Hierarchical graph: Masalah → Penyebab → Opsi Intervensi

Technical challenges

  • Enforcing strict hierarchical schema output (valid JSON DAG) from language models without syntax breakage.
  • Optimizing local embedding and inference speeds using Ollama on developer workstation environments.

Engineering decisions

  • Implemented strict Pydantic schema validation wrappers to ensure generated problem trees conform to deterministic front-end graph nodes.
  • Used hybrid chunking (document headers + semantic paragraphs) to preserve regional context during vector retrieval.

What shipped

  • Grounded RAG architecture using ChromaDB and Ollama
  • Deterministic schema parsing into interactive problem-tree graphs
  • Hands-on technical exploration bridging AI capabilities with real-world planning needs

Stack

FastAPI · LangChain · ChromaDB · Ollama · Vector Embeddings · Document Processing