Perplexica/README.md

121 lines
2.1 KiB
Markdown
Raw Normal View History

# BizSearch
2024-04-09 16:21:05 +05:30
A tool for finding and analyzing local businesses using AI-powered data extraction.
2024-12-16 20:59:21 +05:30
## Prerequisites
2024-12-16 20:59:21 +05:30
- Node.js 16+
- Ollama (for local LLM)
- SearxNG instance
2024-04-09 16:21:05 +05:30
## Installation
1. Install Ollama:
```bash
# On macOS
brew install ollama
```
2. Start Ollama:
```bash
# Start and enable on login
brew services start ollama
# Or run without auto-start
/usr/local/opt/ollama/bin/ollama serve
```
3. Pull the required model:
```bash
ollama pull mistral
```
4. Clone and set up the project:
```bash
git clone https://github.com/yourusername/bizsearch.git
cd bizsearch
npm install
```
5. Configure environment:
```bash
cp .env.example .env
# Edit .env with your settings
```
6. Start the application:
```bash
npm run dev
```
7. Open http://localhost:3000 in your browser
## Troubleshooting
If Ollama fails to start:
```bash
# Stop any existing instance
brew services stop ollama
# Wait a few seconds
sleep 5
# Start again
brew services start ollama
```
To verify Ollama is running:
```bash
curl http://localhost:11434/api/version
```
2024-04-09 16:21:05 +05:30
## Features
2024-10-17 10:01:00 +05:30
- Business search with location filtering
- Contact information extraction
- AI-powered data validation
- Clean, user-friendly interface
- Service health monitoring
2024-10-17 10:01:00 +05:30
## Configuration
Key environment variables:
- `SEARXNG_URL`: Your SearxNG instance URL
- `OLLAMA_URL`: Ollama API endpoint (default: http://localhost:11434)
- `SUPABASE_URL`: Your Supabase project URL
- `SUPABASE_ANON_KEY`: Your Supabase anonymous key
- `CACHE_DURATION_DAYS`: How long to cache results (default: 7)
## Supabase Setup
2024-04-09 16:21:05 +05:30
1. Create a new Supabase project
2. Run the SQL commands in `db/init.sql` to create the cache table
3. Copy your project URL and anon key to `.env`
2024-04-09 16:21:05 +05:30
## License
2024-04-14 13:19:07 +05:30
MIT
2024-05-07 13:03:06 +05:30
## Cache Management
2024-05-07 13:03:06 +05:30
The application uses Supabase for caching search results. Cache entries expire after 7 days.
2024-05-07 13:03:06 +05:30
### Manual Cache Cleanup
2024-04-14 13:19:07 +05:30
If automatic cleanup is not available, you can manually clean up expired entries:
2024-04-09 16:21:05 +05:30
1. Using the API:
```bash
curl -X POST http://localhost:3000/api/cleanup
```
2024-04-09 16:21:05 +05:30
2. Using SQL:
```sql
select manual_cleanup();
```
2024-04-09 16:21:05 +05:30
### Cache Statistics
2024-04-09 16:21:05 +05:30
View cache statistics using:
```sql
select * from cache_stats;
```