Skip to content

inspired12/ProjectSelf

Repository files navigation

ProjectSelf - Voice Knowledge Capture System

A personal knowledge repository system that uses voice transcription to capture your thoughts, insights, and wisdom. This tool helps you build a comprehensive database of your knowledge that can eventually be used to create a personal reasoning partner.

Features

  • 🎙️ Voice Recording: Simple browser-based audio recording
  • 🤖 AI Transcription: Uses OpenAI-compatible Whisper STT service for voice-to-text conversion
  • 🔊 Question Playback: Uses OpenAI-compatible Piper TTS service to read questions aloud
  • 📊 Progress Tracking: Visual progress indicators and statistics
  • 💾 Local Database: SQLite for simple, portable storage
  • 🎯 Question-Guided: Structured approach with customizable questions
  • 📱 Responsive UI: Clean, modern interface that works on desktop and mobile

System Requirements

  • Python 3.8 or higher
  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • Microphone access
  • Local speech services running:
    • Whisper STT (http://localhost:5002/v1)
    • Piper TTS (http://localhost:5001/v1)

Installation

1. Clone or Download the Repository

cd ProjectSelf

2. Create a Virtual Environment (Recommended)

python -m venv venv

# On Linux/Mac:
source venv/bin/activate

# On Windows:
venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Speech Service Endpoints (Optional)

The app defaults to local services on localhost and can be overridden with env vars:

export SPEECH_STT_BASE_URL=http://localhost:5002/v1
export SPEECH_STT_MODEL=whisper-1
export SPEECH_STT_API_KEY=none

export SPEECH_TTS_BASE_URL=http://localhost:5001/v1
export SPEECH_TTS_MODEL=piper
export SPEECH_TTS_VOICE=en_US-lessac-medium
export SPEECH_TTS_API_KEY=none

Quick Start

1. Import Questions

You can start with the sample questions or import your own:

# Use the sample questions (30 questions)
python import_questions.py sample_questions.json

# Or import your own questions
python import_questions.py your_questions.json

2. Start the Application

python app.py

3. Open Your Browser

Navigate to: http://localhost:5000

4. Start Capturing Knowledge!

  1. Grant microphone permissions when prompted
  2. Read the question
  3. Click "Start Recording"
  4. Speak your answer
  5. Click "Stop Recording"
  6. Review the transcription
  7. Click "Next Question" to continue

You can also click Listen to Question to hear each prompt via Piper TTS.

Question Format

Questions should be in JSON format. You can use either simple strings or objects with categories:

Simple Format

[
    "What is your core philosophy on life?",
    "How do you approach problem-solving?",
    "What are your most important values?"
]

Detailed Format (with categories)

[
    {
        "question": "What is your core philosophy on life?",
        "category": "Philosophy"
    },
    {
        "question": "How do you approach problem-solving?",
        "category": "Problem Solving"
    }
]

Creating Your 1000 Questions

To create a comprehensive knowledge base, consider organizing your questions into categories:

  • Philosophy & Values (10-15%)
  • Personal Growth & Development (15-20%)
  • Professional & Career (15-20%)
  • Relationships & Communication (10-15%)
  • Problem Solving & Decision Making (10-15%)
  • Health & Wellness (5-10%)
  • Creativity & Innovation (5-10%)
  • Specific Domain Knowledge (15-20%)

Tips for Good Questions

  • Make questions open-ended
  • Focus on "how" and "why" rather than "what"
  • Include scenarios and examples
  • Ask about principles, not just facts
  • Cover different time perspectives (past lessons, current practices, future goals)

Database Structure

The system uses SQLite with three main tables:

  • questions: Stores all questions with categories
  • responses: Stores transcriptions linked to questions
  • session_metadata: Tracks progress and statistics

API Endpoints

The Flask backend provides these endpoints:

  • GET /api/current-question - Get the current question
  • POST /api/transcribe - Transcribe audio via external Whisper STT and save response
  • POST /api/speak - Synthesize text via external Piper TTS (used by question playback)
  • POST /api/next-question - Move to next question
  • GET /api/stats - Get overall statistics
  • GET /api/responses - Get all responses
  • POST /api/import-questions - Import questions
  • POST /api/reset-progress - Reset progress to start

Speech Service Configuration

STT (Whisper-compatible)

  • SPEECH_STT_BASE_URL (default: http://localhost:5002/v1)
  • SPEECH_STT_MODEL (default: whisper-1)
  • SPEECH_STT_API_KEY (default: none)

TTS (Piper-compatible)

  • SPEECH_TTS_BASE_URL (default: http://localhost:5001/v1)
  • SPEECH_TTS_MODEL (default: piper)
  • SPEECH_TTS_VOICE (default: en_US-lessac-medium)
  • SPEECH_TTS_RESPONSE_FORMAT (default: mp3)
  • SPEECH_TTS_API_KEY (default: none)

Exporting Your Knowledge

To export all your responses to JSON:

from database import KnowledgeDB

db = KnowledgeDB()
responses = db.get_all_responses()

import json
with open('my_knowledge.json', 'w') as f:
    json.dump(responses, f, indent=2)

Future Enhancements

This system is designed as the foundation for creating a personal reasoning partner. Potential next steps:

  1. Fine-tuning a Model: Use your responses to fine-tune an LLM
  2. RAG System: Build a retrieval-augmented generation system
  3. Vector Database: Create embeddings for semantic search
  4. Knowledge Graph: Extract entities and relationships
  5. Multi-modal: Add support for images and documents

Troubleshooting

Microphone Not Working

  • Ensure you've granted microphone permissions in your browser
  • Check browser settings (Settings → Privacy → Microphone)
  • Try a different browser

Speech Service Connection Issues

  • Verify speech backends are running:
    • curl http://localhost:5002/health (Whisper STT)
    • curl http://localhost:5001/health (Piper TTS)
  • Verify configured env vars point to reachable service URLs.
  • Check app server logs for upstream HTTP errors.

Port 5000 Already in Use

Change the port in app.py:

app.run(debug=True, host='0.0.0.0', port=5001)  # Use different port

Project Structure

ProjectSelf/
├── app.py                      # Flask backend
├── database.py                 # Database management
├── requirements.txt            # Python dependencies
├── import_questions.py         # Question import utility
├── sample_questions.json       # Example questions
├── static/
│   ├── index.html             # Main UI
│   ├── styles.css             # Styling
│   └── app.js                 # Frontend logic
├── uploads/                   # Audio files (created automatically)
└── knowledge.db              # SQLite database (created automatically)

Contributing

This is a personal knowledge capture system, but feel free to fork and adapt it for your own needs!

License

MIT License - Feel free to use and modify as needed.

Development & Task Management

This project uses Beads for AI-optimized issue tracking:

# Install beads
npm install -g @beads/bd

# View ready tasks
bd ready

# See full setup guide
cat BEADS_SETUP.md

Beads maintains persistent task context and dependencies, perfect for long-horizon AI development.

Acknowledgments

  • Speech serving via OpenAI-compatible adapters (Whisper STT + Piper TTS)
  • Powered by Flask and vanilla JavaScript
  • Task management via Beads
  • Inspired by the goal of creating personal AI reasoning partners

Ready to capture your knowledge and wisdom! 🚀

About

ProjectSelf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors