Skip to main content

Intelligent data matching library with LLM-powered natural language responses

Project description

pyprik

pyprik is an intelligent data matching library that finds the best matching items based on your requirements. The library includes Large Language Model (LLM) integration for natural language responses and conversational search capabilities.

Features

  • Intelligent Data Matching: Advanced algorithms for finding relevant items in datasets
  • LLM Integration: Natural language responses for search results
  • Conversational Search: Search using natural language queries
  • Smart Explanations: Detailed explanations of why certain results were matched
  • REST API Server: FastAPI server with intelligent endpoints
  • Multi-LLM Support: Compatible with OpenAI GPT and Google Gemini models
  • Agent Architecture: Modular design with dedicated agent components

Installation

pip install pyprik

Quick Start

Basic Data Matching

from pyprik import find_top_matching
import pandas as pd

# Your data
data = {
    'Product': ['Laptop', 'Smartphone', 'Tablet'],
    'Brand': ['Dell', 'Apple', 'Samsung'],
    'RAM': ['8GB', '4GB', '6GB'],
    'Price': [600, 999, 300]
}
products = pd.DataFrame(data)

# Find matches
requirements = {'Brand': 'Apple', 'RAM': '4GB'}
results = find_top_matching(products, requirements, top_n=2)
print(results)

Agent-Based Server

from pyprik.agent import serveragent

# Start server
serveragent.run_server(host="127.0.0.1", port=8000)

# Or create server instance
server = serveragent.create_server_agent()

LLM-Enhanced Search

from pyprik import smart_product_search, setup_default_llm

# Setup LLM (requires API key)
setup_default_llm('openai', 'gpt-3.5-turbo')

# Get natural language response
response = smart_product_search(
    dataset=products,
    requirements={'Brand': 'Apple'},
    top_n=3,
    natural_response=True
)
print(response)

REST API Server

Start an intelligent search server:

from pyprik.agent import serveragent
serveragent.run_server(host="127.0.0.1", port=8000)

API Endpoints

  • POST /search - Intelligent product search
  • POST /conversational-search - Natural language search
  • POST /explain - Explain search results
  • POST /configure-llm - Configure LLM settings
  • POST /upload-dataset - Upload your dataset
  • GET /dataset-info - Get dataset information

LLM Configuration

  1. Get an API Key:

  2. Set Environment Variable:

    # For OpenAI
    export OPENAI_API_KEY="your-api-key-here"
    
    # For Gemini
    export GEMINI_API_KEY="your-api-key-here"
    
  3. Install Optional Dependencies (if not auto-installed):

    pip install openai google-generativeai fastapi uvicorn
    

Core Functions

Data Matching Functions

  • find_top_matching(dataset, requirements, top_n) - Find best matches
  • find_matching(dataset, requirements) - Get all matches with scores

LLM Functions

  • smart_product_search() - Enhanced search with LLM responses
  • conversational_search() - Natural language search
  • explain_search_results() - Detailed explanations
  • setup_default_llm() - Configure LLM settings

Server Functions

  • run_server() - Start FastAPI server
  • create_server_agent() - Create server instance

Use Cases

  • E-commerce: Find products matching specific criteria
  • Real Estate: Search properties with natural language
  • Job Matching: Match candidates to positions
  • Product Catalogs: Intelligent product recommendations
  • Data Analysis: Understand matching algorithms and results

License

MIT License - see LICENSE.txt for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyprik-0.2.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyprik-0.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file pyprik-0.2.1.tar.gz.

File metadata

  • Download URL: pyprik-0.2.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for pyprik-0.2.1.tar.gz
Algorithm Hash digest
SHA256 68c8b472ecd5de3149dba1114672ba55366d8c08f93c6d9e4ea9999c9bad987f
MD5 13b329de9a3c40e50ee0e7a3d87f6781
BLAKE2b-256 dea8fc7816771c3ae5134d4d3e495e9125d2de0446afd3b16e4803c405dcc6ac

See more details on using hashes here.

File details

Details for the file pyprik-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyprik-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for pyprik-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d02629987e409dfc69ae1343b23029aa76160e440582275be8f842c4b2d32d7
MD5 b5bc6674e038460af0f90d56aa26a3a4
BLAKE2b-256 a000910787e22398f29fda43d431c2ccd7af5a5cb8f908c45d3a961d2f17f406

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page