0

Total Documents

0

With Embeddings

0%

Progress

-

Last Search (ms)

CSV Upload & Processing
Drop CSV file here or click to browse

Supports CSV files with agricultural data

CSV Processing Queue
Queue Status:
Idle
Queue Length: 0 files
Queue (Empty)

No CSV files in queue

Background Embedding Manager
Status:
Not Running
Progress:
0%
Configuration
Processing...
System Logs
System ready. Upload a CSV file to get started.
Semantic Search
Quick Searches:
Search Results
0 results

Enter a search query to see results

API Documentation

Complete API reference for the Semantic Search CSV Manager

Base URL
http://localhost:8080

Returns server status and available endpoints.

Request
GET /
Response
{
  "message": "🚀 Semantic Search CSV Manager is running!",
  "status": "healthy",
  "embeddingsReady": true,
  "endpoints": {
    "uploadCSV": "POST /api/upload-csv",
    "search": "POST /api/search",
    "searchFallback": "POST /api/search-fallback",
    "generateEmbeddings": "POST /api/generate-embeddings",
    "status": "GET /api/status"
  }
}

Get detailed system status including database stats and embedding progress.

Request
GET /api/status
Response
{
  "status": "healthy",
  "database": {
    "connected": true,
    "totalDocuments": 50000,
    "documentsWithEmbeddings": 45000,
    "embeddingProgress": "90.0%"
  },
  "embeddingsReady": true,
  "isInitializing": false
}

Upload and process a CSV file containing agricultural data.

Request
Method: POST /api/upload-csv
Content-Type: multipart/form-data
Body: Form data with file field named csvFile
Expected CSV Headers
Column Type Description
StateName String Name of the state
DistrictName String Name of the district
BlockName String Name of the block
Season String Agricultural season
Sector String Agricultural sector
Category String Query category
Crop String Crop name
QueryType String Type of query
QueryText String The actual query text
KccAns String Answer/response text
CreatedOn Date Creation date
year Number Year
month Number Month
Success Response
{
  "success": true,
  "message": "CSV uploaded and processed successfully",
  "totalProcessed": 49999,
  "totalInserted": 49999
}
Error Response
{
  "error": "CSV upload failed",
  "message": "No file uploaded"
}

Start the asynchronous process of generating embeddings for all documents in the database.

Request
Method: POST /api/generate-embeddings
Content-Type: application/json
Body: Empty or {}
Response
{
  "success": true,
  "message": "Embedding generation started. Check /api/status for progress.",
  "note": "This is an asynchronous process that may take several minutes."
}
Note: This process runs in the background. Monitor progress using the /api/status endpoint.
Common Error Codes
Status Code Error Type Description
400 Bad Request Missing required parameters or invalid request format
404 Not Found Endpoint does not exist
500 Internal Server Error Server error during processing
503 Service Unavailable Semantic search module not available
Rate Limits & Performance
  • CSV Upload: Max file size 50MB
  • Search Requests: No rate limit (local server)
  • Vector Search: ~50-200ms response time
  • Fallback Search: ~500-2000ms response time
  • Embedding Generation: ~1-5 minutes for 50k documents
cURL Examples
Search Request
curl -X POST http://localhost:8080/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "crop disease management techniques",
    "topK": 10,
    "filters": {
      "StateName": "Karnataka",
      "Category": "Disease Management"
    }
  }'
Status Check
curl -X GET http://localhost:8080/api/status
Generate Embeddings
curl -X POST http://localhost:8080/api/generate-embeddings \
  -H "Content-Type: application/json" \
  -d '{}'