Ask Question

● Connected

💬 Your Question

All Sources
Optional: Filter by source document or leave empty to search all

🏷️ Filter by Tags

Leave unchecked to search all Q&A pairs, or click "Auto-Suggest" to select relevant tags.

⚡ Search Method

📘 How To Guide (Standard Users)

This guide explains how to search the knowledge base and complete questionnaires using Bulk Answer. If you cannot access a feature, your role may not have permission—contact your administrator.

1) Ask Question (Search)

  • Enter your question on the Ask Question tab.
  • Optional filters:
    • Tags: select one or more tags to limit search scope (matches ANY selected tag).
    • Source: optionally select a source document to narrow results.
  • Choose Search Method:
    • Vector Search: fastest; best for most questions.
    • LLM Search: uses AI to re-rank candidates; useful for complex phrasing.
    • Multi-hop RAG: best for multi-part questions (e.g. “name, address and contact details”).
  • Review the result:
    • Confidence: higher is better; low confidence may mean the question needs rephrasing or the KB lacks coverage.
    • Source Documents: shows where the answer came from.
    • Multi-hop details (when used): expand “How this was answered” to see sub-questions and missing parts.

2) Bulk Answer (Recommended for questionnaires)

  • Step 1: Upload Questionnaire (PDF/DOCX/TXT/XLSX).
  • Step 2: Extract Questions: extracts questions from the uploaded file.
  • Step 3: Choose Answer Mode:
    • Vector → LLM → Multi-hop (default): fastest first, strongest fallback last.
    • Vector only, LLM only, Multi-hop only: use for troubleshooting or specific needs.
  • Filter by Tags (optional): if you choose tags, answers can be found from ANY selected tag.
  • Run Bulk Answer: review the table (NO ANSWER rows are highlighted).
  • Export to Word: exports results in a table format suitable for client submission.

Tips for better results

  • Ask one thing at a time (unless using Multi-hop RAG).
  • Use the same wording as historical questionnaires when possible.
  • If you get “No Answer”: try removing tags, changing the phrasing, or switching to LLM / Multi-hop.
  • If a Q&A looks correct but isn’t found: it may be pending/unapproved or missing tags—contact an admin.

🔍 Filters

Paste an ID from the Excel export to jump directly to a specific Q&A pair.
All Sources
Optional: filter Q&A pairs by their source document

📋 All Q&A Pairs

Page 1

Upload a completed Due Diligence questionnaire (PDF, DOCX, or TXT) to automatically extract Q&A pairs.

📄 Existing Questionnaire Sources

Step 1: Upload File

Supported formats: PDF, DOCX, TXT, XLSX, XLSM. You can also select multiple files (they’ll be queued).
Sources should be unique. If the source already exists, the upload/import will be blocked unless you enable override.

Upload a questionnaire containing DD questions, extract all questions, apply optional tag filters, and generate answers in bulk.

Step 1: Upload Questionnaire

Supported formats: PDF, DOCX, TXT, XLSX, XLSM

🗄️ Vector Database

Status of your unified vector database with tag-based categorization.

Checking...

🏷️ Tag Management

Manage tags for categorizing Q&A pairs.

🔑 API Keys Super Admin

Configure API keys for different AI providers.

🤖 Model Configuration Super Admin

⚙️ Agent Settings

Configure agent parameters for question answering and similarity matching.

Minimum confidence score (0.0-1.0) required to return an answer. Lower values allow more answers but may be less accurate.
Maximum confidence threshold (0.0-1.0). Used for validation and display purposes.
Number of similar questions to retrieve from the vector database (1-20). Higher values provide more context but may include less relevant results.
Temperature for LLM generation (0.0-2.0). Lower values (0.0-0.5) produce more focused and deterministic outputs. Higher values (0.7-2.0) produce more creative and varied outputs.
Minimum similarity score (0.0-1.0) for vector search results.

These diagrams document how the application works. They serve as the source of truth for application flows.

1. Authentication Flow

sequenceDiagram participant User participant Frontend participant Backend participant Database User->>Frontend: Enter username and password Frontend->>Backend: POST login request Backend->>Database: Query user by username Database-->>Backend: User data Backend->>Backend: Verify password with bcrypt alt Password valid Backend->>Backend: Generate JWT token Backend-->>Frontend: Return access token Frontend->>Frontend: Store token in localStorage Frontend-->>User: Show dashboard else Password invalid Backend-->>Frontend: 401 Unauthorized Frontend-->>User: Show error message end

2. Question Answering Flow (RAG with Tags)

flowchart TD A[User enters question] --> B[Select optional tag filter] B --> C[Select search method] C --> D[Frontend sends POST request] D --> E[Generate question embedding] E --> F{Tag filter selected?} F -->|Yes| G[Search with tag filter] F -->|No| H[Search all approved Q&A pairs] G --> I[Vector similarity search in unified DB] H --> I I --> J{Similar questions found?} J -->|No| K[No answer found] J -->|Yes| L[Build context from top results] L --> M[Get active model config] M --> N[Create agent with API key] N --> O[Generate answer with LLM] O --> P[Calculate confidence score] P --> Q{Confidence above threshold?} Q -->|Yes| R[Return answer with tags] Q -->|No| S[Low confidence message] R --> T[Display answer with source tags] S --> U[User sees message] T --> V{User clicks Add to KB?} V -->|Yes| W[Select tags for new Q&A] V -->|No| X[Answer displayed only] W --> Y[POST to add-qa with tags] Y --> Z[Add to unified Vector DB with tags] X --> EndNode([End]) U --> EndNode Z --> EndNode

3. Q&A Management Flow (Tag-Based Architecture)

stateDiagram-v2 [*] --> VectorDB: Import Q&A pairs with tags VectorDB --> Pending: Initial status Pending --> Approved: Admin approves Pending --> Rejected: Admin rejects Pending --> Deleted: Admin soft deletes Approved --> Pending: Admin unapproves Approved --> Deleted: Admin soft deletes Rejected --> Pending: Admin edits and resubmits Rejected --> Deleted: Admin soft deletes Deleted --> Pending: Admin restores note right of VectorDB UNIFIED Vector DB with TAG-BASED categorization Tags: Local, Global, Hybrid, Sharia, Custom... end note note right of Approved Only APPROVED pairs used in RAG searches Tags can be used to filter search results end note

Architecture Note: The system now uses a single unified Vector DB with tag-based categorization instead of separate Local/Global databases. Tags (Local, Global, Hybrid, Sharia, etc.) can be assigned to Q&A pairs for flexible categorization. Users can filter searches by tags. Only approved pairs are used for similarity searches.

4. API Key & Model Configuration Flow

flowchart LR A[User adds API key] --> B[Store in api_keys table] B --> C[User selects model] C --> D[Store in model_configurations table] D --> E[Set as active model] E --> F[Agent Factory retrieves config] F --> G[Get API key for provider] G --> H[Create agent instance] H --> I[Use for question answering]

5. Settings Management Flow

sequenceDiagram participant User participant Frontend participant Backend participant Database User->>Frontend: Update agent settings Frontend->>Backend: PATCH settings request Backend->>Database: Update agent_settings table Database-->>Backend: Updated settings Backend-->>Frontend: Return updated settings Frontend->>Frontend: Update UI with new values Note over Backend,Database: Settings include min confidence threshold, max confidence threshold, similarity top k, LLM temperature, min similarity score

6. System Architecture Overview

graph TB subgraph Frontend UI[HTML JavaScript UI] end subgraph BackendAPI[Backend API] Auth[Authentication] Questions[Questions API] Answers[Answers API] Uploads[Uploads API] Models[Models API] Settings[Settings API] Users[Users API] Admin[Admin API] end subgraph AgentSystem[Agent System] TagSuggester[Tag Suggester Agent] RAG[RAG Agent] Extractor[Q&A Extractor Agent] Factory[Agent Factory] end subgraph DataStorage[Data Storage] AppDB[(Application DB
PostgreSQL
Users, Roles, Settings)] VectorDB[(Unified Vector DB
pgvector
Q&A with Tags)] end subgraph ExternalServices[External Services] OpenAI[OpenAI API] Anthropic[Anthropic API] Google[Google AI API] end UI --> Auth UI --> Questions UI --> Answers UI --> Uploads UI --> Models UI --> Settings UI --> Users UI --> Admin Questions --> TagSuggester Questions --> RAG RAG --> Factory Factory --> OpenAI Factory --> Anthropic Factory --> Google Uploads --> Extractor Extractor --> Factory Auth --> AppDB Users --> AppDB Models --> AppDB Settings --> AppDB Answers --> VectorDB RAG --> VectorDB Uploads --> VectorDB Admin --> VectorDB

Architecture Note: The system uses a single unified Vector DB with tag-based categorization. Q&A pairs are stored with tags (Local, Global, ESG, etc.) for flexible filtering. The Application DB stores users, roles, permissions, settings, and model configs.

7. Upload Questionnaire Flow

flowchart TD Start([User uploads PDF/DOCX/TXT]) --> Parse[Document Parser] Parse --> Preview[Show text preview] Preview --> Extract[User clicks Extract Q&A] Extract --> Agent[Q&A Extractor Agent] Agent --> LLM[Call LLM to extract pairs] LLM --> Results[Display extracted Q&A pairs] Results --> Review[User reviews and selects pairs] Review --> SelectTags[User selects tags for import] SelectTags --> Import[User clicks Import] Import --> VectorDB[(Unified Vector DB)] VectorDB --> Pending[Status: Pending with Tags] Pending --> ManagePage[Appear in Q&A Management] ManagePage --> Approve{Admin reviews} Approve -->|Approve| Active[Status: Approved - Used in RAG] Approve -->|Reject| Rejected[Status: Rejected] Approve -->|Edit| Edit[Edit Q&A and Tags] Edit --> Pending

Note: Q&A pairs are extracted, tagged by the user, and imported to the unified Vector DB with pending status. Admin approval is required before pairs appear in search results.

8. Complete User Journey

journey title User Journey - Question Answering & Knowledge Management section Login User opens app: 3: User Enter credentials: 2: User Receive JWT token: 5: System section Configure Add API key: 4: User Select model: 4: User Configure settings: 3: User section Import Knowledge Upload questionnaire: 5: User Extract Q&A pairs: 4: System Review and select pairs: 4: User Select tags for import: 4: User Import to Vector DB: 5: System Approve in Q&A Management: 4: Admin section Ask Question Enter question: 5: User Optional tag filter: 3: User Select search method: 3: User Search vector DB: 5: System Generate answer: 5: System Display answer with sources: 5: System section Add to Knowledge Base Review answer: 4: User Click Add to KB button: 4: User Select tags: 3: User Add to vector DB: 5: System Confirm success: 5: System

9. Data Flow: Question to Answer

flowchart TD Start([User Question]) --> Input[Question Input] Input --> Tags{Tag Filter?} Tags -->|Yes| TagFilter[Apply Tag Filter] Tags -->|No| AllTags[Search All Tags] TagFilter --> Method{Search Method} AllTags --> Method Method -->|Vector| VectorSearch[Vector Similarity Search] Method -->|LLM| LLMSearch[LLM Re-ranking Search] VectorSearch --> VectorDB[(Unified Vector DB
approval_status = approved)] LLMSearch --> VectorDB VectorDB --> Results{Results Found?} Results -->|No| NoAnswer[No matching Q&A found] Results -->|Yes| Context[Build Context from Top Results] Context --> Config[Get Active Model Config] Config --> Key[Get API Key for Provider] Key --> Agent[Create LLM Agent] Agent --> Generate[Generate Answer with Context] Generate --> Conf[Calculate Confidence Score] Conf --> Check{Confidence OK?} Check -->|Yes| Return[Return Answer with Sources] Check -->|No| LowConf[Return low confidence warning] Return --> Display[Display Answer + Tags + Sources] Display --> UserAction{User clicks Add to KB?} UserAction -->|Yes| SelectTags[Select Tags for New Q&A] UserAction -->|No| End1([Done]) SelectTags --> AddKB[Add to Vector DB] AddKB --> End2([Added with Approved Status]) LowConf --> End3([Display Warning]) NoAnswer --> End3

Key Points: Users can optionally filter by tags and choose search method (Vector or LLM). Only approved Q&A pairs are searched. Answers include source document references. New Q&As added from answers are auto-approved.

Manage users, roles, and permissions.

➕ Create New User

👥 All Users

📝 Add Q&A to Knowledge Base

Manually add question-answer pairs to the vector database.

Select at least one tag for the Q&A pair.

💡 Tips

  • Use specific, clear questions for better retrieval
  • Answers should be comprehensive but focused
  • Always assign at least one relevant tag
  • Auto-approved Q&A pairs are immediately searchable
  • Pending Q&A pairs require approval before they appear in search results