humanlayer  by humanlayer

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

created 1 year ago
1,015 stars

Top 37.5% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
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

1 week

Pull Requests (30d)
125
Issues (30d)
2
Star History
267 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Steven Hao Steven Hao(Cofounder of Cognition), and
6 more.

openai-agents-python by openai

1.5%
13k
Python SDK for multi-agent workflows
created 4 months ago
updated 1 day ago
Feedback? Help us improve.