How answerlink/intelliq works
Project Type and Purpose
• IntelliQ is an open-source conversational AI system designed to manage multi-turn dialogues by leveraging intent recognition and slot filling.
• The README indicates that it is aimed at providing developers a flexible framework for building and optimizing conversational (chatbot) applications, with built-in support for API-based integrations (e.g., to external LLMs).
File Structure
• At the top level, key files include app.py for application startup, configuration files within the “config” directory, a “models” directory for the chatbot model logic, and “scene_config” and “scene_processor” directories that manage dialogue scenes and their processing pipelines.
• The “frontend” and “demo” directories hold the static assets (HTML, JS) for visual debugging and interaction, implying a separation between backend processing and frontend presentation.
• The “utils” directory contains various helper scripts (date handling, file utilities, prompt-related functions) to support the core application logic.
• This modular structure suggests a clear separation of concerns: configuration, dialogue processing, model integration, and presentation.
README for Additional Insights
• The README describes key features like multi-turn dialogue management, intent recognition, and slot filling – underscoring the role of the “models”, “scene_config”, and “scene_processor” modules.
• Installation steps and configuration hints (modifying API keys and endpoint URLs) confirm that configuration management (via “config”) is central.
a. Main Components:
• Frontend/UI Module: Represented by the “frontend” (app.js, rec_demo.html) and demo HTML files; these serve the web interface for user interactions.
• Backend/Application Layer: Initiated by app.py; this is the core server that orchestrates requests.
• Configuration Module: “config” for global settings and logging configurations.
• Models Module: “models/chatbot_model.py” that likely interfaces with external LLM endpoints using provided API keys.
• Scene Configuration Module: “scene_config,” containing JSON templates, scene-specific prompts, and custom scene configurations.
• Scene Processing Module: “scene_processor” (with its “impl” subdirectory) which encapsulates the dialogue processing logic including intent recognition and slot filling.
• Utility Modules: “utils” serving as supporting functions for data formatting, file operations, prompt utilities, etc.
b. Relationships and Interactions:
• The Frontend sends user queries (via demo/user_input.html or frontend/web components) to the backend (app.py).
• The backend first loads settings and initializes necessary resources via “config” and “utils”.
• Incoming requests are processed by the scene processing layer which uses scene configurations (from “scene_config”) and calls upon the models (via “models/chatbot_model.py”) to generate responses. The processing layer (scene_processor) distinguishes the flow into stages, applying common processing logic (from scene_processor/impl/common_processor.py).
• The response is then sent back to the frontend for user display.
• External interactions (API calls to LLM services) are mediated using configuration parameters (API_KEY, GPT_URL).
c. Architectural Patterns and Design Principles:
• Modular and layered design: Each functionality (configuration, model handling, processing, utility) is encapsulated in its own module and communicates via well-defined interfaces.
• Separation of concerns: Clear division between presentation (frontend/demo) and business logic (backend processing).
• Extensibility: The “scene_config” and “scene_processor” modules are highly abstracted, suggesting an architecture that allows easy modifications to dialogue flows and integration with various LLMs.
d. Relevant Technologies:
• Python as the primary language.
• JavaScript/HTML for the frontend.
• Use of JSON for configuration and scene definitions.
• Likely integration with external LLMs (e.g., ChatGPT API) via endpoint configurations.