── 9 approaches to the same query, dissected ──
| # | Strategy | Pattern | Depth | LLM Calls | Speed | Best For | Risk |
|---|---|---|---|---|---|---|---|
| 01 | STANDARD | Direct call | 1 step | 1 | FAST | Simple factual queries | No reasoning chain |
| 02 | CHAIN-OF-THOUGHT | Sequential steps | 3-5 steps | 1 | FAST | Step-by-step analysis | Linear, no backtrack |
| 03 | TREE OF THOUGHTS | BFS + pruning | widthdepth = 8 | ~14+ | SLOW | Exploring alternatives | High latency |
| 04 | ReAct | Thought-Action loop | 1-5 cycles | 1-5 | MEDIUM | Tool-augmented tasks | Tool reliability |
| 05 | SELF-REFLECTION | Draft-Critique-Refine | 1-5 iterations | 2-10 | MEDIUM | Accuracy-critical answers | Infinite loop risk |
| 06 | SELF-CONSISTENCY | Multi-sample vote | k=5 parallel | 5 | PARALLEL | Consensus answers | 5x cost |
| 07 | DECOMPOSED | Split-Solve-Merge | N + 1 | N + 2 | MEDIUM | Complex multi-part queries | Bad decomposition |
| 08 | LEAST-TO-MOST | Easy-to-Hard chain | N questions | N + 1 | MEDIUM | Progressive understanding | Ordering quality |
| 09 | RECURSIVE | Code gen + exec | 1-8 steps | 1-8 | SLOW | Computation, iteration | Code safety |
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a', 'clusterBkg': '#0d0d0d', 'clusterBorder': '#00ff41', 'titleColor': '#00ff41' }}}%%
graph LR
A["QUERY
Oracle AI Vector Search
advantages for RAG?"] --> B["GENERATE
Single LLM call"]
B --> C["ANSWER
Direct response"]
style A fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style B fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style C fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph LR
Q["QUERY"] --> S1["Step 1
Identify what
Vector Search is"]
S1 --> S2["Step 2
List RAG
requirements"]
S2 --> S3["Step 3
Map advantages
to requirements"]
S3 --> S4["Step 4
Compare with
alternatives"]
S4 --> A["ANSWER
Synthesized
conclusion"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style S1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S4 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style A fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> A1["Option A
Focus on architecture
Score: 0.82"]
Q --> B1["Option B
Focus on performance
Score: 0.71"]
A1 --> A2["A.1
Unified DB layer
Score: 0.88"]
A1 --> A3["A.2
SQL integration
Score: 0.79"]
B1 --> B2["B.1
HNSW indexing
Score: 0.74"]
B1 --> B3["B.2
Batch processing
Score: 0.65"]
A2 --> A4["A.1.1 BEST
Score: 0.91"]
A2 --> A5["A.1.2
Score: 0.77"]
A3 --> A6["A.2.1
Score: 0.72"]
A3 --> A7["A.2.2
Score: 0.68"]
A4 --> F["FINAL ANSWER
Best path synthesis"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style A1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style B1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style A2 fill:#003300,stroke:#00ff41,stroke-width:1px,color:#00ff41
style A3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style B2 fill:#1a1a00,stroke:#555500,stroke-width:1px,color:#888844
style B3 fill:#1a1a00,stroke:#555500,stroke-width:1px,color:#888844
style A4 fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style A5 fill:#1a1a00,stroke:#555500,stroke-width:1px,color:#888844
style A6 fill:#1a1a00,stroke:#555500,stroke-width:1px,color:#888844
style A7 fill:#1a1a00,stroke:#555500,stroke-width:1px,color:#888844
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> T1["Thought 1
I need to understand
Oracle's vector capabilities"]
T1 --> A1["Action
search[Oracle AI
Vector Search features]"]
A1 --> O1["Observation
(system returns results)"]
O1 --> T2["Thought 2
Now I need RAG-specific
advantages"]
T2 --> A2["Action
search[Oracle vector
search RAG benefits]"]
A2 --> O2["Observation
(system returns results)"]
O2 --> T3["Thought 3
I have enough context
to answer"]
T3 --> F["Final Answer"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style T1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style T2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style T3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style A1 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style A2 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style O1 fill:#001a1a,stroke:#00ffcc,stroke-width:1px,color:#00ffcc
style O2 fill:#001a1a,stroke:#00ffcc,stroke-width:1px,color:#00ffcc
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> D1["Draft v1
Initial answer"]
D1 --> C1{"Critique
CORRECT?"}
C1 -->|"NO: missing
security aspects"| R1["Refine v2
Add security
details"]
R1 --> C2{"Critique
CORRECT?"}
C2 -->|"NO: missing
cost comparison"| R2["Refine v3
Add cost
analysis"]
R2 --> C3{"Critique
CORRECT?"}
C3 -->|"YES"| F["FINAL ANSWER
Refined v3 accepted"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style D1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style C1 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style C2 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style C3 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style R1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style R2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> S1["Sample 1
t=0.7
Unified storage"]
Q --> S2["Sample 2
t=0.7
SQL integration"]
Q --> S3["Sample 3
t=0.7
Unified storage"]
Q --> S4["Sample 4
t=0.7
Unified storage"]
Q --> S5["Sample 5
t=0.7
ACID compliance"]
S1 --> V["MAJORITY VOTE
Counter analysis"]
S2 --> V
S3 --> V
S4 --> V
S5 --> V
V --> F["WINNER
Unified storage (3/5)"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style S1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S4 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S5 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style V fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> D["DECOMPOSE
Break into sub-tasks"]
D --> T1["Task 1
What is Oracle AI
Vector Search?"]
D --> T2["Task 2
What does RAG
require?"]
D --> T3["Task 3
What are the
advantages?"]
T1 -->|"result 1"| T2
T2 -->|"result 1+2"| T3
T3 --> S["SYNTHESIZE
Combine all results
into final answer"]
S --> F["FINAL ANSWER"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style D fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style T1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style T2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style T3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style S fill:#001a1a,stroke:#00ffcc,stroke-width:1px,color:#00ffcc
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph LR
Q["QUERY"] --> D["DECOMPOSE
Order by difficulty"]
D --> E1["EASY
What is vector
search?"]
E1 -->|"+ answer 1"| E2["MEDIUM
What is RAG
architecture?"]
E2 -->|"+ answer 1,2"| E3["HARD
How does Oracle
vector search help
RAG specifically?"]
E3 -->|"+ answer 1,2,3"| E4["HARDEST
What unique advantages
does it have over
alternatives?"]
E4 --> F["FINAL
= Last answer"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style D fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style E1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style E2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style E3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style E4 fill:#003300,stroke:#00ff41,stroke-width:1px,color:#00ff41
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
Q["QUERY"] --> G1["Generate Code 1
aspects = sub_llm(...)"]
G1 --> X1["exec()
Run Python code"]
X1 --> O1["Observation
print output captured"]
O1 --> G2["Generate Code 2
details = sub_llm(...)
for aspect in aspects"]
G2 --> X2["exec()
Run Python code"]
X2 --> O2["Observation
detailed results"]
O2 --> G3["Generate Code 3
FINAL_ANSWER = ..."]
G3 --> X3["exec()
Run Python code"]
X3 --> F["FINAL_ANSWER
extracted from env"]
style Q fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style G1 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style G2 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style G3 fill:#0a3d0a,stroke:#39ff14,stroke-width:1px,color:#39ff14
style X1 fill:#1a0000,stroke:#ff3333,stroke-width:1px,color:#ff3333
style X2 fill:#1a0000,stroke:#ff3333,stroke-width:1px,color:#ff3333
style X3 fill:#1a0000,stroke:#ff3333,stroke-width:1px,color:#ff3333
style O1 fill:#001a1a,stroke:#00ffcc,stroke-width:1px,color:#00ffcc
style O2 fill:#001a1a,stroke:#00ffcc,stroke-width:1px,color:#00ffcc
style F fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
├── Axes: Speed (10=fastest), Depth (10=deepest reasoning), Accuracy (10=highest expected), Cost (10=cheapest), Explainability (10=most transparent)
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#003300', 'primaryTextColor': '#00ff41', 'primaryBorderColor': '#00ff41', 'lineColor': '#39ff14', 'secondaryColor': '#0a3d0a', 'tertiaryColor': '#0a0a0a', 'edgeLabelBackground': '#0a0a0a' }}}%%
graph TD
START["INCOMING QUERY"] --> Q1{"Need external
data/tools?"}
Q1 -->|"YES"| REACT["ReAct
Tool-augmented"]
Q1 -->|"NO"| Q2{"Simple
factual?"}
Q2 -->|"YES"| STD["Standard
Direct call"]
Q2 -->|"NO"| Q3{"Need high
accuracy?"}
Q3 -->|"YES"| Q4{"Budget for
5x calls?"}
Q4 -->|"YES"| SC["Self-Consistency
Majority vote"]
Q4 -->|"NO"| SR["Self-Reflection
Draft + Refine"]
Q3 -->|"NO"| Q5{"Multi-part
question?"}
Q5 -->|"YES"| Q6{"Need synthesis
step?"}
Q6 -->|"YES"| DEC["Decomposed
Split + Merge"]
Q6 -->|"NO"| LTM["Least-to-Most
Easy to Hard"]
Q5 -->|"NO"| Q7{"Need to explore
alternatives?"}
Q7 -->|"YES"| TOT["Tree of Thoughts
BFS + Prune"]
Q7 -->|"NO"| Q8{"Need
computation?"}
Q8 -->|"YES"| REC["Recursive
Code Gen"]
Q8 -->|"NO"| COT["Chain-of-Thought
Step-by-step"]
style START fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style Q1 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q2 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q3 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q4 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q5 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q6 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q7 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style Q8 fill:#1a1a00,stroke:#ffb000,stroke-width:1px,color:#ffb000
style STD fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style COT fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style TOT fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style REACT fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style SR fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style SC fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style DEC fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style LTM fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41
style REC fill:#003300,stroke:#00ff41,stroke-width:2px,color:#00ff41