Showing posts with label AI_Automation. Show all posts
Showing posts with label AI_Automation. Show all posts

Type of RAG in Generative AI : Naive RAG


Types of RAG (Generative AI)


1: Foundations Naive RAG, Simple RAG (Original), Simple RAG with Memory Foundations
2: Optimization Advanced RAG (Hybrid+Reranking), Modular RAG, HyDE Pipeline
3: Self-Reflective Self-RAG (Critique Tokens), Corrective RAG (CRAG), Adaptive RAG Evaluation
4: Multi-Path & Entities Agentic RAG, Graph RAG (Knowledge Graphs), Branched RAG, Speculative RAG Complex Reasoning
5: Multimodal Vision-Language Models, Visual Document Embedding (ColPali/CLIP) Cross-Modal
6: Matrix & Comparison Comprehensive 14-Architecture Comparison Table (Cost, Latency, Use Cases) Cheat Sheet
7: Production Template End-to-End Advanced RAG Pipeline with ChromaDB & FlashRank Reranker Full Implementation

1: Foundational RAG Architectures

1.1 Naive RAG

Architectural Concept: Single-step dense vector retrieval and direct prompt generation without filtering, reranking, or query translation.

Implementation Workflow: Document Ingestion → Text Chunking (e.g., 500 tokens) → Embedding Generation → Cosine Similarity Search → Top-k Prompt Injection → LLM Generation.

Pros & Cons:
    Pros: Extremely fast response time, minimal computational overhead, simple to build and understand.
    Cons: No relevance verification, vulnerable to irrelevant context injection and hallucinations on ambiguous queries.

Algorithm & Pseudo-Code — Naive RAG

  • Input: Query Q, Vector Database V, LLM
  • Output: Answer A



Connect MySQL database and read content of table using N8N

Requirement:

Connect MySQL database and read content of table using N8N

Pre-requisites:

  • n8n tools is installed
  • mysql database is installed and accessible

Brief description of flow :

  • here , the flow is triggered with a chat.
  • In chat, the table name (only one) is given in "" (double quotes)
  • Extract table name from the chat input
  • Identify the table is present in database or not, using mysql node
  • If table is present, extract the table content
    • Extract the content of that table and send content in chat.
  • If table is not present, send message back to chat "This table xxxx is not present in database""

Flow diagram is as following;






Connect oracle database with n8n

Requirement: In automation tool n8n, we want a node to connect with oracle database

Pre-requisites:

Install the NPM package

Package name : n8n-nodes-oracle-database-parameterization

Command to install  

npm install n8n-nodes-oracle-database-parameterization


Set the environment variable:

export N8N_RUNNERS_ENABLED=trueexport N8N_CUSTOM_EXTENSIONS=$(pwd)/node_modules/n8n-nodes-oracle-database-parameterizatio


        Start the n8n server: 

                    n8n start 

Search