Quantum Synchronicity Chatbot — README
Overview
This application provides a mystical-toned chat interface to log, analyze, and detect patterns in personal synchronicities. It integrates basic pattern recognition via TF-IDF and cosine similarity to compare new entries with past ones and optionally syncs your data to a Hugging Face Space repository.
Features
- Add synchronicity entries with tags and outcomes.
- Analyze entries to find similar past events and predict potential patterns.
- Export or reset your database.
- Optional automatic synchronization to Hugging Face Hub.
- CLI fallback mode when Gradio is unavailable.
Installation
Clone or copy the repository files:
git clone <your-repo-url> cd <repo-folder>Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows use: venv\\Scripts\\activateInstall dependencies:
pip install -r requirements.txtEnsure the following files exist:
synchronicities.jsoninitialized as:{"entries": []}.envfile (optional) containing:HF_TOKEN=your_huggingface_token HF_REPO=your_username/your_repo_name
Running the App
Option 1: Web Interface (Gradio)
python app.py
Then open the local URL displayed (e.g., http://127.0.0.1:7860) in your browser.
Option 2: Command Line Mode
If Gradio is not installed, you can use the CLI fallback:
python app.py
You’ll see prompts like:
> add # Add a new synchronicity entry
> export # Print database as JSON
> reset # Clear the database
> tests # Run basic internal tests
> exit # Quit
Environment Variables
HF_TOKEN— Your Hugging Face access token (for syncing data).HF_REPO— The name of your Hugging Face repository (e.g.,username/space-repo).
If you don’t plan to sync data, you can omit these.
Deployment to Hugging Face Space
Upload the following files to your Space:
app.pyrequirements.txtsynchronicities.jsonREADME.md
Add your
HF_TOKENandHF_REPOas Secrets under Space Settings.Set the SDK to Gradio and the
app_filetoapp.py.
Your app will automatically build and launch with a chat-style interface.
Tests
Run simple verification tests locally:
python app.py
> tests
If all tests pass, you’ll see “All tests passed.”
✨ The Oracle listens, remembers, and reveals patterns that bridge coincidence and consciousness.