An open API service indexing awesome lists of open source software.

https://github.com/janyewest/delta

consulting app
https://github.com/janyewest/delta

api consulting embeddings-and-vector-databases fastapi llm llms openai postgres psycopg2-binary python python3 rest-api streamlit supabase

Last synced: 2 months ago
JSON representation

consulting app

Awesome Lists containing this project

README

          

# SOW Solution Recommender

An AI-powered consulting strategist tool that matches new client needs to past Statements of Work (SOWs) and generates solution recommendations. Built with FastAPI, Supabase, OpenAI, and Streamlit.

## Features

- Match client prompts to similar past SOWs using embeddings
- Generate 2–3 tailored tech solution suggestions via GPT-4o model
- Save suggestions to Supabase table
- Export recommendations as a TXT file
- Simple, clean Streamlit UI

---

## Project Structure

```bash
consulting-app/
├─ main/
├── .env # Environment variables (not committed)
├── __init__.py
├── app.py # FastAPI backend with API endpoints
├── run.sh # Shell exe
├── seed_db.py # Script to generate and store embeddings
├── streamlit_app.py # Streamlit frontend UI
├── requirements.txt # Python dependencies

└── static/ # Supabase schema and data tables
├── supabase_schema_ddl.sql
└── .gitignore
└── README.md
```
---

## Setup Instructions

### 1. Environment Setup

```bash
git clone https://github.com/your-repo/sow-recommender
cd sow-recommender
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

### 2. Environment Variables

Create a .env file with:
```bash
OPENAI_API_KEY=your_openai_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_or_service_role_key
SUPABASE_POSTGRES_URL=postgresql://user:pass@host:port/dbname
```

### 3. Database

Use static/database/supabase_schema_ddl.sql to ensure you’ve created the following tables in your Supabase PostgreSQL
instance:

```postgresql
-- consulting.sows, consulting.clients, consulting.solutions
-- Plus:
CREATE TABLE consulting.embeddings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
sow_id UUID UNIQUE REFERENCES consulting.sows(id) ON DELETE CASCADE,
embedding BYTEA
);

CREATE TABLE consulting.saved_suggestions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
prompt TEXT,
suggestions TEXT[]
);
```

### 4. Seed Embeddings

```bash
python seed_db.py
```

### 5. Run Shell script

```bash
./run.sh
```

## Example Prompt

```bash
We need to integrate multiple hospital data sources
into a unified analytics platform on the cloud.
```

## To-Do / Ideas
• Deploy FastAPI + Streamlit online
• Add user login and project history
• Support multi-SOW report generation
• Add confidence score visualizations

## Powered By

• FastAPI
• Streamlit
• OpenAI
• Supabase