~/projects

Case Study

GraphOrg

Organisational knowledge & AI platform

graphorg.com
  • Next.js
  • React
  • TypeScript
  • PostgreSQL
  • Drizzle
  • Redis
  • Python
  • FastAPI
  • LangChain
  • Ollama
  • Docker
  • Vercel

A full-stack platform that maps people, teams, software services, repositories and technical dependencies, with a context-aware AI assistant that answers from the organisational data in front of you.

Problem

Scattered
Org structure, service ownership and dependencies live in docs, chat threads and people’s heads.
Stale
Org charts and ownership maps are drawn once, then drift with no source of truth.
Unsafe for AI
Wiki dumps leak data and don’t map back to real records or access rules.

What shipped

Multi-tenant models for people, teams, services and dependencies, plus a LangChain/FastAPI AI assistant with streamed responses from local and hosted LLMs, containerised with Docker for local and self-hosted setups.

Stack

Web
Next.js, React, TypeScript · role-gated pages, flowchart builder
Data
PostgreSQL + Drizzle · people, teams, services, repos · tenant-scoped queries
Auth
NextAuth · viewer / editor / admin / owner enforced in API
AI worker
FastAPI + LangChain · streams over SSE
Models
Ollama locally · hosted open-weights via config
Ops
Docker for local/self-hosted · Redis rate limits · size budgets

Decisions

  1. 01

    Context built on the server

    Client sends scope + question; API builds tenant-scoped context.

  2. 02

    One builder, two features

    Copy-context and Ask AI share builders; no emails or credentials.

  3. 03

    Separate AI worker

    Streaming LLM calls live in FastAPI, not Next route handlers.

  4. 04

    Provider-agnostic

    Local and hosted models behind one OpenAI-compatible API.

  5. 05

    Budget the whole prompt

    System, page, history and answer share one window; history trims first.

  6. 06

    Fail honestly

    Redis down → chat stays up. No worker → clear setup guidance.

Hard parts

Silent truncation
Raised Ollama’s window and aligned app limits to it.
Primary-team races
Advisory locks before mutations; settle step after deletes.
Redis first-call fail
Retry + connect timeout, with Redis-down path tests.
Stale chat across tabs
Key conversation state by page scope.

Next

  • Deploy the AI workerHosted model + provider spend limit
  • External integrationsConsolidate service ownership and technical knowledge from external platforms
  • Persistence & evalStored chats, injection cases, groundedness checks
  • ObservabilityTracing and cost tracking via Langfuse
  • Retrieval & MCPpgvector for cross-page Q&A; MCP under the same access rules

Access control, prompt budgets and honest failure modes matter more than prompt tricks, especially when organisational knowledge spans people, services and dependencies.