Skip to main content
Glama

LoopIn

AI 에이전트를 위한 Human-in-the-loop 인터럽트 API.

LoopIn을 사용하면 AI 에이전트가 중요한 결정 지점에서 일시 중지하고, 사람의 검토를 요청하며, 사람의 결정에 따라 실행을 재개할 수 있습니다. 더 이상 에이전트가 혼자서 고위험 결정을 내리지 않아도 됩니다.


왜 LoopIn인가요?

자율 에이전트는 강력하지만, 사람 없이 내려서는 안 될 결정에 직면할 때가 있습니다. LoopIn은 모든 에이전트에게 안전한 탈출구를 제공합니다:

  1. 에이전트가 결정 지점에 도달 → POST /interrupts 호출

  2. LoopIn이 사람에게 알림 → 웹훅 또는 직접 검토 URL을 통해

  3. 사람이 승인 또는 거부 → 검토 페이지 또는 POST /interrupts/:id/decide를 통해

  4. 에이전트가 결정 확인을 위해 폴링 → GET /interrupts/:id

  5. 에이전트가 재개 → 결정(및 사람이 제공한 수정된 매개변수)을 사용하여 실행


Related MCP server: turn-mcp-web

엔드포인트

POST /interrupts

새로운 인터럽트 요청을 생성합니다.

요청:

{
  "agentId": "agent-payments-v2",
  "userId": "user-123",
  "action": "Transfer $4,200 to vendor account ending in 9821",
  "context": {
    "vendor": "Acme Supplies",
    "amount": 4200,
    "currency": "USD",
    "invoiceId": "INV-2024-0892",
    "accountLast4": "9821"
  },
  "urgency": "high",
  "expiresIn": 1800,
  "callbackUrl": "https://my-agent.example.com/webhooks/loopin"
}

응답:

{
  "interruptId": "3f4e2a1b-...",
  "status": "pending",
  "expiresAt": "2024-04-12T14:30:00Z",
  "reviewUrl": "http://localhost:3002/review/3f4e2a1b-..."
}

GET /interrupts/:interruptId

현재 상태와 결정을 확인하기 위해 폴링합니다.

응답 (대기 중):

{
  "interruptId": "3f4e2a1b-...",
  "status": "pending",
  "action": "Transfer $4,200 to vendor account ending in 9821",
  "context": { ... },
  "urgency": "high",
  "createdAt": "2024-04-12T13:00:00Z",
  "expiresAt": "2024-04-12T14:30:00Z",
  "reviewUrl": "http://localhost:3002/review/3f4e2a1b-..."
}

응답 (해결됨):

{
  "interruptId": "3f4e2a1b-...",
  "status": "approved",
  "decision": "approved",
  "decidedAt": "2024-04-12T13:07:22Z",
  "reason": "Invoice verified, proceed."
}

POST /interrupts/:interruptId/decide

사람의 결정을 제출합니다.

요청:

{
  "decision": "approved",
  "reason": "Invoice verified, proceed.",
  "modifiedParams": { "amount": 4200 }
}

응답:

{
  "interruptId": "3f4e2a1b-...",
  "status": "resolved",
  "decision": "approved",
  "decidedAt": "2024-04-12T13:07:22Z"
}

GET /interrupts/pending/:userId

사용자의 검토를 기다리는 모든 대기 중인 인터럽트 목록을 가져옵니다.

응답:

[
  {
    "interruptId": "3f4e2a1b-...",
    "action": "Transfer $4,200 to vendor...",
    "urgency": "high",
    "createdAt": "...",
    "expiresAt": "...",
    "reviewUrl": "..."
  }
]

DELETE /interrupts/:interruptId

대기 중인 인터럽트를 취소합니다(에이전트가 더 이상 결정이 필요하지 않은 경우).


GET /analytics/:userId

사용 통계.

응답:

{
  "userId": "user-123",
  "totalInterrupts": 47,
  "approvalRate": 0.83,
  "avgResponseTimeMs": 142000,
  "byStatus": { "approved": 39, "rejected": 8 },
  "byUrgency": { "high": 12, "medium": 28, "low": 7 },
  "topActionTypes": [
    { "action": "Send payment", "count": 18 },
    { "action": "Delete records", "count": 9 }
  ]
}

검토 페이지

모든 인터럽트는 사람이 읽을 수 있는 검토 URL을 가집니다:

GET /review/:interruptId

이 페이지는 다음을 보여주는 HTML을 렌더링합니다:

  • 에이전트가 수행하려는 작업

  • 모든 컨텍스트 데이터 (포맷된 JSON)

  • 긴급도 배지

  • 승인 / 거부 버튼

  • 선택적 사유 텍스트 필드

이 URL을 요청을 검토해야 하는 사람과 공유하세요. 기본적으로 로그인은 필요하지 않습니다.


MCP 도구

LoopIn MCP 서버는 모든 MCP 호환 AI 클라이언트(Claude Desktop, Cursor 등)에서 사용할 수 있는 6가지 도구를 제공합니다:

도구

설명

create_interrupt

에이전트가 새로운 인터럽트 요청 생성

get_interrupt_status

에이전트가 결정을 확인하기 위해 폴링

list_pending_interrupts

사람이 검토가 필요한 항목 확인

decide_interrupt

사람이 승인 또는 거부

cancel_interrupt

에이전트가 대기 중인 요청 취소

get_interrupt_analytics

사용 통계

MCP 서버 설정 (stdio)

{
  "mcpServers": {
    "loopin": {
      "command": "npx",
      "args": ["-y", "@colossal-api/loopin-mcp"],
      "env": {
        "LOOPIN_API_URL": "https://your-loopin-instance.railway.app",
        "LOOPIN_API_KEY": "your-key"
      }
    }
  }
}

에이전트 사용 패턴

1. Agent reaches a decision point
   → POST /interrupts { agentId, userId, action, context, urgency }
   ← { interruptId, reviewUrl }

2. Agent saves interruptId and pauses
   → (optionally: notify human via other channels with reviewUrl)

3. Agent polls until resolved
   → GET /interrupts/:interruptId
   ← { status: "pending" }   ← keep polling
   ← { status: "approved", decision, modifiedParams }  ← resume

4. Agent resumes execution
   → use modifiedParams if provided, otherwise proceed as planned

사람 사용 패턴

옵션 A — 검토 URL (가장 간단함)

  1. 에이전트로부터 reviewUrl을 수신 (이메일, Slack 등을 통해)

  2. 브라우저에서 URL 열기

  3. 컨텍스트 검토, 승인 또는 거부 클릭, 선택적 사유 추가

  4. 완료 — 에이전트가 다음 폴링 시 결정 사항을 수신

옵션 B — 대기 목록 확인 (대시보드)

  1. GET /interrupts/pending/:userId — 모든 열린 요청 확인

  2. 개별 reviewUrl을 열거나 POST /interrupts/:id/decide를 직접 호출


환경 변수

변수

기본값

설명

PORT

3002

API 서버 포트

LOOPIN_BASE_URL

http://localhost:3002

검토 링크를 위한 공개 기본 URL

API_KEY_SECRET

(없음)

선택 사항: 모든 요청에 X-API-Key 헤더 요구


Colossal API 포트폴리오

LoopIn은 AI 에이전트를 위한 인프라 API 제품군인 Colossal API의 일부입니다:

  • SubRadar — 구독 감지 및 취소

  • MeetSync — 캘린더 협상 및 일정 관리

  • LoopIn — Human-in-the-loop 인터럽트 및 승인

모든 제품은 동일한 설계 철학을 공유합니다: 에이전트가 기본적으로 사용할 수 있도록 MCP 서버 래퍼가 포함된 간단한 REST API입니다.

Related MCP Connectors

Related MCP Servers