Berkay Orhan
WorkResearchExperienceAboutAskContact
Contact
← All projects

PROJECT / 2025

Municipality Chatbot

AI-Powered Citizen Services

Enterprise AI chatbot platform for Swedish municipalities with GraphRAG, multi-provider LLM support, and embeddable React widget. Self-hosted, GDPR-compliant solution with full data sovereignty.

stack
Python 3.11+ · LangChain · LangGraph · FastAPI · PostgreSQL · pgvector · Neo4j · React 19 · TypeScript · Vite · Tailwind CSS v4 · Docker · SSE (Server-Sent Events) · Pydantic · i18next

Live site ↗

How it works

  1. municipal sites
    scraped pages and PDFs

  2. pgvector + Neo4j
    chunks and relations

  3. LangGraph agent
    GraphRAG retrieval

  4. widget
    streams answers over SSE

01 / Overview

A turnkey AI chatbot solution designed specifically for Swedish municipalities to help citizens find information about municipal services 24/7. Built with LangChain/LangGraph for orchestration, the platform features GraphRAG technology combining vector search (pgvector) with knowledge graphs (Neo4j) and keyword matching. Supports multiple LLM providers including Google Gemini, Azure OpenAI, AWS Bedrock, and local models. The embeddable React widget integrates with any website via script tag, JavaScript, or React component. Complete data sovereignty with self-hosted deployment means citizen conversations never leave municipal infrastructure. Includes powerful CLI tools for content ingestion from websites (sitemap), PDFs, and Jira, with automatic sync capabilities. Production-ready with Docker containerization, health endpoints, structured logging, and conversation persistence.

02 / Key features

  • –GraphRAG technology combining vector search (pgvector), knowledge graphs (Neo4j), and hybrid keyword matching for accurate retrieval
  • –Multi-provider LLM support with Google Gemini, Azure OpenAI, AWS Bedrock, OpenAI, and local model options via LangChain's init_chat_model
  • –Embeddable React 19 widget with three integration methods: simple script tag, JavaScript initialization, or React component import
  • –Self-hosted, GDPR-compliant architecture with complete data sovereignty—all processing happens within municipal infrastructure
  • –Powerful CLI for content ingestion from sitemaps, individual URLs, PDFs, and Jira with checkpoint/resume support and automatic sync scheduling
  • –Real-time streaming responses via Server-Sent Events (SSE) with LangGraph checkpointing for conversation persistence in PostgreSQL
  • –Multi-language support (Swedish, English, Finnish, Arabic, Turkish, Somali, Spanish, Syriac) with i18next internationalization
  • –Production-ready with Docker Compose, health check endpoints, structured logging, graceful shutdown, rate limiting, and API key authentication

03 / Challenges

  • –Ensuring GDPR compliance and data sovereignty while supporting cloud LLM providers
  • –Building a flexible retrieval system that works for diverse municipal content (policies, forms, organizational info)
  • –Creating a widget that integrates seamlessly across different CMS platforms (WordPress, Drupal, Episerver, Sitevision, custom)
  • –Managing conversation state and streaming responses with LangGraph's async architecture
  • –Designing a CLI ingestion system that handles large websites with resumable checkpointing

04 / Solution

Implemented a layered architecture with LangGraph agent orchestration, PostgreSQL+pgvector for vector search, and Neo4j for relationship mapping. LangChain's init_chat_model provides unified multi-provider support while keeping data local. The React widget compiles to both a standalone embed script and an npm package, supporting multiple integration patterns. SSE streaming with LangGraph checkpointing enables real-time responses while persisting conversation state. The CLI uses BeautifulSoup for web scraping, PyMuPDF for PDFs, and implements checkpoint/resume with progress tracking. All services run in Docker containers with configurable profiles for development and production.

05 / Outcome

Delivers a production-ready, self-hosted chatbot platform that reduces customer service workload by 20-40% while improving citizen satisfaction with 24/7 availability and instant responses. Municipalities maintain full data sovereignty with GDPR-native compliance, choosing their preferred LLM provider (Google Gemini EU, Azure OpenAI Sweden, AWS Bedrock EU, or local models). The universal widget integrates with any CMS in minutes via script tag, serving multilingual citizens across Swedish municipalities. Supports content ingestion from entire websites via sitemap sync, with automated nightly updates to keep the knowledge base current.

06 / Services

  • FastAPI Backend

    High-performance API server with SSE streaming, thread management, run endpoints, security middleware (rate limiting, API key auth), and health checks. Orchestrates LangGraph agent execution.

    FastAPI · Uvicorn · SSE-Starlette · Pydantic · Redis

  • LangGraph Agent

    AI agent with GraphRAG retrieval (vector, keyword, graph traversal), tool calling, conversation state management, and PostgreSQL checkpointing for persistence and resumption.

    LangChain · LangGraph · PostgreSQL · pgvector · Neo4j

  • React Chat Widget

    Embeddable chat interface with React 19, TypeScript, Tailwind CSS v4, i18next multilingual support, theme customization, and three integration methods (script tag, JS init, React component).

    React 19 · TypeScript · Vite · Tailwind CSS v4 · i18next

  • Ingestion CLI

    Command-line tools for content ingestion from sitemaps, URLs, PDFs, and Jira. Features checkpoint/resume for large imports, automatic sync scheduling, and stats reporting.

    Python · BeautifulSoup · PyMuPDF · HTTPX · Click · Rich

Berkay Orhan© 2026

WorkResearchExperienceCVBack to top ↑