Create readme.md
Browse files
readme.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Quantum Synchronicity Chatbot — README
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
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.
|
| 5 |
+
|
| 6 |
+
## Features
|
| 7 |
+
- Add synchronicity entries with tags and outcomes.
|
| 8 |
+
- Analyze entries to find similar past events and predict potential patterns.
|
| 9 |
+
- Export or reset your database.
|
| 10 |
+
- Optional automatic synchronization to Hugging Face Hub.
|
| 11 |
+
- CLI fallback mode when Gradio is unavailable.
|
| 12 |
+
|
| 13 |
+
## Installation
|
| 14 |
+
|
| 15 |
+
1. **Clone or copy the repository files:**
|
| 16 |
+
```bash
|
| 17 |
+
git clone <your-repo-url>
|
| 18 |
+
cd <repo-folder>
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
2. **Create and activate a virtual environment (recommended):**
|
| 22 |
+
```bash
|
| 23 |
+
python -m venv venv
|
| 24 |
+
source venv/bin/activate # On Windows use: venv\\Scripts\\activate
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
3. **Install dependencies:**
|
| 28 |
+
```bash
|
| 29 |
+
pip install -r requirements.txt
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
4. **Ensure the following files exist:**
|
| 33 |
+
- `synchronicities.json` initialized as:
|
| 34 |
+
```json
|
| 35 |
+
{"entries": []}
|
| 36 |
+
```
|
| 37 |
+
- `.env` file (optional) containing:
|
| 38 |
+
```bash
|
| 39 |
+
HF_TOKEN=your_huggingface_token
|
| 40 |
+
HF_REPO=your_username/your_repo_name
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Running the App
|
| 44 |
+
|
| 45 |
+
### Option 1: Web Interface (Gradio)
|
| 46 |
+
```bash
|
| 47 |
+
python app.py
|
| 48 |
+
```
|
| 49 |
+
Then open the local URL displayed (e.g., http://127.0.0.1:7860) in your browser.
|
| 50 |
+
|
| 51 |
+
### Option 2: Command Line Mode
|
| 52 |
+
If Gradio is not installed, you can use the CLI fallback:
|
| 53 |
+
```bash
|
| 54 |
+
python app.py
|
| 55 |
+
```
|
| 56 |
+
You’ll see prompts like:
|
| 57 |
+
```
|
| 58 |
+
> add # Add a new synchronicity entry
|
| 59 |
+
> export # Print database as JSON
|
| 60 |
+
> reset # Clear the database
|
| 61 |
+
> tests # Run basic internal tests
|
| 62 |
+
> exit # Quit
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Environment Variables
|
| 66 |
+
|
| 67 |
+
- `HF_TOKEN` — Your Hugging Face access token (for syncing data).
|
| 68 |
+
- `HF_REPO` — The name of your Hugging Face repository (e.g., `username/space-repo`).
|
| 69 |
+
|
| 70 |
+
If you don’t plan to sync data, you can omit these.
|
| 71 |
+
|
| 72 |
+
## Deployment to Hugging Face Space
|
| 73 |
+
|
| 74 |
+
1. Upload the following files to your Space:
|
| 75 |
+
- `app.py`
|
| 76 |
+
- `requirements.txt`
|
| 77 |
+
- `synchronicities.json`
|
| 78 |
+
- `README.md`
|
| 79 |
+
|
| 80 |
+
2. Add your `HF_TOKEN` and `HF_REPO` as **Secrets** under Space Settings.
|
| 81 |
+
|
| 82 |
+
3. Set the SDK to **Gradio** and the `app_file` to `app.py`.
|
| 83 |
+
|
| 84 |
+
Your app will automatically build and launch with a chat-style interface.
|
| 85 |
+
|
| 86 |
+
## Tests
|
| 87 |
+
Run simple verification tests locally:
|
| 88 |
+
```bash
|
| 89 |
+
python app.py
|
| 90 |
+
> tests
|
| 91 |
+
```
|
| 92 |
+
If all tests pass, you’ll see “All tests passed.”
|
| 93 |
+
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
✨ *The Oracle listens, remembers, and reveals patterns that bridge coincidence and consciousness.*
|