Skip to content

Agent Endpoints

AI agent system endpoints for workflows, embeddings, and MCP tools.

Health

GET /agent/health

Check agent system status.

bash
curl http://localhost:3000/agent/health

Response:

json
{
  "status": "healthy",
  "embedding": true,
  "vectorStore": true,
  "llm": true
}

Embeddings

POST /agent/embeddings

Generate embeddings for texts.

bash
curl -X POST http://localhost:3000/agent/embeddings \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": ["Hello world", "Another text"]
  }'

Response:

json
{
  "embeddings": [
    [0.123, 0.456, ...],
    [0.789, 0.012, ...]
  ]
}

POST /agent/embeddings/document

Store document with embeddings.

bash
curl -X POST http://localhost:3000/agent/embeddings/document \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "document": "Full document text...",
    "contentType": "article",
    "metadata": {
      "source": "web",
      "url": "https://example.com"
    }
  }'

Response:

json
{
  "id": "doc-123",
  "chunks": 5,
  "success": true
}

POST /agent/embeddings/search

Search documents by semantic similarity.

bash
curl -X POST http://localhost:3000/agent/embeddings/search \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "search query",
    "limit": 10,
    "threshold": 0.7
  }'

Response:

json
{
  "results": [
    {
      "id": "chunk-1",
      "content": "Matching content...",
      "score": 0.92,
      "metadata": {...}
    }
  ]
}

POST /agent/embeddings/batch

Batch operations.

bash
curl -X POST http://localhost:3000/agent/embeddings/batch \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "operations": [
      { "type": "store", "document": "..." },
      { "type": "store", "document": "..." }
    ]
  }'

Workflows

POST /agent/workflow

Execute workflow.

bash
curl -X POST http://localhost:3000/agent/workflow \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow": {
      "id": "my-workflow",
      "steps": [...]
    },
    "input": {
      "key": "value"
    }
  }'

POST /agent/workflow/run

Run saved workflow.

bash
curl -X POST http://localhost:3000/agent/workflow/run \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "ticket-analysis",
    "input": { "ticketId": "PROJ-123" }
  }'

GET /agent/workflow/status

Get workflow status.

bash
curl "http://localhost:3000/agent/workflow/status?workflowId=abc123" \
  -H "Authorization: Bearer <token>"

POST /agent/workflow/validate

Validate workflow definition.

bash
curl -X POST http://localhost:3000/agent/workflow/validate \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow": {...}
  }'

MCP Tools

GET /agent/mcp/tools

List available MCP tools.

bash
curl http://localhost:3000/agent/mcp/tools \
  -H "Authorization: Bearer <token>"

POST /agent/mcp/execute

Execute MCP tool.

bash
curl -X POST http://localhost:3000/agent/mcp/execute \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "server": "filesystem",
    "tool": "read_file",
    "args": { "path": "/path/to/file" }
  }'

Goal Evaluation

POST /agent/evaluate-goal

Evaluate if goal is achieved.

bash
curl -X POST http://localhost:3000/agent/evaluate-goal \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "goal": "Summarize the document",
    "context": "...",
    "result": "..."
  }'

Released under the ISC License.