Drop in the SDK and start building. Clean APIs that fit right into your stack, whether you're using Python, TypeScript, or rolling your own client.
from langchain.agents import AgentType, initialize_agent
from langchain.tools import tool
from langchain_openai import ChatOpenAI
from humanlayer.core.approval import ApprovalMethod, HumanLayer
hl = HumanLayer(api_key="sk-example-key", verbose=True)
# add can be called without approval
@tool
def add(x: int, y: int) -> int:
"""Add two numbers together."""
return x + y
# but multiply must be approved by a human
@tool
@hl.require_approval()
def multiply(x: int, y: int) -> int:
"""multiply two numbers"""
return x * y
tools = [add.as_tool(), multiply.as_tool()]
llm = ChatOpe...
"Inversion of the AI agent model — long-running processes that pause for human direction when necessary ... The demo Dex of @humanlayer_dev did at @AITinkerers in SF last week really stuck with me."
This is awesome! Can't wait to integrate this with OpenFunnel Agents
This is awesome! So instead of RLHF for Gen 1 (system 1), HumanLayer (YC F24) is analogous to "RLHF for Gen 2 (system 2)"
Ever since I got hands-on with HumanLayer, I'm asking my whole team to think more about Agentic AI workflows - I used to think agents were not worth the effort to get them to production-grade reliability, but now I'm stoked on what is possible when you bring humans into the loop
Thanks for making sure the AI Agents don't go Agent Smith on us
Everyone needs to check out humanlayer... dope software
Hot take: If you're serious about AI you don't want someone making the "hard AI parts go away" You want someone making the NON CORE PARTS go away so ALL YOU DO is work on the hard parts. This is why I'm excited to try @humanlayer_dev
Really enjoying playing with @humanlayer_dev - instead of the manual outreach grind, I just hang out in slack and give the agent feedback as it finds new leads. Pretty darn cool @dexhorthy
@hl.require_approval()decorator blocks specific function calls until a human has been consulted - upon denial, feedback will be passed to the LLM.
hl.human_as_tool()allows for contacting a human for answers, advice, or feedback.
Get running with SDK in 5 minutes
Guarantee human oversight of key function calls
On denial, feedback added to agent context window
Add a variety of human contact channels to your agent toolchain
Create asynchronous, outer-loop agent workflows
Invert the flow of control, from human-initiated to agent-initiated
Pre-fill response prompts for seamless human-agent interactions
Route to specific individuals or teams, and control which users can approve or respond to LLM requests
from humanlayer import HumanLayer
hl = HumanLayer()
@hl.require_approval()
def send_email(to: str, subject: str, body: str):
"""Send an email to the customer"""
...
def run_llm_task(prompt, tools, llm="gpt-4"):
"""Your custom LLM task implementation"""
...
run_llm_task(
prompt="Send an email welcoming the user to
the platform and encouraging them to...",
tools=[send_email],
llm="gpt-4o"
)
Free forever for Hackers and Tinkerers
Can’t find the answer you’re looking for? Please chat with our team
An active user is any user that is registered to approve or respond to agents.
Learning and Auto Approvals allow you to set a threshold for automatically approving or denying requests based on past human interactions.
Escalations and Timeouts allow you to coordinate approvals across multiple teams and individuals with escalations and timeouts. Supports Promise.race() and Promise.all() semantics.
With HumanLayer, you can take the live feedback from your Human SMEs and periodically export it to one or more high-fidelity labeled datasets to power either fine-tuning, evals, or both.
Let's chat! - grab some time using one of the links above