Inspiration

African SMEs and mid-market enterprises face a dual challenge: they cannot afford expensive enterprise architecture consultants, and they cannot rely on cloud-based AI tools that require fast, stable internet. We built AfriEA Advisor to democratize EA and business process advisory — making it available offline, on the commodity laptops already in use across the continent, and in the languages people actually speak.

What it does

AfriEA Advisor is an on-device Enterprise Architecture and Business Process Modelling platform. It delivers:

  • Multilingual EA advisory chat grounded in a local enterprise capability knowledge graph, supporting 12 African languages.
  • Domain assessment across 44 enterprise capability domains with maturity scoring.
  • Roadmap generation — phased strategic plans with timelines, priorities, and Africa-specific implementation guidance.
  • BPMN 2.0 process modelling — deterministic auto-generation from natural-language descriptions plus manual editing.
  • Gap analysis — compares current vs target maturity and recommends capabilities, epics, and features.
  • Export pack — PDF, SVG, JSON, CSV, and XLSX downloads for offline sharing.

All processing happens locally on an 8 GB RAM laptop with no internet required after initial setup.

How we built it

  • Backend: FastAPI + Uvicorn with async Server-Sent Events for streaming chat. Routers cover /chat, /assess, /roadmap, /bpmn, /export, and /health.
  • Inference engine: llama-cpp-python running Qwen2.5-3B-Instruct quantized to Q4_K_M (~2.5 GB RAM peak). Lazy-loaded on first request.
  • Knowledge engine: SQLite database seeded from a Cypher knowledge graph (seedgraph.cypher → data/afriea.db). BM25 full-text search via rank-bm25 and graph traversal via NetworkX for capability lookups and gap analysis.
  • Frontend: Next.js 14 static export, React 18, TypeScript, Tailwind CSS. Built with bpmn-js for diagram editing, Chart.js for radar visualizations, and a custom SSE client for streaming responses.
  • BPMN generation: Pure-Python deterministic engine (bpmn_generator.py) converts structured JSON into fully laid-out BPMN 2.0 XML with DI coordinates — no LLM call needed for diagram rendering.
  • Containerization: Multi-stage Dockerfile builds the Next.js frontend, then copies the static export into a Python runtime image. The entire platform runs as a single container on port 8082.

Challenges we ran into

  • Fitting a 3B-parameter model into 8 GB RAM: Required aggressive quantization (Q4_K_M) and careful memory budgeting across inference, SQLite, NetworkX, and the OS.
  • Streaming LLM responses over HTTP: Integrated Server-Sent Events through FastAPI while keeping the frontend responsive and cancelable.
  • Deterministic BPMN layout without a layout engine: Built a custom coordinate allocator with longest-path layer assignment, lane-aware grouping, and automatic shape sizing — all in pure Python under 100 ms.
  • Multilingual prompt reliability: The 3B model sometimes drifts from strict JSON schemas; added robust JSON extraction and a deterministic fallback process so the BPMN and assessment endpoints never fail.
  • Static export + client-only bpmn-js: bpmn-js references browser globals, so the React wrapper lazily imports the Modeler inside a useEffect to keep Next.js prerendering safe.
  • Single-container constraint: The frontend static export is mounted inside FastAPI via StaticFiles, keeping the deployment to one Docker container while still supporting hot-reload in local dev.

Accomplishments that we're proud of

  • Fully offline EA advisory — no cloud API calls, no telemetry, no analytics. Works on a flight mode laptop.
  • 44-domain assessment + roadmap pipeline — from natural-language chat to a phased strategic roadmap with African context, all generated on-device.
  • Deterministic BPMN 2.0 generation — produces valid, editable diagrams in under 100 ms without any LLM dependency.
  • Multilingual by design — prompts, UI labels, and process names localized across 12 African languages with RTL support.
  • Single-container deployment — the entire platform ships as one Docker image, reducing ops overhead for demo and pilot deployments.

What we learned

  • Quantized 3B models are surprisingly capable for structured advisory tasks when grounded in a high-quality local knowledge graph.
  • Deterministic fallbacks beat unreliable LLM outputs for schema-bound endpoints like BPMN generation.
  • BM25 + NetworkX on SQLite provides fast enough retrieval for on-device EA use cases without the overhead of a separate vector database.
  • Next.js static export can coexist with client-only libraries like bpmn-js if you lazy-load behind useEffect.

What's next for AfriEA Assistant

  • Model upgrade: Swap to Qwen2.5-7B or a purpose-finetuned EA model to improve reasoning depth.
  • Collaborative editing: Multi-user sessions with change tracking and export to Confluence/Jira.
  • Richer BPMN editor: Add simulation, validation, and import from Visio/Draw.io.
  • Voice interface: Speech-to-text and text-to-speech for low-literacy users in remote areas.
  • Sector templates: Pre-built assessment and BPMN templates for agriculture, health, and logistics verticals.

Built With

Share this project:

Updates

Submission history