You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Gemini-powered chatbot (SSE), classification, and optional vector search
4
4
---
5
5
6
6
# AI Services
7
7
8
-
## RAG Chatbot
8
+
UrbanReflex AI stack uses Gemini for generation and supports optional vector search (Pinecone) for RAG. Chatbot endpoints support streaming (SSE) and non-streaming. Classification is exposed via citizen-report API.
"query": "Find broken streetlight reports in District 1 this month",
59
92
"limit": 10
60
93
}
61
94
```
95
+
**Response (example)**
96
+
```json
97
+
{
98
+
"results": [
99
+
{
100
+
"type": "citizen_report",
101
+
"relevance_score": 0.95,
102
+
"data": {
103
+
"id": "urn:ngsi-ld:CitizenReport:001",
104
+
"title": "Broken streetlight on Main Street",
105
+
"category": "streetlight",
106
+
"status": "open"
107
+
}
108
+
}
109
+
],
110
+
"total_results": 12
111
+
}
112
+
```
113
+
114
+
---
62
115
63
116
## Configuration
64
117
118
+
`.env` (backend):
65
119
```bash
66
-
# Required
67
-
GEMINI_API_KEY="your-key"
68
-
PINECONE_API_KEY="your-key"
69
-
PINECONE_INDEX_NAME="urbanreflex-index"
120
+
# AI
121
+
GEMINI_API_KEY=your_key_here
122
+
123
+
# Vector search (optional)
124
+
PINECONE_API_KEY=your_key_here
125
+
PINECONE_ENVIRONMENT=your_env
126
+
PINECONE_INDEX_NAME=urbanreflex-index
70
127
```
128
+
129
+
If Pinecone keys are absent, chatbot still works without RAG. Set API keys and restart backend to enable vector search. See full API details in [`docs/API_REFERENCE.md`](https://github.com/minhe51805/UrbanReflex/blob/main/docs/API_REFERENCE.md).
High-level overview of the REST API. For full details, examples, and error formats, see the complete reference at [`docs/API_REFERENCE.md`](https://github.com/minhe51805/UrbanReflex/blob/main/docs/API_REFERENCE.md).
0 commit comments