Significant-Gravitas/AutoGPT · error · NotFoundError

Library agent #{library_agent_id} not found

Error message

Library agent #{library_agent_id} not found

What it means

Error "Library agent #{library_agent_id} not found" thrown in Significant-Gravitas/AutoGPT.

Source

Thrown at autogpt_platform/backend/backend/api/features/library/db.py:1026

    if n_updated < 1:
        raise NotFoundError(f"Library agent {library_agent_id} not found")

    return await get_library_agent(
        id=library_agent_id,
        user_id=user_id,
    )


async def delete_library_agent(
    library_agent_id: str, user_id: str, soft_delete: bool = True
) -> None:
    # First get the agent to find the graph_id for cleanup
    library_agent = await prisma.models.LibraryAgent.prisma().find_unique(
        where={"id": library_agent_id}, include={"AgentGraph": True}
    )

    if not library_agent or library_agent.userId != user_id:
        raise NotFoundError(f"Library agent #{library_agent_id} not found")

    graph_id = library_agent.agentGraphId

    # Clean up everything that drives this agent BEFORE deleting it, so
    # nothing keeps firing against a half-deleted agent (schedules, webhooks,
    # and the trigger agents that exist solely to run it).
    await _cleanup_schedules_for_graph(graph_id=graph_id, user_id=user_id)
    await _cleanup_webhooks_for_graph(graph_id=graph_id, user_id=user_id)
    # A trigger agent is a hidden agent whose graph runs this (action) agent
    # via an AgentExecutorBlock; once the action agent is gone it has no
    # purpose and is never shown on its own, so it must be cleaned up too.
    # Skip when deleting a hidden agent — triggers don't have triggers, which
    # also bounds the recursion at one level.
    if not library_agent.isHidden:
        await _cleanup_trigger_agents_for_graph(
            action_graph_id=graph_id, user_id=user_id, soft_delete=soft_delete
        )

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Confirm the library agent ID exists and is accessible to your account.
  2. Refresh the library list and retry.

When it happens

Trigger: Thrown at autogpt_platform/backend/backend/api/features/library/db.py:1026 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/135bda0b470b130e. Report an issue: GitHub.