Multi-Module Project
DUUMBI supports multi-module projects where each module has its own graph and can import functions from other modules.
Creating modules
Section titled “Creating modules”Start with a project:
duumbi init myappcd myappCreate a new module:
duumbi add "create a module called 'math_ops' with functions: abs(x: i64) -> i64, max(a: i64, b: i64) -> i64"This creates .duumbi/graph/math_ops.jsonld alongside your main.jsonld.
Module structure
Section titled “Module structure”Each module is a separate .jsonld file in .duumbi/graph/:
.duumbi/ graph/ main.jsonld # Entry point math_ops.jsonld # Your math module config.tomlCross-module calls
Section titled “Cross-module calls”Reference functions from other modules using their full ID:
duumbi add "modify main to call math_ops/abs(-7) and print the result"The AI generates a Call op with the cross-module reference duumbi:math_ops/abs.
Using stdlib modules
Section titled “Using stdlib modules”DUUMBI includes standard library modules, available as @duumbi/stdlib-math:
[dependencies]"@duumbi/stdlib-math" = "1.0"Install dependencies:
duumbi deps installUse stdlib functions in your program:
duumbi add "call stdlib-math/max(10, 20) and print the result"Building multi-module programs
Section titled “Building multi-module programs”duumbi build automatically compiles all modules and links them:
duumbi build./outputThe compiler resolves cross-module references following the priority chain:
- Workspace —
.duumbi/graph/(your own modules) - Vendor —
.duumbi/vendor/(pinned copies) - Cache —
.duumbi/cache/(downloaded from registry)
Dependency management
Section titled “Dependency management”# Add a dependencyduumbi deps add @duumbi/stdlib-math
# List dependenciesduumbi deps list
# Show dependency treeduumbi deps tree
# Audit lockfile integrityduumbi deps auditNext steps
Section titled “Next steps”- Use the intent system to generate entire multi-module programs from a description
- Learn about the module registry for publishing and sharing modules