File size: 3,001 Bytes
2f22e68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Godspeed API Reference

## POST /agent/query

The main chat endpoint. Returns a Server-Sent Events (SSE) stream.

**Request body:**
```json
{
  "query": "What caused the last incident?",
  "team_id": "default",
  "session_id": "unique-session-id"
}
```

**SSE Events:**

| Event | Data | Description |
|-------|------|-------------|
| plan_ready | {tasks, reasoning} | Planner's execution plan |
| agent_started | {agent} | A retrieval agent has started |
| agent_done | {agent, chunks, confidence} | Agent finished, chunks found |
| synthesis_started | {} | Synthesiser is generating the answer |
| answer_chunk | {chunk} | One token/phrase of the answer |
| guardrail_result | {score, escalate} | Safety score (0-1) |
| error | {message} | Something went wrong |
| done | {} | Stream complete |

**Confidence levels:**
- `high` β€” reranker score β‰₯ 0.6, answer is reliable
- `medium` β€” reranker score β‰₯ 0.4, answer may have gaps
- `low` β€” reranker score < 0.4, answer is best-effort

---

## POST /confluence/sync/{space_key}

Triggers a full sync of a Confluence space. Runs as a background Celery task.

```bash
curl -X POST http://localhost:8000/confluence/sync/ENG
```

**Response:**
```json
{"status": "accepted", "task_id": "abc123", "space_key": "ENG"}
```

---

## POST /jira/sync/{project_key}

Syncs all issues in a Jira project.

```bash
curl -X POST http://localhost:8000/jira/sync/BACKEND
```

---

## POST /api/ingest/file

Upload a file for ingestion. Supports: PDF, DOCX, DOC, CSV, XLSX, XLS, HTML, HTM, XML, TXT, MD.

```bash
curl -X POST http://localhost:8000/api/ingest/file \
  -F "file=@report.pdf" \
  -F "team_id=default"
```

**Response:**
```json
{"status": "accepted", "task_id": "xyz789", "filename": "report.pdf"}
```

---

## GET /ingest/jobs/{job_id}

Check the status of an ingestion job.

```bash
curl http://localhost:8000/ingest/jobs/abc123
```

**Response:**
```json
{
  "job_id": "abc123",
  "status": "completed",
  "chunks_ingested": 42,
  "source_type": "confluence",
  "team_id": "default"
}
```

Status values: `pending`, `running`, `completed`, `failed`

---

## GET /graph/traverse

Query the knowledge graph for related entities.

```bash
curl "http://localhost:8000/graph/traverse?entity_name=AuthService&entity_type=Service&team_id=default"
```

**Parameters:**
- `entity_name` β€” name of the entity to start from
- `entity_type` β€” one of: Service, Library, Incident, Team
- `team_id` β€” your team identifier

---

## POST /webhooks/jira

Receives Jira Cloud webhooks. Configure in Jira β†’ Project Settings β†’ Webhooks.

- URL: `https://your-domain.com/webhooks/jira`
- Events: Issue Created, Issue Updated
- Signs with HMAC-SHA256 using `JIRA_WEBHOOK_SECRET`

---

## POST /webhooks/confluence

Receives Confluence webhooks. Configure in Confluence β†’ Space Settings β†’ Integrations.

- URL: `https://your-domain.com/webhooks/confluence`
- Events: page_created, page_updated
- Signs with HMAC-SHA256 using `CONFLUENCE_WEBHOOK_SECRET`