-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description
Implement logic to handle queries that can be answered from the current user query and conversation history. This includes greeting detection and context-based response generation.
Objective
- Detect greetings (hello, hi, goodbye, thanks) and provide friendly responses
- Analyze conversation history to answer follow-up questions
- Use LLM to intelligently determine if query references conversation context
Technical Requirements
3.1 Greeting Detection
Supported Languages: Estonian (et), English (en)
Greeting Types:
hello: Tere, Hello, Hi, Good morninggoodbye: Nägemist, Bye, Goodbye, See youthanks: Tänan, Thank you, Thankscasual: Hei, Hey, Moi
Response Generation: Use LLM to generate contextually appropriate responses in the same language
3.2 Context Analysis
Input: User query + conversation history (last 10 turns)
LLM Task:
- Check if query is a greeting → respond appropriately
- Check if query references conversation history → extract answer
- Otherwise → fallback to RAG workflow
Output Format:
{
"is_greeting": true/false,
"can_answer_from_context": true/false,
"answer": "response text or null",
"reasoning": "brief explanation"
}Acceptance Criteria
- Implement
ContextAnalyzerwith LLM-based greeting detection - Implement conversation history formatting (last 10 turns)
- Implement
ContextWorkflowExecutorwith streaming support - Add greeting response constants (ET/EN)
- Add fallback to RAG when context cannot answer
- Add cost tracking for context check LLM calls
- Unit tests for greeting detection
- Unit tests for context-based responses
- Integration tests for context workflow
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Progress