In the below code what pre-built model or NLP techniques or pre-trained models is used by `policy_agent` 
for Identifying Relevant Criteria and who do Criteria Mapping? database_agent what predefined SQL query 
templates uses to facilitate the construction of queries based on the criteria?

#!/usr/bin/env python
# coding: utf-8

# --- Install required packages ---
try:
    get_ipython().system('pip install -q fastapi uvicorn crewai crewai_tools langchain-community langchain-openai pymysql python-dotenv chromadb docx2txt pypdf')
except Exception:
    pass  # Ignore if not in an interactive shell

# --- Imports ---
import os
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from typing import List
from dotenv import load_dotenv

from langchain_community.utilities.sql_database import SQLDatabase
from langchain_community.document_loaders import PyPDFLoader, Docx2txtLoader
from langchain.text_splitters import RecursiveCharacterTextSplitter
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.chat_models import ChatOpenAI
from langchain_community.vectorstores import Chroma
from langchain.tools.retriever.retriever_tool import create_retriever_tool
from langchain_community.agent_toolkits import SQLDatabaseToolkit

from crewai import Agent, Task, Crew, Process

# --- Load environment variables ---
load_dotenv()

# --- Configuration ---
openai_api_key = os.getenv("OPENAI_API_KEY")
if not openai_api_key:
    raise ValueError("OPENAI_API_KEY is missing. Check your .env file.")

db_user = os.getenv("DB_USER", "")
db_password = os.getenv("DB_PASSWORD", "")
db_host = os.getenv("DB_HOST", "")
db_name = os.getenv("DB_NAME", "classicmodels")

folder_path = "/content/docs"  # Ensure this path is valid for your environment

# --- Load and Split Documents ---
def load_documents(folder_path: str) -> List:
    """Loads PDF and DOCX files from the specified folder."""
    documents = []
    if not os.path.exists(folder_path):
        print(f"Folder does not exist: {folder_path}")
        return documents
    for filename in os.listdir(folder_path):
        file_path = os.path.join(folder_path, filename)
        try:
            if filename.endswith('.pdf'):
                documents.extend(PyPDFLoader(file_path).load())
            elif filename.endswith('.docx'):
                documents.extend(Docx2txtLoader(file_path).load())
            else:
                print(f"Unsupported file type: {filename}")
        except Exception as e:
            print(f"Error loading {filename}: {e}")
    return documents

print("Loading policy documents...")
documents = load_documents(folder_path)

text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
splits = text_splitter.split_documents(documents)

print("Creating embeddings...")
embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
vectorstore = Chroma.from_documents(splits, embedding=embeddings)
retriever = vectorstore.as_retriever()

policy_retriever_tool = create_retriever_tool(
    retriever,
    "policy_document_retriever",
    "Searches and returns policy document information."
)

# --- Database Setup ---
print(f"Connecting to database {db_name}@{db_host}")
try:
    db = SQLDatabase.from_uri(f"mysql+pymysql://{db_user}:{db_password}@{db_host}/{db_name}")
    db_toolkit = SQLDatabaseToolkit(db=db, llm=ChatOpenAI(model="gpt-4o-mini", temperature=0))
    db_tools = db_toolkit.get_tools()
except Exception as e:
    print(f"Database connection failed: {e}")
    db = None
    db_tools = []

# --- Define Agents ---
policy_agent = Agent(
    role="Policy Compliance Expert",
    goal="Understand company policies and identify violation criteria.",
    backstory="Experienced compliance officer with policy expertise.",
    verbose=True,
    allow_delegation=False,
    tools=[policy_retriever_tool],
    llm=ChatOpenAI(model="gpt-4o-mini", temperature=0)
)

database_agent = Agent(
    role="Database Query Specialist",
    goal="Convert policy criteria into SQL and retrieve results.",
    backstory="SQL-savvy data analyst with database access.",
    verbose=True,
    allow_delegation=False,
    tools=db_tools,
    llm=ChatOpenAI(model="gpt-4o-mini", temperature=0)
)

# --- Define Tasks ---
policy_analysis_task = Task(
    description=(
        "Analyze question: '{question}'. Use policy retriever to identify policy and define violation criteria. "
        "If database check is needed, formulate exact query requirements for the DB agent."
    ),
    expected_output=(
        "Violation criteria from policy docs, or final answer if query not needed."
    ),
    agent=policy_agent,
)

database_query_task = Task(
    description=(
        "Receive violation criteria from Policy Agent. Convert to SQL queries using tools. "
        "Return count of violating employees or state if not applicable."
    ),
    expected_output=(
        "Employee count violating the policy, or note no DB query needed."
    ),
    agent=database_agent,
)

synthesize_answer_task = Task(
    description=(
        "Combine analysis and DB results to form a complete answer for: '{question}'."
    ),
    expected_output="Final answer to the user question.",
    agent=policy_agent,
)

# --- Crew Setup ---
crew = Crew(
    agents=[policy_agent, database_agent],
    tasks=[policy_analysis_task, database_query_task, synthesize_answer_task],
    process=Process.sequential,
    verbose=2
)

# --- FastAPI Setup ---
app = FastAPI()

class QueryRequest(BaseModel):
    question: str

@app.post("/ask/")
async def ask_crew(request: QueryRequest):
    if db is None:
        raise HTTPException(status_code=500, detail="Database connection not available.")
    try:
        final_answer = crew.kickoff(inputs={"question": request.question})
        return {"answer": final_answer}
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))