{% extends "base.html" %} {% block content %} Oracle AI RFP Response

Oracle LAD A-Team
Cristiano Hoshikawa
cristiano.hoshikawa@oracle.com

Tutorial
Oracle Learn – OCI Generative AI PDF RAG
Oracle GraphRAG for RFP Validation

REST Service Endpoint
{{ api_base_url }}/rest/chat


Overview

This application provides an AI-assisted RFP response engine for Oracle Cloud Infrastructure (OCI). It analyzes natural language requirements and returns a structured, evidence-based technical response.

Important Notes

GraphRAG • Oracle Autonomous Database 23ai • Embeddings • Knowledge Graph • LLM • Flask API

{% if current_user and current_user.role in ("admin", "user") %}

Try It — Live RFP Question

Enter an RFP requirement or technical question below. The API will return a structured JSON response.

{% endif %} {% if current_user and current_user.role in ("admin", "user") %}

🏗 Architecture Planner

This is an advanced analysis engine for designing Architectural Solutions based on OCI resources. It uses LRM mechanism with Chain-of-Tought to prepare solutions that require a set of components in OCI.

{% endif %}

Submit your RFP (Excel)

Upload an Excel file and receive the processed result by email. You do not need to keep this page open.

Follow the Excel format:
Column A: MUST be a sequential numeric
Column B, C: MUST be fill with a context. Could be a domain and sub-domain for the question
Column D: Optional
Column E: MUST be the main question

Exemplo de planilha Excel





REST API Usage

The service exposes a POST endpoint that accepts a JSON payload.

curl -X POST {{ api_base_url }}/rest/chat -H "Content-Type: application/json" -u app_user:app_password -d '{ "question": "Does Oracle Cloud Infrastructure (OCI) Compute support online resizing of memory for running virtual machine instances?" }'

Request Parameters

question (string)
Natural language description of an RFP requirement or technical capability. Small wording changes may affect how intent and evidence are interpreted.

AI Response JSON Structure

The API always returns a strict and normalized JSON structure, designed for traceability, auditing, and human validation.

answer

Final assessment of the requirement: YES, NO, or PARTIAL. A NO means the requirement is not explicitly satisfied as written.

confidence

Indicates the strength of the supporting evidence: HIGH, MEDIUM, or LOW.

ambiguity_detected

Flags whether the requirement is vague, overloaded, or open to interpretation.

confidence_reason

Short explanation justifying the confidence level.

justification

Technical rationale connecting the evidence to the requirement. This is not marketing text.

evidence

List of supporting references:

How to Use the RFP AI with a custom Python Code

This solution exposes a REST API that allows RFP questions to be evaluated programmatically. By consuming this API, users can execute a Python automation that reads spreadsheet files, builds contextualized questions, sends them to the AI service, and writes the results back to the same spreadsheet.

The automation supports both hierarchical and non-hierarchical spreadsheet structures. Depending on how the spreadsheet is organized, the Python code automatically determines how to construct each question, ensuring that the context sent to the AI is accurate, consistent, and auditable.

This approach enables large RFP documents to be processed in bulk, replacing manual analysis with a repeatable and controlled workflow driven by a REST interface and a Python execution layer.

Source Code Download

The Python script responsible for reading RFP spreadsheets, calling the REST API, and writing results back to the file can be downloaded below:

📥 process_excel_rfp.py

1. Hierarchical Spreadsheet

A spreadsheet is considered hierarchical when it contains a numbering column that represents a tree structure, such as:

    1
    1.1
    1.1.1
    1.2
      

In this format:

Example:
Item 1.2.3 inherits context from 11.2

2. Non-Hierarchical Spreadsheet

A spreadsheet is considered non-hierarchical when no valid hierarchical numbering exists or when numbering does not represent a logical structure.

In these cases, context is distributed across specific columns, for example:

    Domain | Subdomain | Topic | Question
      

The pipeline uses only explicitly declared context columns, preventing semantic noise such as internal IDs or technical codes from being included in the prompt.

3. How the Pipeline Selects the Mode

    If the order value is hierarchical:
        use numeric hierarchy
    Else:
        use column-based hierarchy
      
This decision ensures deterministic and auditable behavior.

4. Key Code Sections

4.1 Hierarchy Detection


    def is_hierarchical(num: str) -> bool:
        if not num:
            return False
        parts = num.split(".")
        return all(p.isdigit() for p in parts)
      

This function determines whether a row belongs to the numeric hierarchy.

4.2 Hierarchical Question Builder


    def build_question(hierarchy: dict, current_num: str) -> str:
        ...
        return f'Considering the context of "{context}", {specific}'
      

This logic walks up the hierarchy tree to build a contextualized question.

4.3 Column-Based Question Builder


    def build_question_from_columns(row, context_cols, question_col):
        ...
        return f'Considering the context of "{context}", {question}'
      

This builder is used only when no numeric hierarchy exists.

4.4 Correct Row Retrieval (Critical)


    row = df.loc[info["row"]]
    num = normalize_num(str(row.iloc[ORDER_COLUMN]))
      
Important:
Always retrieve the correct DataFrame row before accessing column values. If this step is skipped, hierarchical processing will not work correctly.

5. Best Practices

6. Summary

This pipeline is designed to:
  • Support multiple RFP spreadsheet formats
  • Eliminate semantic noise
  • Produce consistent, high-quality prompts
  • Scale for enterprise usage

Configure and Test your Custom Python Code

Before running process_excel_rfp.py, you must configure the input spreadsheet, the REST endpoint, and authentication. These parameters can be set directly in the script or provided via environment variables.

0. Prerequisites


1. Script Parameters (Edit in the .py file)

Main configuration variables

Open process_excel_rfp.py and update the values below:
    EXCEL_PATH      = "/path/to/your/RFP.xlsx"
    API_URL         = "{{ api_base_url }}/chat"
    TIMEOUT         = 120

    ORDER_COLUMN    = 0   # column index containing the order/numbering
    QUESTION_COLUMN = 1   # column index containing the question text

    # Use this only for NON-hierarchical spreadsheets:
    CONTEXT_COLUMNS = [1, 2]  # columns that contain context (domain, topic, section, etc.)

    # Output column names (created if missing):
    ANSWER_COL      = "ANSWER"
    JSON_COL        = "RESULT_JSON"
    

EXCEL_PATH

Full path to the spreadsheet you want to process. The script reads this file and writes a new output file named _resultado.xlsx in the same folder.

API_URL

The REST endpoint exposed by the AI service. It must accept: POST with JSON payload {"question": "..."} .

ORDER_COLUMN and QUESTION_COLUMN

The script uses ORDER_COLUMN to identify hierarchy (e.g., 1, 1.1, 1.1.1). The QUESTION_COLUMN is the text that will be sent to the AI.

CONTEXT_COLUMNS (Non-hierarchical mode)

If your spreadsheet is not hierarchical, context comes from fixed columns (for example: Domain → Subdomain → Topic). Only the columns listed in CONTEXT_COLUMNS will be used to build context. This avoids adding noisy values such as internal IDs or codes.


2. Authentication (Environment Variables)

Important:
Do not hardcode credentials inside the spreadsheet or the script if the file will be shared. Prefer environment variables.

The script uses HTTP Basic Auth to call the API. Configure credentials using environment variables:

    export APP_USER="YOU USER"
    export APP_PASS="YOUR PASSWORD"
    

On Windows PowerShell:

    setx APP_USER "YOUR USER"
    setx APP_PASS "YOUR PASSWORD"
    

If not provided, the script falls back to the defaults defined in the code: APP_USER / APP_PASS.


3. How to Run

    python process_excel_rfp.py
    

The script will:

Output

A new file will be created next to the original spreadsheet:
RFP_result.xlsx
{% endblock %}