{"id":27211980,"url":"https://github.com/chefski/phonesearchai","last_synced_at":"2025-04-10T01:56:03.609Z","repository":{"id":286068270,"uuid":"955233479","full_name":"Chefski/phoneSearchAI","owner":"Chefski","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-02T08:09:45.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T06:36:13.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chefski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-26T10:17:41.000Z","updated_at":"2025-04-02T08:12:32.000Z","dependencies_parsed_at":"2025-04-04T06:36:14.861Z","dependency_job_id":"aa725787-d74f-46c2-9293-8f134ff260b9","html_url":"https://github.com/Chefski/phoneSearchAI","commit_stats":null,"previous_names":["chefski/phonesearchai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chefski%2FphoneSearchAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chefski%2FphoneSearchAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chefski%2FphoneSearchAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chefski%2FphoneSearchAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chefski","download_url":"https://codeload.github.com/Chefski/phoneSearchAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142940,"owners_count":21054671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-10T01:56:03.080Z","updated_at":"2025-04-10T01:56:03.593Z","avatar_url":"https://github.com/Chefski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhoneSearchAI\n\nA powerful API for retrieving detailed smartphone specifications and comparing different phone models using AI-powered search and analysis.\n\n## Overview\n\nPhoneSearchAI is a FastAPI-based application that leverages Large Language Models (LLMs) and vector search to provide detailed information about smartphones. The system uses Ollama for local LLM inference and Tavily Search API for retrieving up-to-date information from the web.\n\n## Features\n\n- **Detailed Phone Specifications**: Get comprehensive technical details about any smartphone model\n- **Phone Comparison**: Compare multiple phones with detailed analysis of their differences\n- **Focus-Based Analysis**: Request information about specific aspects (camera, display, performance, etc.)\n- **Real-time Streaming**: Stream responses as they're being generated for a better user experience\n- **Source Attribution**: All information comes with source URLs for verification\n\n## Requirements\n\n- Python 3.8+\n- [Ollama](https://ollama.ai/) installed and running locally\n- Tavily API key\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/phoneSearchAI.git\n   cd phoneSearchAI\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Set up environment variables:\n   - Copy `.env.example` to `.env`\n   - Add your Tavily API key to the `.env` file\n\n4. Make sure Ollama is running with the required models:\n   ```bash\n   # For specs search\n   ollama pull llama3.1\n   \n   # For comparison search\n   ollama pull qwen2.5\n   ```\n\n## Usage\n\nStart the API server:\n\n```bash\npython api.py\n```\n\nThe API will be available at `http://localhost:8080`.\n\n## API Endpoints\n\n### Get Phone Specifications\n\n```http\nPOST /specs\n```\n\nRequest body:\n```json\n{\n  \"query\": \"iPhone 15 Pro\"\n}\n```\n\nResponse:\n```json\n{\n  \"specifications\": \"Detailed specifications in formatted text\",\n  \"query\": \"iPhone 15 Pro\",\n  \"sources\": [\"https://example.com/source1\", \"https://example.com/source2\"]\n}\n```\n\n### Stream Phone Specifications\n\n```http\nPOST /specs/stream\n```\n\nRequest body:\n```json\n{\n  \"query\": \"iPhone 15 Pro\"\n}\n```\n\nReturns a stream of JSON objects with real-time updates.\n\n### Compare Phones\n\n```http\nPOST /compare\n```\n\nRequest body:\n```json\n{\n  \"phones\": [\"iPhone 15 Pro\", \"Samsung Galaxy S24\"],\n  \"focus\": \"camera\",\n  \"max_sources\": 4\n}\n```\n\nResponse:\n```json\n{\n  \"comparison\": \"Detailed comparison with analysis and comparison table\",\n  \"phones\": [\"iPhone 15 Pro\", \"Samsung Galaxy S24\"],\n  \"focus\": \"camera\",\n  \"sources\": [\"https://example.com/source1\", \"https://example.com/source2\"]\n}\n```\n\n### Stream Phone Comparison\n\n```http\nPOST /compare/stream\n```\n\nRequest body:\n```json\n{\n  \"phones\": [\"iPhone 15 Pro\", \"Samsung Galaxy S24\"],\n  \"focus\": \"camera\",\n  \"max_sources\": 4\n}\n```\n\nReturns a stream of JSON objects with real-time updates.\n\n### Health Check\n\n```http\nGET /health\n```\n\nReturns the status of the API and its services.\n\n## How It Works\n\n1. **Web Search**: The system uses Tavily Search API to find relevant information about the requested phones\n2. **Content Scraping**: It scrapes the content from the search results\n3. **Vector Embedding**: The content is split into chunks and embedded into a vector store\n4. **RAG Pipeline**: A Retrieval-Augmented Generation pipeline retrieves relevant information and passes it to the LLM\n5. **LLM Processing**: The LLM generates a detailed response based on the retrieved information\n\n## Architecture\n\n- `api.py`: FastAPI application with endpoint definitions\n- `specsSearch.py`: Logic for retrieving and processing phone specifications\n- `compareSearch.py`: Logic for comparing multiple phone models\n\n## License\n\nThis project is licensed under the terms of the license included in the repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchefski%2Fphonesearchai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchefski%2Fphonesearchai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchefski%2Fphonesearchai/lists"}