Chat with AI assistant
Request body
Array of chat messages in the conversation
Optional city ID to scope the search. When provided, the assistant will include city-specific context (council members, parties, administrative bodies) in its responses.
Development only: Use mock data instead of real search results
Response
Returns a Server-Sent Events (SSE) stream of chat responses. Each event is a JSON object:Response message identifier
Always
assistant for AI responsesThe assistant’s response text (accumulated content in streaming mode)
Whether the response is complete
Array of subjects referenced in the response (only present when
done: true)Whether an error occurred (only present on error)
Error handling
If an error occurs during processing, the stream will return a final message with:How it works
The chat endpoint uses a sophisticated pipeline to provide accurate, context-aware responses:1. Search phase
When you send a message, the system performs a hybrid search (text + semantic) to find relevant subjects from council meetings. The search:- Uses your last message as the query
- Filters by cityId if provided
- Returns the top 5 most relevant subjects
- Includes detailed speaker segments when needed
2. Context enhancement
The system enhances the AI prompt with:- City political context: Current council members, parties, and administrative bodies
- Relevant subjects: Meeting subjects ordered by relevance with:
- Subject name, description, and topic
- Speaker segments (marked with 🔹 for key segments)
- Additional context from AI-generated summaries
3. AI response generation
The AI assistant (Claude 4.5 Sonnet) generates a response:- Uses the enhanced context to provide accurate information
- References subjects using
[X]notation (e.g.,[1],[2]) - Streams the response for a smooth user experience
- Returns subject references for linking to source material
AI configuration
The chat endpoint uses the following AI configuration:- Model:
claude-sonnet-4.5-20250929 - Max tokens: 1000
- Temperature: 0 (deterministic responses)
- Context: Up to 10 recent messages
Search configuration
- Results per query: 5 subjects
- Semantic search: Enabled
- Rank window: 100 results
- Rank constant: 60
- Detailed results: Enabled (includes full speaker segments)
Best practices
Ask specific questions
Use city context
Including acityId provides better context:
Multi-turn conversations
Maintain conversation history for context:Use cases
Question answering
“Τι αποφάσισε το συμβούλιο για το νέο πάρκο;“Council member queries
“Τι είπε ο Γιώργος Παπαδάκης για το θέμα του περιβάλλοντος;“Topic exploration
“Ποια θέματα συζητήθηκαν για τις μεταφορές τον τελευταίο χρόνο;“Procedural questions
“Πώς λειτουργεί η ψηφοφορία στο δημοτικό συμβούλιο;“Policy analysis
“Ποιες είναι οι προτάσεις για την κυκλοφορία στο κέντρο;“Response format
Subject references
The assistant uses[X] notation to reference subjects:
subjectReferences array.