How dhananjaylab/oracle-mcp works
Project type and purpose
• From the file list and README, this is a Python-based backend/data-processing pipeline with a small REST service layer.
• Its purpose is to:
• Provision and seed a relational database (SQL scripts + setup_database.py)
• Ingest and vectorize product/invoice data (process_vector_products.py, various *.sql inserts)
• Offer search and invoice-item services via lightweight Python servers (product_search.py, server_invoice_items.py, main.py orchestrator)
File structure
─ Top-level Python modules:
• setup_database.py – creates schema (reads script.sql)
• oracle_conn.py – database connection wrapper
• process_vector_products.py – transforms product data into vector embeddings
• product_search.py – implements similarity search queries
• server_invoice_items.py – serves invoice-item lookups
• main.py – possible entry-point/orchestrator to launch services or batch processes
• setup.ipynb – exploratory notebook for initial setup/demo
─ SQL artifacts:
• Schema and seed scripts (script.sql, inserts_products_books.sql, invoice_data_insert.sql, similarity_search.sql)
─ Config/dependencies: requirements.txt
README
a. Main components
1. Database layer (Oracle or RDBMS)
2. Data Ingestion & Provisioning module
3. Vectorization & Indexing module
4. Search & Invoice-Item API services
5. Optional: Orchestration layer (main.py)
6. Development notebook (setup.ipynb)
7. External libraries/services (e.g., vector embedding library, Oracle client)
b. Relationships & interactions
• Data Ingestion → Database (via oracle_conn.py)
• Vectorization module reads from DB, produces embeddings, writes back or to a vector index table
• Search API queries the vector index table (and invoice tables) to serve client requests
• Orchestrator may trigger ingestion, vectorization, and launch servers
• The notebook is a side-channel for manual setup or experimentation
c. Architectural patterns & design principles
• Separation of concerns: ingestion vs. processing vs. serving
• Single responsibility per Python module
• SQL scripts handle DDL/DML, Python code handles orchestration and logic
• Potential batch + microservice hybrid (batch vector processing + lightweight REST)
d. Key technologies/frameworks
• Python 3.x
• Oracle (or another RDBMS) via cx_Oracle or similar
• Vector embedding library (e.g., SentenceTransformers, if used in process_vector_products.py)
• Flask/FastAPI (or built-in HTTP server) in product_search.py & server_invoice_items.py
• Jupyter for exploratory tasks