Afunana
Afunana Documentation

Product Overview

What Afunana is, what it produces, who uses it, and how it fits together.

← All docs

Afunana is an on-premise legacy-system intelligence platform. It reads the source code that actually runs the business — COBOL, RPG, CL, DDS, SQL, and PL/SQL — and reconstructs the knowledge buried inside it: the business rules, the data, and the dependencies. The result is documentation a business can read, a developer can navigate, and an auditor can trust.

Its differentiator is that it doesn't just explain code shown to it. Afunana maintains a persistent, queryable knowledge graph of how every part of a system connects to every other part — program calls program, program uses file, file has field — kept current as the code changes. That graph is the foundation for business-level documentation, an AI assistant that cites the exact source line behind every answer, a silent-failure detection layer, and a change-planning workflow that can write an approved fix back to the live system in the codebase's own style.

"The enterprise's DNA, made readable."

Production instance: https://afunana.io

The problem it solves

Most IBM i, mainframe, and Oracle shops run applications that are 20 to 40 years old. The people who wrote them are retiring. The documentation, if it ever existed, is out of date. And the knowledge of why the code does what it does lives in a handful of experts — and walks out the door when they leave.

That knowledge gap makes everything expensive and risky: every change might break something nobody understands, every audit takes weeks of manual code reading, and every modernization project stalls because no one can say what the system actually does.

Afunana closes that gap. It extracts the source, maps its structure, and produces a layer of understanding on top of code that previously only a few people could read.

The platforms it works with

Afunana is multi-platform. The same knowledge-graph approach applies across the enterprise systems that run core operations:

Platform / source Languages Status
IBM i (AS/400) COBOL, RPG, CL, DDS Supported, end-to-end
Oracle PL/SQL packages & procedures, Oracle data dictionary Supported — extracted into the same knowledge graph, with PL/SQL-aware documentation, quality checks, and flow
SQL Plain SQL — scripts, procedures, queries Supported — documented and cross-referenced alongside the programs and data it touches
IBM z/OS (mainframe) COBOL Architected for; analysis support is on the near-term roadmap

IBM i is used as the primary worked example throughout this documentation and in every screenshot — that is simply what the screenshots show. The same extraction, documentation, silent-failure checks, and search apply to Oracle and plain SQL. z/OS mainframe reuses the same foundation and is the next platform to land.

The four phases

Afunana follows a simple arc, and after the first pass it stays current on its own.

  1. Understand. Read the source and produce multi-level documentation, visual maps (call trees, data-flow, sequence, and logic diagrams, ERDs, field lineage), a data dictionary and cross-reference, and a citation-backed chat assistant.
  2. Plan. Generate structured, validated modification plans grounded in the live codebase — what to change, in what order, and what it will impact.
  3. Execute (optional, human-approved). Write the approved change back to the live system, in the codebase's own coding style, through an approval-gated workflow. Available as an option — the default posture is to stop at the plan and hand off to a developer.
  4. Refresh. As code changes, an incremental delta rebuild re-analyzes only the programs that actually changed, so the documentation never goes stale.

What it produces

Output Description
Program documentation Every program documented at three levels — business specification, systems analysis, and program specification — generated from the actual source, leading with business meaning.
File & table documentation Every physical, logical, display, and printer file (and every Oracle table) documented with field-level meaning, keys, access paths, and the programs that touch it.
AI chat assistant Ask questions in plain language and get answers grounded in the code — every claim cited to a PROGRAM:LINE reference you can click through to the exact source line. A mode toggle switches between Ask (cited question-and-answer) and Plan (draft a validated change plan from the conversation), with an Agent mode shown in the interface as coming soon.
Silent-failure findings Deterministic checks that flag the costliest, best-hidden defects — cross-program parameter mismatches, data-truncating moves, unhandled I/O status, unsafe control flow — the ones that produce no error message.
System overview A narrative map of the whole application: subsystems, batch flows, online transactions, data stores, and risk areas.
Cross-reference, lineage & data dictionary Which programs use which files, where a field is defined, how data flows across program boundaries, and a unified catalog of every field and table with business descriptions.
Change plans Validated, step-by-step modification plans with a full impact analysis and compile order — optionally executed back to the live system under human approval.

The "why" layer

What separates Afunana from a comment generator is that it documents intent, not just mechanics. For every program it surfaces:

The documentation leads with business meaning. "Screens policies for cancellation eligibility," rather than "reads file GVBITULP." That is the difference between documentation a developer skims and documentation a business analyst can rely on.

What makes it different

How people use it

Role Value
IT management Visibility into legacy systems, risk assessment, resource planning
Business analysts Understand system behavior without reading COBOL, RPG, or PL/SQL
Developers Navigate unfamiliar codebases, trace dependencies, plan and make changes safely
QA engineers Identify test-coverage gaps, trace data flows, validate logic
Auditors Access structured documentation and review the audit trail
Modernization teams Map dependencies and business rules before migration

How it fits together

Afunana runs as a self-contained set of Docker (or Podman) containers, installed on the customer's own infrastructure with a single command. It connects to the source platform to extract source, maps and analyzes it through the AI pipeline, and serves everything through a web application, a REST API, an MCP endpoint for AI tools, and a VS Code extension.

Nothing leaves the customer's environment except the LLM calls, and those route through whichever provider the customer configures. The default per-role chain is Anthropic as primary with an OpenAI fallback; Azure OpenAI (with its own endpoint and key) and a local Ollama model are also supported. Configuring Ollama keeps every call on-network for air-gapped sites, and the embedding model runs locally by default — embeddings never leave the box. The database can be the bundled SQL Server container or a customer-supplied external SQL Server, and TLS can terminate at the built-in Caddy proxy or at a customer-managed reverse proxy (nginx, F5, HAProxy).

Technology at a glance

Deployment model

Afunana runs on-premise via Docker or Podman. A single command installs everything.

Supported operating systems: RHEL, AlmaLinux, Rocky Linux, Ubuntu, and Debian. The bundled path brings up SQL Server and a Caddy proxy; enterprise deployments can bring their own external SQL Server, reverse proxy, and image registry, or install fully offline from a tar bundle for air-gapped sites. All data stays on your infrastructure — there is no SaaS component and no data-exfiltration risk.

Where to go next