humanlayer  by humanlayer

SDK for human-in-the-loop AI agent workflows

Created 1 year ago
9,468 stars

Top 5.4% on SourcePulse

GitHubView on GitHub
Project Summary

HumanLayer provides an API and SDK for integrating human oversight into AI agent workflows, specifically for high-stakes function calls. It targets developers building agentic systems who need to ensure safety and reliability when AI agents interact with the real world, offering a mechanism for human approval and feedback.

How It Works

HumanLayer operates by instrumenting function calls within AI agent frameworks. It uses decorators like @hl.require_approval() to intercept calls to sensitive functions, routing them for human review via channels like Slack or email. Alternatively, hl.human_as_tool() allows agents to proactively solicit human input or feedback during execution. This approach deterministically guarantees human involvement, mitigating risks associated with LLM hallucinations or errors in critical operations.

Quick Start & Requirements

  • Install via pip: pip install humanlayer
  • Install via npm: npm install humanlayer
  • Supports Python and TypeScript/JavaScript.
  • Integrates with LLMs (OpenAI, Llama, Claude) and frameworks (LangChain, CrewAI, ControlFlow).
  • Examples available for LangChain, CrewAI, ControlFlow, and raw OpenAI client.
  • Official Docs: https://humanlayer.dev/docs/quickstart-python
  • Discord: https://humanlayer.dev/discord

Highlighted Details

  • @hl.require_approval() decorator for blocking function calls until human approval.
  • hl.human_as_tool() for general human interaction within agent workflows.
  • Omni-channel support for human contact (Slack, Email, Discord planned).
  • Granular routing of approvals to specific teams or individuals.
  • Framework-agnostic design, compatible with any LLM and tool-calling framework.

Maintenance & Community

  • Active development with a roadmap indicating planned features like SMS/RCS approvals and LlamaIndex support.
  • Open-source contributions are welcomed.
  • Community support available via Discord.

Licensing & Compatibility

  • Licensed under the Apache 2.0 License.
  • Permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

Some integrations, like GripTape and Controlflow, are currently in Alpha status. Features such as SMS/RCS approvals, Discord approvals, and composite contact channels are still in the planning stages.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
11
Star History
563 stars in the last 30 days

Explore Similar Projects

Starred by Edward Z. Yang Edward Z. Yang(Research Engineer at Meta; Maintainer of PyTorch), Anton Osika Anton Osika(Cofounder of Lovable), and
3 more.

gptme by gptme

0.2%
4k
CLI tool for terminal agent workflows
Created 2 years ago
Updated 15 hours ago
Feedback? Help us improve.