This application is designed to enhance conversation flow by intelligently identifying and managing conversational threads in real-time. The system subtly captures and organizes discussion threads to maintain context and enable a more smoother and coherent conversation, built with FastAPI backend and React frontend.
- Demo
- Project Structure
- Prerequisites
- Backend Setup
- Frontend Setup
- Running the Application
- Environment Variables
- Database Setup
- API Documentation
- Troubleshooting
- Contributing
- License
live_conversational_threads/
├── lct_python_backend/ # Python FastAPI backend
│ ├── backend.py # Main backend application
│ ├── db.py # Database connection
│ ├── db_helpers.py # Database helper functions
│ └── requirements.txt # Backend dependencies
├── lct_app/ # React frontend application
│ ├── src/ # Source code
│ ├── package.json # Frontend dependencies
│ └── vite.config.js # Vite configuration
├── requirements.txt # (duplicate of backend requirements)
└── README.md # This file
- Python 3.8+ (Conda or venv recommended)
- Node.js 18+ and npm 9+
- PostgreSQL (for backend database)
-
Create and activate a Python environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Or use Conda:
conda create -n lct_env python=3.8 conda activate lct_env
-
Install backend dependencies:
pip install -r lct_python_backend/requirements.txt
-
Configure environment variables:
- Set the following environment variables in your shell or system (e.g., export on Unix, set on Windows):
export ANTHROPIC_API_KEY=your_anthropic_api_key export ASSEMBLYAI_API_KEY=your_assemblyai_api_key export ASSEMBLYAI_WS_URL=wss://api.assemblyai.com/v2/realtime/ws?sample_rate=16000 export PERPLEXITY_API_KEY=your_perplexity_api_key export GOOGLEAI_API_KEY=your_googleai_api_key export GCS_BUCKET_NAME=your_gcs_bucket export GCS_FOLDER=your_gcs_folder export DATABASE_URL=postgresql://user:password@localhost:5432/yourdb
- On Windows (PowerShell):
$env:ANTHROPIC_API_KEY="your_anthropic_api_key" # ...and so on for each variable
- These must be set in your environment before starting the backend.
- Set the following environment variables in your shell or system (e.g., export on Unix, set on Windows):
-
Set up the PostgreSQL database (see Database Setup).
-
Navigate to the frontend directory:
cd lct_app -
Install Node.js dependencies:
npm install
From the project root (with your Python environment activated and environment variables set):
cd lct_python_backend
uvicorn backend:lct_app --reload --port 8080- The backend API will be available at http://localhost:8080
In a new terminal:
cd lct_app
npm run dev- The frontend will be available at http://localhost:5173
Backend required variables:
ANTHROPIC_API_KEY— API key for Anthropic ClaudeASSEMBLYAI_API_KEY— API key for AssemblyAIASSEMBLYAI_WS_URL— AssemblyAI websocket URLPERPLEXITY_API_KEY— API key for PerplexityGOOGLEAI_API_KEY— API key for Google GenAIGCS_BUCKET_NAME— Google Cloud Storage bucket nameGCS_FOLDER— GCS folder for storing filesDATABASE_URL— PostgreSQL connection string (e.g.,postgresql://user:password@localhost:5432/yourdb)
Frontend:
- No environment variables required for local development.
- You must have a running PostgreSQL instance.
- The backend expects a
conversationstable. Example schema:CREATE TABLE conversations ( id TEXT PRIMARY KEY, file_name TEXT, no_of_nodes INTEGER, gcs_path TEXT, created_at TIMESTAMP );
- Adjust or extend the schema as needed for your use case.
Once the backend server is running, access:
- Swagger UI: http://localhost:8080/docs
- ReDoc: http://localhost:8080/redoc
- Database connection errors:
- Ensure your
DATABASE_URLis correct and PostgreSQL is running. - The required tables must exist before starting the backend.
- Ensure your
- CORS errors:
- The backend is configured to allow requests from
http://localhost:5173.
- The backend is configured to allow requests from
- API key errors:
- Double-check all required environment variables are set in your environment.
- Port conflicts:
- Change the ports in the run commands if
8080or5173are in use.
- Change the ports in the run commands if
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 (GPLv3).
You are free to use, modify, and distribute this software under the terms of the GPLv3.
If you would like to use this software in a closed-source or commercial product, or if you're interested in a commercial license with different terms (e.g., without the GPL's copyleft requirements), please contact me to discuss options:
Email: [email protected] GitHub: https://github.com/aditya-adiga