Skip to content

doc_version: "1.0.0" last_updated: "2026-06-18" status: "Active"


Model Documentation

This directory contains documentation for all 13 conversational AI models in src/models/.

Overview

The models provide specialized conversation handling capabilities, from greetings to Q&A to intent classification. They form the processing pipeline for the chat system.

Model Categories

Conversation Flow Models

Model Version Description Dependencies
greeting 0.2.1 Welcome messages model_base
end_conversation 0.2.1 Farewell handling model_base
chitchat 0.1.0 Casual conversation model_base, mongo, milvus, openai

Input Processing Models

Model Version Description Dependencies
empty 0.2.1 Empty input handling model_base, openai
command 0.2.1 Command recognition model_base
intent 0.2.1 Intent classification model_base, classifier

Response Generation Models

Model Version Description Dependencies
qa 0.2.2 Question answering model_base, openai, milvus
context 0.2.3 Context management model_base, milvus, openai
default 0.1.0 Default fallback model_base, mongo, milvus, openai
nothing_found 0.2.1 No results handling model_base

Special Models

Model Version Description Dependencies
early_exit 0.1.0 Conversation termination openai
openai_assistant 0.2.1 OpenAI Assistant API model_base, openai
oureliza 0.2.1 ELIZA-style conversation model_base, oureliza

Model Processing Pipeline

User Input
    │
    ▼
┌─────────────────┐
│   empty         │ ──► Handle empty input
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   early_exit    │ ──► Check for exit intent
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   greeting      │ ──► Detect greetings
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   command       │ ──► Recognize commands
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   intent        │ ──► Classify intent
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   context       │ ──► Build context
└─────────────────┘
    │
    ▼
┌─────────────────┐
│   qa / default  │ ──► Generate response
└─────────────────┘
    │
    ▼
┌─────────────────┐
│  nothing_found  │ ──► Handle no results
│  end_conversation│──► Handle farewells
└─────────────────┘

Model Base

All models inherit from bast-model-base which provides:

  • Standard model interface
  • Configuration loading
  • Logging integration
  • Response formatting

Base Model Interface

from bast_model_base import ModelBase

class MyModel(ModelBase):
    def __init__(self, catname: str):
        super().__init__(catname)

    def process(self, input_text: str, context: dict) -> dict:
        # Model processing logic
        return {
            "response": "Model response",
            "confidence": 0.95,
            "model": self.name
        }

Configuration

Models are configured via YAML:

# resources/config/{catname}.yaml
models:
  greeting:
    enabled: true
    responses:
      - "Hello! How can I help you today?"
      - "Hi there! What can I assist you with?"

  qa:
    enabled: true
    model: gpt-4o
    max_tokens: 500
    temperature: 0.7

  intent:
    enabled: true
    threshold: 0.8

Model Selection

The model processing order is typically:

  1. Early Exit: Check if user wants to end conversation
  2. Greeting: Handle greetings with predefined responses
  3. Command: Process system commands
  4. Intent: Classify user intent
  5. Context: Build conversation context
  6. QA/Default: Generate response based on context
  7. Nothing Found: Handle cases with no good response
  8. End Conversation: Handle farewell messages

Maintainers

Bast AI Team