Skip to content
/ phonox Public

Phonox is an intelligent assistant designed specifically for vinyl record collectors. Our mission is to simplify the management and enjoyment of your vinyl collection through innovative technology and user-friendly features.

License

Notifications You must be signed in to change notification settings

Hoshi42/phonox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

159 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ•”β• 
 β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— 
 β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•—
 β•šβ•β•     β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•

AI-powered Vinyl Collection Agent – Cataloguing, Valuation, and Documentation


What is Phonox?

Phonox is an intelligent assistant for vinyl record collectors. It helps you:

  • πŸ“Έ Identify records by snapping photos or uploading images
  • πŸ’° Get valuations using multiple data sources (Discogs, MusicBrainz)
  • 🎡 Find Spotify links for listening to your collection
  • πŸ“ Organize your collection with metadata, ratings, and notes
  • πŸ’¬ Chat about records with an AI agent that remembers your collection

πŸ–ΌοΈ See it in action β†’ UI Gallery & feature walkthrough πŸ“ Blog β†’ phonox-blog.web.app

Perfect for collectors managing large vinyl libraries or insuring valuable collections.


Prerequisites

Before you start, make sure you have:

  1. Docker & Docker Compose installed

  2. Git (to clone the repository)

  3. API Keys (optional but recommended)


Quick Start (3 Simple Steps)

1. Clone the Repository

git clone https://github.com/yourusername/phonox.git
cd phonox

2. Setup Environment with API Key

# Copy the environment template
cp .env.example .env

# Add your Anthropic API key
./phonox-cli configure --anthropic YOUR_ANTHROPIC_KEY

Get your API key: console.anthropic.com

3. Install and Start

# Make executable and run (installs + starts everything)
chmod +x start-cli.sh
./start-cli.sh

The start-cli.sh script will:

  • βœ… Build Docker images
  • βœ… Start all services (database, backend, frontend)
  • βœ… Initialize the database

Done! Open your browser:


Key Environment Variables

The .env file contains all configuration. Key variables:

Variable Required Description
ANTHROPIC_API_KEY βœ… Yes Claude AI API key from console.anthropic.com
TAVILY_API_KEY ⚠️ Optional Web search API key from tavily.com
DATABASE_URL βœ… Pre-configured PostgreSQL connection (auto-configured for Docker)

For all configuration options, see .env.example


How to Use Phonox

Identify a Vinyl Record

  1. Click "Upload Image" on the home page
  2. Take a photo or upload an image of:
    • The album cover (front or back)
    • The barcode (if visible)
    • The vinyl itself (for condition assessment)
  3. Phonox AI will:
    • Scan for the barcode
    • Search Discogs and MusicBrainz
    • Extract album metadata automatically
  4. Review the results and save to your collection

Manage Your Collection

  1. Visit "Register" to see all your vinyl records
  2. Edit any record to:
    • Add notes or condition notes
    • Add Spotify link
    • Update valuation
    • Rate the record
  3. Delete records from your collection
  4. Export your collection (future feature)

Chat with the Agent

  1. Open the Chat panel on the right
  2. Ask questions about your collection:
    • "What's my rarest record?"
    • "Show me all records from the 80s"
    • "What's the total value of my collection?"
  3. The agent remembers context from your collection

How to Stop, Start, and Manage Services

Start Services

./phonox-cli start
# or
docker compose up -d

Stop Services

./phonox-cli stop
# or
docker compose down

View Logs

docker compose logs -f backend
docker compose logs -f frontend

Check Service Status

./phonox-cli status
# or
curl http://localhost:8000/health

Phonox CLI Commands

Full CLI Reference:

# Install (build Docker images)
./phonox-cli install

# Install + start services
./phonox-cli install --up

# Configure API keys and models
./phonox-cli configure --anthropic YOUR_KEY --tavily YOUR_KEY

# Configure Anthropic models (for advanced users)
./phonox-cli configure --vision-model claude-sonnet-4-6
./phonox-cli configure --chat-model claude-haiku-4-5-20251001

# Start services
./phonox-cli start

# Stop services
./phonox-cli stop

# Backup your data
./phonox-cli backup

# Restore from backup (use timestamp from backup folder)
./phonox-cli restore 20260128_143000

Interactive Menu

Run without arguments to launch interactive menu:

./phonox-cli
# Shows menu with all options above

Troubleshooting & Maintenance

Common Issues

❌ "Port already in use" (8000 or 5173)

# Kill process using port 8000
lsof -i :8000 | grep LISTEN | awk '{print $2}' | xargs kill -9

# Or restart Docker
docker compose down
docker compose up -d

❌ "Database connection refused"

# Reset database
docker compose down -v
docker compose up -d

❌ Images not uploading

# Check upload folder permissions
ls -la data/uploads/

# Restart services
docker compose restart backend frontend

❌ API keys not working

# Verify .env file
cat .env

# Restart backend to reload keys
docker compose restart backend

Regular Maintenance

Backup Your Data (Weekly)

./phonox-cli backup
# Backups stored in: ./backups/

View Backup History

ls -lh backups/

Restore from a Backup

./phonox-cli restore 20260128_143000

Check Database Size

docker compose exec db psql -U phonox -d phonox -c "
  SELECT 
    schemaname,
    sum(pg_total_relation_size(schemaname||'.'||tablename)) AS size
  FROM pg_tables
  GROUP BY schemaname
  ORDER BY size DESC;"

View Vinyl Records in Database

docker compose exec db psql -U phonox -d phonox -c "
  SELECT id, title, artist, release_date, confidence, created_at
  FROM vinyl_records
  ORDER BY created_at DESC
  LIMIT 10;"

Testing

Run All Tests

docker compose exec backend pytest tests/ -v

Run Specific Test Categories

# Unit tests
docker compose exec backend pytest tests/unit -v

# Integration tests
docker compose exec backend pytest tests/integration -v

# With coverage report
docker compose exec backend pytest tests/ --cov=backend --cov-report=html

View Test Results

# Open coverage report
open htmlcov/index.html  # macOS
xdg-open htmlcov/index.html  # Linux
start htmlcov/index.html  # Windows

πŸ“– Getting Started

πŸ‘¨β€πŸ’» For Developers

πŸ—οΈ For Teams & Contributors

  1. Implementation Plan – Project roadmap and progress
  2. Contributing Guide – How to contribute code
  3. Agent Collaboration Instructions – Team workflow
  4. Deployment Guide – Production setup

Project Structure

phonox/
β”œβ”€β”€ README.md (this file)
β”œβ”€β”€ requirements.txt (Python dependencies)
β”œβ”€β”€ docker-compose.yml (Local development)
β”œβ”€β”€ Dockerfile.backend (FastAPI image)
β”œβ”€β”€ Dockerfile.frontend (Vite React image)
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ tech-stack.md
β”‚   β”œβ”€β”€ requirements_en.md
β”‚   └── .github/agents/
β”‚       β”œβ”€β”€ agent.md (Agent architecture)
β”‚       β”œβ”€β”€ architect.md (Architect role)
β”‚       β”œβ”€β”€ tools.md (Tool engineer role)
β”‚       β”œβ”€β”€ frontend.md (Frontend role)
β”‚       β”œβ”€β”€ deployment.md (Docker & CI/CD)
β”‚       β”œβ”€β”€ testing.md (Testing strategy)
β”‚       β”œβ”€β”€ implementation-plan.md (Roadmap)
β”‚       └── instructions.md (Collaboration guide)
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py (FastAPI entry point)
   β”œβ”€β”€ database.py (SQLAlchemy ORM)
   β”œβ”€β”€ agent/
   β”‚   β”œβ”€β”€ state.py (State models)
   β”‚   β”œβ”€β”€ graph.py (LangGraph workflow)
   β”‚   β”œβ”€β”€ vision.py (Vision extraction)
   β”‚   β”œβ”€β”€ websearch.py (Web search integration)
   β”‚   β”œβ”€β”€ metadata.py (Metadata lookup)
   β”‚   └── barcode_utils.py (Barcode extraction)
   β”œβ”€β”€ api/
   β”‚   β”œβ”€β”€ routes.py (Identification endpoints)
   β”‚   β”œβ”€β”€ register.py (Register endpoints)
   β”‚   └── models.py (Pydantic models)
   β”œβ”€β”€ tools/
   β”‚   └── web_tools.py (Web search tools)
   └── tests/ (unit, integration, api tests)
β”‚
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ ImageUpload.tsx
    β”‚   β”‚   β”œβ”€β”€ ResultsView.tsx
    β”‚   β”‚   β”œβ”€β”€ ReviewForm.tsx
    β”‚   β”‚   β”œβ”€β”€ ChatPanel.tsx
    β”‚   β”‚   β”œβ”€β”€ VinylCard.tsx
    β”‚   β”‚   β”œβ”€β”€ VinylRegister.tsx
    β”‚   β”‚   └── AnalysisModal.tsx
    β”‚   └── App.tsx
    └── package.json

Architecture Overview (Technical Details)

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Frontend (React)                                        β”‚
β”‚ - Upload images                                         β”‚
β”‚ - View collection                                       β”‚
β”‚ - Chat with AI agent                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ HTTP
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Backend (FastAPI)                                       β”‚
β”‚ - AI Agent (LangGraph)                                  β”‚
β”‚ - Image Recognition                                     β”‚
β”‚ - Metadata Lookup                                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό            β–Ό            β–Ό
    Database    Discogs API   MusicBrainz
   (PostgreSQL)  (Metadata)    (Metadata)

Key Components

  • Agent – AI decision-maker using LangGraph orchestration
  • Tools – Plugins for Discogs, MusicBrainz, image extraction, web search
  • Database – PostgreSQL stores your vinyl collection
  • API – FastAPI provides endpoints for the frontend
  • Frontend – React PWA for mobile and desktop browsers

Tech Stack

  • Backend: Python 3.12, FastAPI, LangGraph, Pydantic v2, SQLAlchemy
  • Frontend: React (Vite), PWA, TypeScript
  • Database: PostgreSQL 16
  • Cache/Queue: Redis 7
  • API Sources: Discogs, MusicBrainz
    • Websearch: Tavily (if configured) + DuckDuckGo fallback
  • ML Models: ViT-base (image embeddings), Tesseract (OCR)
  • DevOps: Docker, Docker Compose, GitHub Actions

See Tech Stack Guide for details.



Need Help?

Common Questions

Q: I don't have an Anthropic API key. Can I still use Phonox?
A: No, Claude API is required. Get a free tier key at console.anthropic.com.

Q: Can I use Phonox without Docker?
A: Not recommended. Docker ensures all dependencies work correctly. If you must, install: Python 3.12, PostgreSQL 16, Redis 7, Node.js 18.

Q: How do I backup my vinyl collection?
A: Run ./phonox-cli backup weekly. Backups are stored in ./backups/.

Q: Can I run Phonox on my phone?
A: Yes! It's a Progressive Web App (PWA). Open http://localhost:5173 on your phone and tap "Install" or "Add to Home Screen".

Q: How do I import my existing vinyl spreadsheet?
A: Currently manual. We're working on CSV import (see roadmap). For now, use the UI to add records.

Get Support

  • πŸ“– Documentation: See links above
  • πŸ› Report Issues: Open an issue on GitHub
  • πŸ’¬ Discuss Features: Start a discussion
  • πŸ‘₯ Join Community: See CONTRIBUTING.md

What's New (Latest Version: 1.9.5)

✨ Version 1.9.5 (February 22, 2026)

  • Full curses arrow-key interactive menu β€” ↑/↓ navigation, white-on-blue selection bar
  • Per-service status panel: Frontend / Backend / DB each with own βœ”/✘ icon
  • Interactive configure with 6 masked keys (added Aggregation + Enhancement models)
  • Interactive restore: pick backup from list, confirm with yes
  • Collection management: rename collections directly from the CLI

✨ Version 1.9.4 (February 22, 2026)

  • Fixed false "Could not access images" warning in backup script β€” replaced hardcoded container name with docker compose cp service name

✨ Version 1.9.3 (February 21, 2026)

  • Fixed page reload when adding multiple images on Samsung Internet Browser (Android)

✨ Version 1.9.2 (February 21, 2026)

  • DuckDuckGo now supplements sparse Tavily results (configurable threshold via .env)
  • Added configurable search variables: WEBSEARCH_MAX_RESULTS, WEBSEARCH_MIN_RESULTS_THRESHOLD, WEBSEARCH_BARCODE_MAX_RESULTS
  • Memory-first image architecture: uploaded images are now the single source of truth in the UI
  • Actionable error messages surfaced directly from the backend (including clickable billing URLs)
  • Fixed CLI restart crash and unhealthy database detection
  • Fixed Anthropic credit-balance error being masked as an image format error
  • Fixed reanalysis dead-code path when backend restarts with no client-sent images

See CHANGELOG.md for complete history.


Status & Roadmap

Last Updated: 2026-02-22
Current Version: 1.9.5
Status: Production Ready βœ…

Completed Features

  • βœ… Image-based vinyl identification
  • βœ… Metadata lookup (Discogs, MusicBrainz)
  • βœ… AI-powered valuation
  • βœ… Web-based UI (mobile + desktop)
  • βœ… Spotify integration
  • βœ… Enhanced web search

Planned Features

  • πŸ”„ CSV import/export
  • πŸ”„ Barcode printing
  • πŸ”„ Collection insurance reports
  • πŸ”„ Social sharing
  • πŸ”„ Mobile app (iOS/Android)

See Implementation Plan for details.


License

This project is licensed under the MIT License - see LICENSE file for details.


Contributing

Contributions are welcome! Please see Contributing Guide for guidelines on how to get started, including:

  • Setting up your development environment
  • Git workflow and branching strategy
  • Code style and commit message conventions
  • Testing and validation procedures

Support

  • Issues & Feature Requests: GitHub Issues
  • Documentation: See docs/ folder for detailed technical documentation

Acknowledgments

About

Phonox is an intelligent assistant designed specifically for vinyl record collectors. Our mission is to simplify the management and enjoyment of your vinyl collection through innovative technology and user-friendly features.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published