Semiconductor Component RAG Search

Semiconductor Component RAG Search

Enables semantic search and question-answering over semiconductor component data stored in Excel files using ChromaDB vector database and HuggingFace language models through a RAG pipeline.

Category
Visit Server

README

MCP-Based RAG System for Semiconductor Component Search

This project demonstrates MCP (Model Context Protocol) integration with ChromaDB and HuggingFace models for Retrieval-Augmented Generation (RAG).

Project Overview

This system shows how MCP works and its purpose:

  • MCP provides a standardized protocol for context retrieval
  • ChromaDB stores and retrieves semantic embeddings
  • RAG Pipeline combines retrieval with LLM generation
  • Backend API allows document upload and question-answering

Architecture

User Question → API Endpoint → RAG Pipeline
                                    ↓
                    Retrieval from ChromaDB (via embeddings)
                                    ↓
                    LLM generates answer with context
                                    ↓
                    Response to user

Key Components

  1. MCP Server (mcp_server.py): Demonstrates MCP protocol for structured context retrieval
  2. RAG Pipeline (rag_pipeline.py): Handles embeddings (encoding) and LLM (decoding)
  3. FastAPI Backend (main.py): REST API for document upload and Q&A
  4. ChromaDB: Vector database for semantic search

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Set environment variables: Create a .env file or use the provided HF API key in config.py

  2. Create example Excel file:

python create_example_excel.py

Usage

1. Start the API Server

python main.py

The API will be available at http://localhost:8000

2. Upload Excel Document

curl -X POST "http://localhost:8000/upload" \
  -H "accept: application/json" \
  -F "file=@examples/semiconductor_components.xlsx"

Or use the FastAPI docs at http://localhost:8000/docs

3. Ask Questions

curl -X POST "http://localhost:8000/ask" \
  -H "Content-Type: application/json" \
  -d '{"question": "What MOSFET components are available?", "n_results": 3}'

API Endpoints

  • GET / - API information
  • GET /health - Health check
  • POST /upload - Upload Excel document
  • POST /ask - Ask a question
  • GET /info - Get collection information

How MCP Works

MCP (Model Context Protocol) serves as a standardized interface for:

  • Context Retrieval: Structured way to query and retrieve relevant information
  • Tool Definition: Clear specification of available operations
  • Protocol Communication: Standardized communication between components

In this project:

  1. MCP server defines tools for querying ChromaDB
  2. RAG pipeline uses MCP principles for context retrieval
  3. Backend integrates MCP concepts for document processing

Models Used

  • Encoding (Embeddings): sentence-transformers/all-MiniLM-L6-v2
  • Decoding (LLM): Llama model from HuggingFace (or fallback to GPT-2)

Example Questions

  • "What MOSFET components are available?"
  • "Show me voltage regulators from Texas Instruments"
  • "What components work with 5V?"
  • "List all temperature sensors"

Project Structure

MCP2/
├── main.py                 # FastAPI backend
├── rag_pipeline.py         # RAG pipeline with embeddings & LLM
├── mcp_server.py          # MCP server for ChromaDB
├── config.py              # Configuration
├── create_example_excel.py # Generate example data
├── requirements.txt       # Dependencies
├── examples/              # Example Excel files
└── chroma_db/            # ChromaDB storage (created automatically)

Notes

  • First run will download models from HuggingFace (requires API key)
  • ChromaDB data persists in ./chroma_db/ directory
  • Uploaded files are stored in ./uploads/ directory

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured