Skip to content

tridz-dev/huf

Repository files navigation

HUF

Open-source AI infrastructure for any app. Build multi-agent solutions, automate AI driven deterministic workflows, and keep your data under your control.

HUF is a complete, self-hosted AI layer built on open standards. It gives teams everything needed to create intelligent multi-agent solutions, ground them in real data, implement complex learning systems and orchestrate complex workflows, without sending data to third-party platforms or rebuilding infrastructure from scratch.

Documentation | Report Issue | Discussions


HUF Dashboard

Note: HUF is under active development.


Why HUF

AI adoption inside organizations is fragmented:

  • Knowledge lives in too many places — scattered across docs, databases, and people's heads
  • Automation is rigid and rule-based — breaks on edge cases, requires constant maintenance
  • AI tools operate in isolation — each team rebuilds similar assistants
  • Data flows outside your control — sent to cloud APIs you don't govern

HUF exists to centralize intelligence and execution into a single, self-hosted engine — so AI can be trusted to operate inside real business systems without compromising data ownership.

Key principles:

  • Open source and self-hosted. Your agents, your data, your infrastructure. Nothing leaves your servers unless you decide it should.
  • Local model support. Connect to Ollama, LM Studio, or any OpenAI-compatible local endpoint. Full AI capability without cloud dependency.
  • No-code for most use cases. Agents, knowledge sources, triggers, and flows are configured through a visual interface. Code is optional, not required.
  • Data governance built in. Role-based permissions, full audit trails, and cost controls give teams and leadership visibility without slowing anyone down.

What HUF Does

HUF is the core AI layer inside an organization or product, not a surface-level chatbot or a single-purpose assistant.

One engine. Multiple ways to use it.

Capability What it enables
Universal AI Access Connect to virtually every major provider or run models locally — all through one interface
Intelligent Tools Give AI the ability to read, write, and act on your business data
Knowledge Grounding RAG-powered context from your existing data, docs, files, URLs, and custom tables
Event-Driven Execution Trigger agents on document events, schedules, or webhooks
Visual Flow Builder Design complex automations with drag-and-drop flows, router nodes, and human approval gates
Integration Layer Connect agents to external services (Gmail, Slack, GitHub, and more) through managed credentials
Full Auditability Every run, every tool call, every token — logged and traceable
Cost Control Track usage and spending across models and teams

Use HUF As

AI Infrastructure for Products

Use HUF as the backend AI engine for products that need intelligence, automation, and integration.

Ideal for:

  • AI-first startups building on Frappe/ERPNext
  • SaaS products adding AI capabilities
  • Platforms that need agent orchestration, cost control, and auditability

HUF handles reasoning, knowledge, tool execution, and governance — so product teams can focus on user experience.


Internal Intelligence Platform

Use HUF to power internal AI experiences grounded in company knowledge.

Build:

  • Internal chat systems that know your business
  • Role-based assistants for Ops, HR, Sales, Support
  • Knowledge discovery and employee onboarding tools

Replace disconnected internal AI tools with a single, governed intelligence layer.


Automation and Orchestration Engine

Use HUF to build AI-driven workflows that reason and act across systems.

Suited for:

  • Multi-step processes that span departments
  • Cross-tool automation with conditional logic
  • Intelligent approvals, routing, and escalations

Unlike traditional automation, HUF adapts to context instead of breaking on edge cases.


Embedded AI Layer for SaaS

Use HUF to embed AI directly into products without building custom infrastructure.

Enable:

  • In-app copilots and assistants
  • Customer-facing AI features
  • Vertical AI capabilities with clear permission boundaries

HUF provides a shared AI backend with cost, behavior, and access controls built in.


Enterprise AI Control Plane

Use HUF as a governed control layer for AI across the organization.

Critical for:

  • Cost management and budget allocation
  • Auditability and compliance requirements
  • Tool and model governance
  • Responsible AI deployment at scale

Give leadership visibility and control without slowing down teams.


Core Capabilities

Agent System

Create AI agents with custom instructions, connect them to any LLM, and equip them with tools to take action:

  • CRUD Operations — Read, create, update, delete any Frappe document
  • Custom Functions — Connect any Python function as a tool
  • HTTP Requests — Call external APIs and services
  • Agent Chaining — Agents can trigger other agents with async message-passing
  • MCP Integration — Connect to external tool providers (Gmail, GitHub, Slack, etc.)
  • Role-Based Permissions — Granular access control per agent and user
  • Prompt Caching — Reduce latency and cost with configurable runtime caching

Knowledge Management

Ground AI responses in real business knowledge. Agents can query your existing Frappe data by default via CRUD tools. For richer semantic or full-text search, build dedicated knowledge sources:

  • Input Types — Files, raw text, URLs, custom Data Tables
  • Existing Data — All Frappe DocType data is accessible to agents out of the box
  • Automatic Chunking — Intelligent text segmentation
  • Multiple Backends — BM25 full-text search (SQLite FTS5), semantic vector search (ChromaDB), PostgreSQL vector search (pgvector, coming soon)
  • Flexible Injection — Mandatory context or on-demand search

Data Tables

Create and manage custom structured data directly inside HUF, no external database required:

  • Visual Editor — Build and populate tables through the UI
  • Agent-Accessible — Use as knowledge input or tool data source
  • No Schema Migrations — Dynamic columns, managed by HUF

Trigger System

Run agents automatically based on events:

  • Document Eventsafter_insert, on_submit, on_cancel, and more
  • Schedules — Hourly, daily, weekly, monthly, yearly intervals
  • Webhooks — HTTP endpoints with authentication
  • Conditional Logic — Python expressions to control execution

Visual Flow Builder

Design complex workflows through a modern React-based interface. No code required for most flows:

  • Drag-and-Drop Canvas — Build flows visually
  • Node Types — Triggers, agents, HTTP actions, router/orchestrator, condition, utility
  • Human-in-the-Loop — Approval gates that pause execution until a human approves or rejects
  • Real-Time Editing — See changes instantly
  • App Integrations — Gmail, Calendar, Slack, Notion, HubSpot, and more via Integration Layer

Integration Layer

Manage credentials and connections to external services in one place:

  • Integration Services — Register third-party services with metadata and tool categories
  • Managed Credentials — Secure per-service credential storage
  • Integration Recipients — Route notifications and actions to specific users or addresses
  • Tool Sync — Automatically surface integration tools inside agents and flows

Models and Providers

Connect to virtually every major AI provider, or run models entirely on your own hardware:

  • Cloud Providers — OpenAI, Anthropic, Google, Mistral, Groq, and hundreds more
  • Local Models — Ollama, LM Studio, and any OpenAI-compatible local endpoint
  • Models Page — Browse, create, and configure models independently from providers
  • Provider Credentials — Secure API key storage per provider

Observability

Full visibility into what your AI is doing:

  • Agent Runs — Status, prompt, response, token usage, cost
  • Conversations — Complete chat history with context
  • Tool Calls — Every tool invocation with arguments and results
  • Feedback System — Capture user ratings for quality improvement
  • Configurable Detail Level — Show or hide tool execution details per agent

Coming Soon

These capabilities are in final development and will ship soon:

Capability What it enables
Knowledge and Memory Persistent agent memory and learning from past conversations
File-Based Agent Declaration Define agents in code using declarative config files, for teams building Frappe apps on top of HUF
Frappe Tools Deep integration with Frappe/ERPNext — reports, forms, workflows, and data as native agent tools
Fully Agentic UI An AI-native interface where the UI itself is driven by and responds to agent actions
pgvector Backend PostgreSQL-native vector search for teams already running Postgres

Quick Start

Try with Docker

git clone https://github.com/tridz-dev/huf.git
cd huf/docker
docker compose up

Open http://localhost:8000 and login:

  • User: Administrator
  • Password: admin

Install on Existing Bench

bench get-app git@github.com:tridz-dev/huf.git
bench install-app huf
bench setup requirements
bench restart

Architecture at a Glance

┌─────────────────────────────────────────────────────────────────┐
│                         HUF Engine                              │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────┐        │
│  │   Agents     │  │  Knowledge   │  │   Triggers     │        │
│  │              │  │              │  │                │        │
│  │ Instructions │  │ FTS5/Chroma  │  │ Events         │        │
│  │ Tools        │  │ Chunking     │  │ Schedules      │        │
│  │ Parameters   │  │ Retrieval    │  │ Webhooks       │        │
│  └──────┬───────┘  └──────┬───────┘  └──────┬─────────┘        │
│         │                 │                 │                  │
│         └────────────────┬┴─────────────────┘                  │
│                          │                                     │
│  ┌───────────────────────▼───────────────────────────────────┐ │
│  │                   Execution Layer                         │ │
│  │                                                           │ │
│  │  LiteLLM (cloud + local) | Tool System | MCP Client       │ │
│  │  Prompt Caching | Role Permissions | Integrations         │ │
│  └───────────────────────────────────────────────────────────┘ │
│                                                                 │
│  ┌────────────────────────────────────────────────────────────┐ │
│  │                   Observability                            │ │
│  │                                                            │ │
│  │  Runs | Conversations | Messages | Tool Calls | Costs      │ │
│  └────────────────────────────────────────────────────────────┘ │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        ▼                     ▼                     ▼
   ┌─────────┐          ┌─────────┐          ┌───────────────┐
   │  Chat   │          │  API    │          │     Flows     │
   │   UI    │          │ Endpoint│          │    Builder    │
   └─────────┘          └─────────┘          └───────────────┘

Tech Stack

Layer Technology
Backend Frappe Framework, Python 3.10+
AI Integration LiteLLM (cloud providers + local models)
Knowledge SQLite FTS5 (BM25) + ChromaDB (vector) + pgvector (coming soon)
Frontend React 18, TypeScript, Tailwind CSS
Flow Builder React Flow / XYFlow
Database MariaDB

Security Notice

HUF uses LiteLLM as a dependency for AI provider routing. On March 24, 2026, the LiteLLM team disclosed that PyPI releases 1.82.7 and 1.82.8 were compromised — both contained a malicious .pth startup payload injected into the package.

HUF was affected as a downstream consumer. We responded immediately:

  • Blocked both compromised versions in our dependency constraints (litellm>=1.0.0,!=1.82.7,!=1.82.8)
  • Added install-time detection in huf/install.py — if a compromised version is already present in your environment, HUF will surface a critical alert on startup

If you are running either of those LiteLLM versions, upgrade immediately.

Upstream incident thread: BerriAI/litellm#24518


Documentation

  • Full Documentation — Guides, tutorials, and API reference
  • Bruno API Collection — Ready-to-use API collection for testing and exploration
  • AGENTS.md — Technical context for AI agents. Adopts the agents.md standard.
  • CLAUDE.md — Defines coding standards, review criteria, and project-specific rules. Claude reads this file during runs and follows your conventions.

License

MIT License — see LICENSE for details.


Built for teams who want AI that actually works.

About

Open-source, self-hosted multi-agent AI infrastructure for teams and apps with support for cloud and local models, tool integrations, workflows, and automation across business systems including Slack, ERPNext, Discord & Gmail.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors