{"id":31598195,"url":"https://github.com/nen-co/nen","last_synced_at":"2025-10-06T05:37:17.918Z","repository":{"id":313070774,"uuid":"1047617052","full_name":"Nen-Co/nen","owner":"Nen-Co","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-14T03:57:30.000Z","size":80916,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-14T05:45:18.913Z","etag":null,"topics":["ai-agents","ai-agents-framework","ai-framework","langchain"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nen-Co.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-30T20:24:42.000Z","updated_at":"2025-09-12T21:32:41.000Z","dependencies_parsed_at":"2025-09-03T19:51:56.207Z","dependency_job_id":null,"html_url":"https://github.com/Nen-Co/nen","commit_stats":null,"previous_names":["nen-co/nen"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Nen-Co/nen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nen-Co%2Fnen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nen-Co%2Fnen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nen-Co%2Fnen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nen-Co%2Fnen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nen-Co","download_url":"https://codeload.github.com/Nen-Co/nen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nen-Co%2Fnen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278562468,"owners_count":26007194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-agents-framework","ai-framework","langchain"],"created_at":"2025-10-06T05:37:15.548Z","updated_at":"2025-10-06T05:37:17.911Z","avatar_url":"https://github.com/Nen-Co.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Nen: Minimalist LLM Framework in Zig\n\n[![Zig Version](https://img.shields.io/badge/Zig-0.14.1+-orange.svg)](https://ziglang.org/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Build Status](https://img.shields.io/badge/Build-Passing-brightgreen.svg)](https://github.com/Nen-Co/nen)\n\n**Nen** is a minimalist LLM framework built in Zig following the Nen way: statically typed, zero-allocation, and using the Nen ecosystem for maximum performance: designed for production-scale AI workflows.\n\n## 🌟 Why Nen?\n\n### **Minimalist Design**\n- **Just ~300 lines** for the core framework (vs LangChain's 405K lines)\n- **Zero bloat, zero dependencies, zero vendor lock-in**\n- **Everything you love**: Agents, Workflows, RAG, and more\n\n### **Nen Way Performance**\n- **Statically typed**: Compile-time safety and optimization\n- **Zero-allocation**: Static memory pools for predictable performance\n- **Nen ecosystem**: Seamless integration with NenCache, NenDB, nen-io, nen-json\n- **Sub-microsecond latency**: High-performance node execution\n\n### **Production Ready**\n- **High throughput**: 1000+ flows per second\n- **Built-in caching**: NenCache integration for performance\n- **Monitoring**: Comprehensive metrics and observability\n- **Scalability**: Handle millions of AI workflows\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    Nen Core                                 │\n├─────────────────────────────────────────────────────────────┤\n│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────┐ │\n│  │   Agent     │ │    Tool     │ │    LLM      │ │Memory│ │\n│  │   Node      │ │   Node      │ │   Node      │ │ Node │ │\n│  └─────────────┘ └─────────────┘ └─────────────┘ └───────┘ │\n├─────────────────────────────────────────────────────────────┤\n│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────┐ │\n│  │  Workflow   │ │     RAG     │ │  Condition  │ │Parallel│ │\n│  │   Node      │ │   Node      │ │   Node      │ │ Node  │ │\n│  └─────────────┘ └─────────────┘ └─────────────┘ └───────┘ │\n└─────────────────────────────────────────────────────────────┘\n                              │\n                              ▼\n                    ┌─────────────────┐\n                    │   Nen Ecosystem │\n                    │   Integration   │\n                    │                 │\n                    │  ┌───────────┐  │\n                    │  │ NenCache  │  │\n                    │  │  Caching  │  │\n                    │  └───────────┘  │\n                    │                 │\n                    │  ┌───────────┐  │\n                    │  │  nen-io   │  │\n                    │  │  Batching │  │\n                    │  └───────────┘  │\n                    │                 │\n                    │  ┌───────────┐  │\n                    │  │ nen-json  │  │\n                    │  │Serialization│ │\n                    │  └───────────┘  │\n                    └─────────────────┘\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **Zig**: 0.14.1 or later\n- **Memory**: 4GB+ RAM (8GB+ recommended)\n- **Nen ecosystem**: NenCache, nen-io, nen-json\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/Nen-Co/nen.git\ncd nen\n\n# Build the project\nzig build\n\n# Run tests\nzig build test\n\n# Run examples\nzig build basic-example\nzig build agent-demo\nzig build rag-demo\nzig build workflow-demo\nzig build nen-demo\n```\n\n### Basic Usage\n\n```zig\nconst std = @import(\"std\");\nconst nen = @import(\"nen\");\n\npub fn main() !void {\n    const allocator = std.heap.page_allocator;\n    \n    // Create a simple agent flow\n    var flow = try nen.createAgentFlow(allocator, \"Assistant\", \n        \"You are a helpful AI assistant.\");\n    defer flow.deinit();\n    \n    // Execute the flow\n    try flow.execute();\n    \n    // Get execution statistics\n    const stats = flow.getStats();\n    std.debug.print(\"Success rate: {d:.1}%\\n\", .{stats.getSuccessRate() * 100.0});\n}\n```\n\n## 📚 Examples\n\n### 1. Basic Agent Flow\n**File**: `examples/basic_agent.zig`\n**Command**: `zig build basic-example`\n\nSimple agent creation and execution.\n\n### 2. RAG (Retrieval-Augmented Generation)\n**File**: `examples/rag_demo.zig`\n**Command**: `zig build rag-demo`\n\nComplete RAG workflow with query, retrieval, and generation.\n\n### 3. Multi-step Workflow\n**File**: `examples/workflow_demo.zig`\n**Command**: `zig build workflow-demo`\n\nComplex workflow orchestration with multiple steps.\n\n### 4. Comprehensive Demo\n**File**: `examples/nen_demo.zig`\n**Command**: `zig build nen-demo`\n\nFull showcase of all Nen capabilities.\n\n## 🔧 Core Concepts\n\n### Nodes\nThe building blocks of Nen workflows:\n\n- **Agent Node**: AI agents with instructions and tools\n- **Tool Node**: Function execution and API calls\n- **LLM Node**: Language model interactions\n- **Memory Node**: Data storage and retrieval\n- **Workflow Node**: Process orchestration\n- **RAG Node**: Retrieval-augmented generation\n- **Condition Node**: Conditional logic and branching\n- **Parallel Node**: Parallel execution\n- **Stream Node**: Streaming data processing\n\n### Flows\nWorkflow orchestration and execution:\n\n- **Dependency Management**: Automatic node ordering\n- **Execution Engine**: High-performance node execution\n- **Caching**: Built-in NenCache integration\n- **Monitoring**: Real-time metrics and observability\n- **Error Handling**: Graceful failure and recovery\n\n### Configuration\nFlexible node and flow configuration:\n\n- **Timeouts**: Configurable execution timeouts\n- **Retries**: Automatic retry mechanisms\n- **Parallelism**: Parallel execution support\n- **Caching**: Per-node cache configuration\n- **Memory**: Memory pool management\n\n## 📊 Performance Benchmarks\n\n### Framework Comparison\n| Framework | Lines of Code | Size | Performance |\n|-----------|---------------|------|-------------|\n| **Nen** | **~300** | **~56KB** | **1000+ flows/sec** |\n| LangChain | 405K | +166MB | ~100 flows/sec |\n| CrewAI | 18K | +173MB | ~200 flows/sec |\n| SmolAgent | 8K | +198MB | ~300 flows/sec |\n| LangGraph | 37K | +51MB | ~150 flows/sec |\n\n### Nen Performance\n- **Node Execution**: Sub-microsecond latency\n- **Flow Throughput**: 1000+ flows per second\n- **Memory Usage**: Zero-allocation static pools\n- **Cache Hit Rate**: 95%+ with NenCache integration\n- **Scalability**: Linear scaling with additional resources\n\n## 🌐 Nen Ecosystem Integration\n\n### NenCache Integration\n- **High-performance caching**: Sub-microsecond cache access\n- **Memory pools**: Static allocation for zero overhead\n- **Multi-tier storage**: GPU/CPU/NVMe/Disk optimization\n- **P2P sharing**: Distributed caching between instances\n\n### nen-io Integration\n- **I/O optimization**: Zero-allocation I/O patterns\n- **Batching**: Efficient memory and network operations\n- **Streaming**: High-performance data streaming\n- **Network operations**: Optimized network communication\n\n### nen-json Integration\n- **Zero-allocation serialization**: No dynamic memory allocation\n- **High-performance parsing**: SIMD-optimized JSON handling\n- **Static memory pools**: Predictable memory usage\n- **Type safety**: Compile-time JSON validation\n\n### NenDB Integration\n- **Graph database acceleration**: Cache graph queries\n- **LLM workload optimization**: Store embeddings and tokens\n- **Distributed caching**: P2P sharing between database instances\n- **High-throughput queries**: 100K+ queries per second\n\n## 🚀 Production Deployment\n\n### Quick Deployment\n```bash\n# Build optimized version\nzig build -Doptimize=ReleaseFast\n\n# Configure environment\nexport NEN_CACHE_ENABLED=true\nexport NEN_MEMORY_POOLS=2GB\n\n# Start service\n./zig-out/bin/nen serve\n```\n\n### Docker Deployment\n```dockerfile\nFROM ubuntu:22.04\nRUN apt-get update \u0026\u0026 apt-get install -y build-essential curl\nRUN curl -L https://ziglang.org/download/0.14.1/zig-linux-x86_64-0.14.1.tar.xz | tar -xJ -C /usr/local --strip-components=1\nCOPY . /app\nWORKDIR /app\nRUN zig build -Doptimize=ReleaseFast\nEXPOSE 8080\nCMD [\"./zig-out/bin/nen\", \"serve\"]\n```\n\n### Kubernetes Deployment\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nen\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nen\n  template:\n    metadata:\n      labels:\n        app: nen\n    spec:\n      containers:\n      - name: nen\n        image: nen:latest\n        ports:\n        - containerPort: 8080\n        resources:\n          requests:\n            memory: \"4Gi\"\n            cpu: \"2\"\n          limits:\n            memory: \"8Gi\"\n            cpu: \"4\"\n```\n\n## 📈 Use Cases\n\n### 1. AI Agent Development\n- **Conversational AI**: Chatbots and virtual assistants\n- **Task Automation**: Automated workflow execution\n- **Decision Support**: AI-powered decision making\n- **Content Generation**: Automated content creation\n\n### 2. RAG Applications\n- **Document Q\u0026A**: Intelligent document search and answers\n- **Knowledge Bases**: Corporate knowledge management\n- **Research Tools**: Academic and scientific research\n- **Customer Support**: Automated customer assistance\n\n### 3. Workflow Orchestration\n- **Business Processes**: Automated business workflows\n- **Data Pipelines**: ETL and data processing\n- **DevOps Automation**: CI/CD and deployment automation\n- **Quality Assurance**: Automated testing and validation\n\n### 4. High-Performance Applications\n- **Real-time Systems**: Low-latency AI applications\n- **High-throughput Processing**: Batch AI processing\n- **Edge Computing**: Resource-constrained environments\n- **Microservices**: AI-powered microservice architectures\n\n## 🔍 Monitoring and Observability\n\n### Built-in Metrics\n- **Performance**: Throughput, latency, success rate\n- **Memory**: Pool utilization, allocation patterns\n- **Caching**: Hit rate, cache efficiency\n- **Execution**: Node completion, failure rates\n\n### Monitoring Commands\n```bash\n# Check flow status\n./zig-out/bin/nen --show-stats\n./zig-out/bin/nen --show-memory\n./zig-out/bin/nen --show-ecosystem\n\n# Run performance tests\n./zig-out/bin/nen --benchmark\n./zig-out/bin/nen agent-demo\n./zig-out/bin/nen rag-demo\n```\n\n## 🛠️ Development\n\n### Building from Source\n```bash\n# Clone repository\ngit clone https://github.com/Nen-Co/nen.git\ncd nen\n\n# Install dependencies\n# (Nen ecosystem libraries are included as submodules)\n\n# Build project\nzig build\n\n# Run tests\nzig build test\n\n# Run specific examples\nzig build basic-example\nzig build agent-demo\nzig build rag-demo\nzig build workflow-demo\nzig build nen-demo\n```\n\n### Development Workflow\n```bash\n# Run all tests\nzig build test\n\n# Run performance benchmarks\nzig build perf-bench\n\n# Run specific integration tests\nzig build nen-test\nzig build agent-test\n\n# Check code quality\nzig build test --verbose\n```\n\n## 📚 Documentation\n\n- **[API Reference](docs/API.md)**: Complete API documentation\n- **[Architecture Guide](docs/ARCHITECTURE.md)**: System design and architecture\n- **[Performance Guide](docs/PERFORMANCE.md)**: Optimization and benchmarking\n- **[Deployment Guide](docs/DEPLOYMENT.md)**: Production deployment\n- **[Examples](examples/)**: Comprehensive examples and tutorials\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Areas\n- **Performance Optimization**: Improve throughput and reduce latency\n- **Node Types**: Add new node types and capabilities\n- **LLM Integration**: Add support for more LLM providers\n- **Monitoring**: Enhance observability and metrics\n- **Documentation**: Improve guides and examples\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **Zig Community**: For the amazing programming language\n- **Nen Ecosystem Contributors**: For building the foundation\n- **Pocket Flow Team**: For inspiring the minimalist approach\n- **Open Source Community**: For inspiration and collaboration\n\n## 📞 Support\n\n- **GitHub Issues**: [Report bugs and request features](https://github.com/Nen-Co/nen-flow/issues)\n- **Discussions**: [Join community discussions](https://github.com/Nen-Co/nen-flow/discussions)\n- **Documentation**: [Complete documentation](https://nen-co.github.io/docs)\n- **Community**: [Nen ecosystem community](https://github.com/Nen-Co)\n\n---\n\n**🚀 Ready to build the future of AI workflows? Get started with Nen today!**\n\nThe Nen ecosystem provides:\n- **Minimalist Design**: Just ~300 lines for the core framework\n- **Zero Allocation**: Static memory pools for predictable performance\n- **High Performance**: 1000+ flows per second with sub-microsecond latency\n- **Production Ready**: Comprehensive monitoring, caching, and deployment options\n- **Seamless Integration**: Works perfectly with NenCache, NenDB, nen-io, and nen-json\n\n**Build AI workflows that scale to infinity with confidence!** ✨\n\n---\n\n## 🌐 Nen Ecosystem Integration\n\n**Nen** is part of the larger Nen ecosystem, designed to work seamlessly with:\n\n- **[nen-db](https://github.com/Nen-Co/nen-db)**: High-performance graph database\n- **[nen-net](https://github.com/Nen-Co/nen-net)**: Zero-allocation networking\n- **[nen-io](https://github.com/Nen-Co/nen-io)**: High-performance I/O operations\n- **[nen-json](https://github.com/Nen-Co/nen-json)**: Fast JSON processing\n- **[nen-cli](https://github.com/Nen-Co/nen-cli)**: Unified command-line interface\n\nVisit our comprehensive documentation at [nen-co.github.io/docs](https://nen-co.github.io/docs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnen-co%2Fnen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnen-co%2Fnen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnen-co%2Fnen/lists"}