donaldfilimon/abi
ABI Agent + WDBX Database: A lightning-fast, fully optimized AI and ML training stack written in Zig 0.16.0-dev for unmatched performance and reliabil...
Modern, modular Zig framework for AI/ML experiments and production workloads
Abi is an experimental framework that provides a curated set of feature modules for building high-performance AI/ML applications in Zig. It emphasizes:
Feature | Description | Status |
---|---|---|
AI/ML | Agent system, neural networks, transformers, RL | β Production |
Vector Database | High-performance vector storage and retrieval | β Production |
GPU Acceleration | Multi-backend GPU compute (CUDA, Vulkan, Metal) | π In Progress |
Web Server | HTTP server and client | β Production |
Monitoring | Metrics, logging, and distributed tracing | β Production |
Plugin System | Dynamic plugin loading and management | π In Progress |
0.16.0-dev.254+6dd0270a1
or latergit clone https://github.com/donaldfilimon/abi.git
cd abi
zig build
const std = @import("std");
const abi = @import("abi");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize the framework
var framework = try abi.init(allocator, .{});
defer abi.shutdown(&framework);
// Create an AI agent
const Agent = abi.ai.agent.Agent;
var agent = try Agent.init(allocator, .{ .name = "Assistant" });
defer agent.deinit();
// Process a query
const response = try agent.process("Hello, world!", allocator);
defer allocator.free(@constCast(response));
std.debug.print("Agent response: {s}\n", .{response});
}
# Build with specific features
zig build -Denable-ai=true -Denable-gpu=true -Dgpu-cuda=true
# Build and run tests
zig build test # Unit tests
zig build test-integration # Integration tests
zig build test-all # All tests
# Build examples
zig build examples # All examples
zig build run-ai_demo # Run specific example
# Build benchmarks
zig build bench
zig build run-bench
# Generate documentation
zig build docs
zig build docs-auto
βββββββββββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β (CLI, User Code, Tools) β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββ
β
βββββββββββββββββββββΌββββββββββββββββββββββββββ
β Framework Layer β
β Runtime Β· Features Β· Plugins β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββ
β
βββββββββββββββββββββΌββββββββββββββββββββββββββ
β Core Infrastructure β
β I/O Β· Errors Β· Diagnostics Β· Types β
βββββββββββββββββββββββββββββββββββββββββββββββ
lib/
βββ core/ # Core infrastructure
β βββ io.zig # I/O abstractions
β βββ errors.zig # Error definitions
β βββ diagnostics.zig # Diagnostics system
β βββ ...
βββ features/ # Feature modules
β βββ ai/ # AI/ML capabilities
β βββ database/ # Vector database
β βββ gpu/ # GPU acceleration
β βββ ...
βββ framework/ # Framework runtime
βββ runtime.zig # Lifecycle management
βββ ...
The Abi CLI provides comprehensive access to all framework features:
# Show help
./zig-out/bin/abi --help
# Feature management
./zig-out/bin/abi features list
./zig-out/bin/abi features status
# AI operations
./zig-out/bin/abi agent run --name "MyAgent"
./zig-out/bin/abi agent list
# Database operations
./zig-out/bin/abi db create --name vectors
./zig-out/bin/abi db query --vector "..."
# GPU benchmarks
./zig-out/bin/abi gpu bench
./zig-out/bin/abi gpu info
# Version information
./zig-out/bin/abi version
# Unit tests
zig build test
# Integration tests
zig build test-integration
# All tests
zig build test-all
# With coverage
zig build test -- --coverage
tests/
βββ unit/ # Unit tests (mirrors lib/)
βββ integration/ # Integration tests
β βββ ai_pipeline_test.zig
β βββ database_ops_test.zig
β βββ framework_lifecycle_test.zig
βββ fixtures/ # Test utilities
const std = @import("std");
const abi = @import("abi");
const testing = std.testing;
test "AI agent processes input correctly" {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
var framework = try abi.init(allocator, .{});
defer abi.shutdown(&framework);
const Agent = abi.ai.agent.Agent;
var agent = try Agent.init(allocator, .{ .name = "Test" });
defer agent.deinit();
const response = try agent.process("test", allocator);
defer allocator.free(@constCast(response));
try testing.expect(response.len > 0);
}
const abi = @import("abi");
var agent = try abi.ai.agent.Agent.init(allocator, .{
.name = "Assistant",
.max_retries = 3,
});
defer agent.deinit();
const response = try agent.process("Explain quantum computing", allocator);
defer allocator.free(@constCast(response));
const db = abi.database;
var vector_db = try db.VectorDB.init(allocator, .{
.dimension = 128,
.metric = .cosine,
});
defer vector_db.deinit();
try vector_db.insert("doc1", embedding);
const results = try vector_db.search(query, 10);
const gpu = abi.gpu;
var backend = try gpu.selectBackend(allocator);
defer backend.deinit();
const kernel = try gpu.loadKernel("matrix_mul");
try backend.execute(kernel, .{ .a = a, .b = b, .result = result });
We welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone https://github.com/donaldfilimon/abi.git
cd abi
# Run tests
zig build test-all
# Format code
zig fmt .
# Build all examples
zig build examples
Modular build system
I/O abstraction layer
Comprehensive error handling
Improved testing infrastructure
Complete GPU backend implementations
Advanced monitoring and tracing
Plugin system v2
Performance optimizations
Distributed computing support
Advanced ML model formats
Production deployment guides
Cloud provider integrations
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using Zig 0.16
Last Updated: October 8, 2025