slothquery 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {slothquery-1.0.0 → slothquery-1.0.2}/MANIFEST.in +1 -1
- {slothquery-1.0.0/backend/slothquery.egg-info → slothquery-1.0.2}/PKG-INFO +1 -1
- {slothquery-1.0.0 → slothquery-1.0.2}/README.md +234 -228
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/__init__.py +1 -1
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/cli.py +26 -26
- slothquery-1.0.2/backend/app/routers/__init__.py +1 -0
- slothquery-1.0.2/backend/app/routers/core.py +466 -0
- slothquery-1.0.2/backend/app/services/__init__.py +1 -0
- slothquery-1.0.2/backend/app/services/chat.py +217 -0
- slothquery-1.0.2/backend/app/services/encryption.py +28 -0
- slothquery-1.0.2/backend/app/services/export_import.py +55 -0
- slothquery-1.0.2/backend/app/services/extraction.py +403 -0
- slothquery-1.0.2/backend/app/services/provider.py +112 -0
- slothquery-1.0.2/backend/app/services/retrieval.py +185 -0
- slothquery-1.0.2/backend/app/services/vector_store.py +69 -0
- {slothquery-1.0.0 → slothquery-1.0.2/backend/slothquery.egg-info}/PKG-INFO +1 -1
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/slothquery.egg-info/SOURCES.txt +10 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/setup.py +35 -31
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/database.py +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/dist/assets/index-BDTPNUTQ.css +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/dist/assets/index-DKvMVJoY.js +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/dist/assets/logo-RBZv3XvP.png +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/dist/index.html +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/main.py +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/models.py +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/app/schemas.py +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/slothquery.egg-info/dependency_links.txt +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/slothquery.egg-info/entry_points.txt +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/slothquery.egg-info/requires.txt +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/backend/slothquery.egg-info/top_level.txt +0 -0
- {slothquery-1.0.0 → slothquery-1.0.2}/setup.cfg +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
recursive-include backend/app/dist *
|
|
1
|
+
recursive-include backend/app/dist *
|
|
@@ -1,229 +1,235 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# SlothQuery
|
|
4
|
-
|
|
5
|
-
**Local-first organizational intelligence platform for SQL engineers and data analysts.**
|
|
6
|
-
|
|
7
|
-
SlothQuery transforms your raw SQL queries, business rules, table schemas, and analyst notes into a searchable, AI-powered knowledge base — so your team never has to rediscover the same logic twice.
|
|
8
|
-
|
|
9
|
-
[](https://python.org)
|
|
10
|
-
[](https://fastapi.tiangolo.com)
|
|
11
|
-
[](https://react.dev)
|
|
12
|
-
[](https://typescriptlang.org)
|
|
13
|
-
[](https://sqlite.org)
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## What is SlothQuery?
|
|
20
|
-
|
|
21
|
-
SlothQuery is a **local-first** knowledge retrieval system for data teams. Instead of storing queries in a flat file or Notion doc, SlothQuery extracts structured intelligence from each query — business intent, schema entities, business rules, transformations — and makes all of it searchable and retrievable at chat time.
|
|
22
|
-
|
|
23
|
-
Think of it as **institutional memory for your SQL stack**, powered by an LLM that only ever answers from your own grounded knowledge — never from hallucinated context.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Tech Stack
|
|
28
|
-
|
|
29
|
-
| Layer | Technologies |
|
|
30
|
-
|---|---|
|
|
31
|
-
| **Backend** | Python · FastAPI · SQLAlchemy · SQLite · ChromaDB · LiteLLM |
|
|
32
|
-
| **Frontend** | React · TypeScript · Vite · Tailwind CSS · Axios · Lucide Icons |
|
|
33
|
-
| **AI / Retrieval** | BGE-small-en-v1.5 (local embeddings) · LiteLLM (multi-provider LLM) · ChromaDB (vector search) |
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Features
|
|
38
|
-
|
|
39
|
-
### Knowledge Studio
|
|
40
|
-
- Add SQL queries with title, description, dialect, tags, and analyst comments
|
|
41
|
-
- Human-in-the-loop AI extraction — review and approve extracted business intent, schema entities, business rules, metric transformations, and ambiguities before saving
|
|
42
|
-
- Organize knowledge into domain Vaults (e.g. Marketing, Finance, Product)
|
|
43
|
-
- Business Rules Playbooks — consolidated business logic documentation
|
|
44
|
-
- Table Schema documentation with join patterns and naming conventions
|
|
45
|
-
- Analyst Notes — freeform knowledge about metrics, caveats, and patterns
|
|
46
|
-
- Delete queries (with ChromaDB sync) and delete entire vaults (full cascade)
|
|
47
|
-
|
|
48
|
-
### Chat Interface
|
|
49
|
-
- Grounded AI chat — every answer is retrieved from your knowledge base; the LLM never invents tables or metrics
|
|
50
|
-
- Multi-vault context — query across multiple vaults in a single conversation
|
|
51
|
-
- Dialect-aware SQL generation — Snowflake, BigQuery, PostgreSQL, Trino, Redshift
|
|
52
|
-
- Tag filtering — narrow retrieval to specific topic tags
|
|
53
|
-
- Markdown-rendered responses with bold, italic, lists, and SQL code blocks with one-click copy
|
|
54
|
-
- Auto-named persistent chat history
|
|
55
|
-
- Onboarding guard — if your knowledge base is empty, SlothQuery guides you to add content first
|
|
56
|
-
|
|
57
|
-
### LLM Provider Management
|
|
58
|
-
- Supports OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, DeepSeek
|
|
59
|
-
- API keys are encrypted with Fernet symmetric encryption before being written to SQLite — never logged or exposed to the frontend
|
|
60
|
-
- Test Connection before saving
|
|
61
|
-
- Dynamic provider switching without restarting the app
|
|
62
|
-
- Last active provider automatically restored on restart
|
|
63
|
-
|
|
64
|
-
### Knowledge Portability
|
|
65
|
-
- Export your entire knowledge base or individual vaults as a `.slothkb` archive
|
|
66
|
-
- Import and automatically re-index embeddings
|
|
67
|
-
- Re-index — rebuild the entire ChromaDB vector store from SQLite at any time
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Architecture
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
UI (React)
|
|
75
|
-
↓
|
|
76
|
-
API (FastAPI)
|
|
77
|
-
↓
|
|
78
|
-
Services (chat · extraction · retrieval · provider · vector_store)
|
|
79
|
-
↓
|
|
80
|
-
Repositories (SQLAlchemy)
|
|
81
|
-
↓
|
|
82
|
-
Storage (SQLite + ChromaDB)
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
- **Local-first** — all data lives in `~/Documents/SlothQuery/` on your machine
|
|
86
|
-
- **SQLite** is the source of truth for all structured data
|
|
87
|
-
- **ChromaDB** is derived state — always rebuildable from SQLite via Re-index
|
|
88
|
-
- **No cloud dependency** — works fully offline once the embedding model is cached
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Getting Started
|
|
93
|
-
|
|
94
|
-
###
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
### Step
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# SlothQuery v1.0
|
|
4
|
+
|
|
5
|
+
**Local-first organizational intelligence platform for SQL engineers and data analysts.**
|
|
6
|
+
|
|
7
|
+
SlothQuery transforms your raw SQL queries, business rules, table schemas, and analyst notes into a searchable, AI-powered knowledge base — so your team never has to rediscover the same logic twice.
|
|
8
|
+
|
|
9
|
+
[](https://python.org)
|
|
10
|
+
[](https://fastapi.tiangolo.com)
|
|
11
|
+
[](https://react.dev)
|
|
12
|
+
[](https://typescriptlang.org)
|
|
13
|
+
[](https://sqlite.org)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## What is SlothQuery?
|
|
20
|
+
|
|
21
|
+
SlothQuery is a **local-first** knowledge retrieval system for data teams. Instead of storing queries in a flat file or Notion doc, SlothQuery extracts structured intelligence from each query — business intent, schema entities, business rules, transformations — and makes all of it searchable and retrievable at chat time.
|
|
22
|
+
|
|
23
|
+
Think of it as **institutional memory for your SQL stack**, powered by an LLM that only ever answers from your own grounded knowledge — never from hallucinated context.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Tech Stack
|
|
28
|
+
|
|
29
|
+
| Layer | Technologies |
|
|
30
|
+
|---|---|
|
|
31
|
+
| **Backend** | Python · FastAPI · SQLAlchemy · SQLite · ChromaDB · LiteLLM |
|
|
32
|
+
| **Frontend** | React · TypeScript · Vite · Tailwind CSS · Axios · Lucide Icons |
|
|
33
|
+
| **AI / Retrieval** | BGE-small-en-v1.5 (local embeddings) · LiteLLM (multi-provider LLM) · ChromaDB (vector search) |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
### Knowledge Studio
|
|
40
|
+
- Add SQL queries with title, description, dialect, tags, and analyst comments
|
|
41
|
+
- Human-in-the-loop AI extraction — review and approve extracted business intent, schema entities, business rules, metric transformations, and ambiguities before saving
|
|
42
|
+
- Organize knowledge into domain Vaults (e.g. Marketing, Finance, Product)
|
|
43
|
+
- Business Rules Playbooks — consolidated business logic documentation
|
|
44
|
+
- Table Schema documentation with join patterns and naming conventions
|
|
45
|
+
- Analyst Notes — freeform knowledge about metrics, caveats, and patterns
|
|
46
|
+
- Delete queries (with ChromaDB sync) and delete entire vaults (full cascade)
|
|
47
|
+
|
|
48
|
+
### Chat Interface
|
|
49
|
+
- Grounded AI chat — every answer is retrieved from your knowledge base; the LLM never invents tables or metrics
|
|
50
|
+
- Multi-vault context — query across multiple vaults in a single conversation
|
|
51
|
+
- Dialect-aware SQL generation — Snowflake, BigQuery, PostgreSQL, Trino, Redshift
|
|
52
|
+
- Tag filtering — narrow retrieval to specific topic tags
|
|
53
|
+
- Markdown-rendered responses with bold, italic, lists, and SQL code blocks with one-click copy
|
|
54
|
+
- Auto-named persistent chat history
|
|
55
|
+
- Onboarding guard — if your knowledge base is empty, SlothQuery guides you to add content first
|
|
56
|
+
|
|
57
|
+
### LLM Provider Management
|
|
58
|
+
- Supports OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, DeepSeek
|
|
59
|
+
- API keys are encrypted with Fernet symmetric encryption before being written to SQLite — never logged or exposed to the frontend
|
|
60
|
+
- Test Connection before saving
|
|
61
|
+
- Dynamic provider switching without restarting the app
|
|
62
|
+
- Last active provider automatically restored on restart
|
|
63
|
+
|
|
64
|
+
### Knowledge Portability
|
|
65
|
+
- Export your entire knowledge base or individual vaults as a `.slothkb` archive
|
|
66
|
+
- Import and automatically re-index embeddings
|
|
67
|
+
- Re-index — rebuild the entire ChromaDB vector store from SQLite at any time
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Architecture
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
UI (React)
|
|
75
|
+
↓
|
|
76
|
+
API (FastAPI)
|
|
77
|
+
↓
|
|
78
|
+
Services (chat · extraction · retrieval · provider · vector_store)
|
|
79
|
+
↓
|
|
80
|
+
Repositories (SQLAlchemy)
|
|
81
|
+
↓
|
|
82
|
+
Storage (SQLite + ChromaDB)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **Local-first** — all data lives in `~/Documents/SlothQuery/` on your machine
|
|
86
|
+
- **SQLite** is the source of truth for all structured data
|
|
87
|
+
- **ChromaDB** is derived state — always rebuildable from SQLite via Re-index
|
|
88
|
+
- **No cloud dependency** — works fully offline once the embedding model is cached
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Getting Started
|
|
93
|
+
|
|
94
|
+
### Option 1: Quick Install (Recommended)
|
|
95
|
+
You can install and run SlothQuery directly from PyPI as a global CLI tool. No cloning or Node.js compilation required:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Install the package
|
|
99
|
+
pip install slothquery
|
|
100
|
+
|
|
101
|
+
# Start the application from any directory
|
|
102
|
+
slothquery
|
|
103
|
+
```
|
|
104
|
+
*This starts the local FastAPI server and automatically opens your default web browser to the dashboard at `http://127.0.0.1:8000`.*
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Option 2: Local Developer Setup (Clone & Run)
|
|
109
|
+
If you want to modify the source code, run integration tests, or contribute to the frontend layout:
|
|
110
|
+
|
|
111
|
+
#### 1. Clone the repository
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/ayush01thakur/slothquery.git
|
|
114
|
+
cd slothquery
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### 2. Set up the Backend
|
|
118
|
+
```bash
|
|
119
|
+
cd backend
|
|
120
|
+
|
|
121
|
+
# Create and activate a virtual environment
|
|
122
|
+
python -m venv venv
|
|
123
|
+
|
|
124
|
+
# Windows
|
|
125
|
+
.\venv\Scripts\activate
|
|
126
|
+
|
|
127
|
+
# macOS / Linux
|
|
128
|
+
source venv/bin/activate
|
|
129
|
+
|
|
130
|
+
# Install dependencies
|
|
131
|
+
pip install -r requirements.txt
|
|
132
|
+
|
|
133
|
+
# Start the backend server
|
|
134
|
+
uvicorn app.main:app --reload --port 8000
|
|
135
|
+
```
|
|
136
|
+
> Note: First run automatically downloads the local BGE-small-en-v1.5 embedding model weights (~130MB).
|
|
137
|
+
|
|
138
|
+
API documentation is interactive at: `http://127.0.0.1:8000/docs`
|
|
139
|
+
|
|
140
|
+
#### 3. Set up the Frontend
|
|
141
|
+
```bash
|
|
142
|
+
cd ../frontend
|
|
143
|
+
npm install
|
|
144
|
+
npm run dev
|
|
145
|
+
```
|
|
146
|
+
App developer server available at: `http://localhost:3000`
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## How to Use SlothQuery
|
|
151
|
+
|
|
152
|
+
### Step 1 — Configure an LLM Provider
|
|
153
|
+
1. Open `http://localhost:3000`
|
|
154
|
+
2. Click the **Settings** icon or click **Configure** on the amber banner
|
|
155
|
+
3. Select your provider, enter model name and API key
|
|
156
|
+
4. Click **Test & Save** — your key is encrypted and stored locally
|
|
157
|
+
|
|
158
|
+
### Step 2 — Build Your Knowledge Base
|
|
159
|
+
|
|
160
|
+
Go to **Knowledge Studio** in the left sidebar.
|
|
161
|
+
|
|
162
|
+
**Adding a Query:**
|
|
163
|
+
1. Click `+ Add Asset → Add Query`
|
|
164
|
+
2. Fill in title, vault, dialect, description, and tags
|
|
165
|
+
3. Paste your SQL and analyst comments
|
|
166
|
+
4. Click **Generate & Review Intelligence** — AI extracts context
|
|
167
|
+
5. Review the draft, edit anything incorrect, then **Approve & Save**
|
|
168
|
+
|
|
169
|
+
**Adding Playbooks, Schemas, Notes:**
|
|
170
|
+
1. Click `+ Add Asset` and choose the asset type
|
|
171
|
+
2. Name it, select a vault, write the content, and save
|
|
172
|
+
|
|
173
|
+
### Step 3 — Chat
|
|
174
|
+
|
|
175
|
+
1. Go to the **Chat** view
|
|
176
|
+
2. Ask questions or request SQL — e.g.:
|
|
177
|
+
- *"Show me the ARR calculation query"*
|
|
178
|
+
- *"Write a Snowflake query for weekly active users"*
|
|
179
|
+
- *"What business rules apply to revenue metrics?"*
|
|
180
|
+
3. SlothQuery retrieves matching context and generates a grounded response
|
|
181
|
+
4. SQL appears in a code block with a **Copy** button
|
|
182
|
+
|
|
183
|
+
> Tip: Use the **+** button in the chat input to filter by vault or tags.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Data Storage
|
|
188
|
+
|
|
189
|
+
All data is stored locally at:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
~/Documents/SlothQuery/
|
|
193
|
+
├── slothquery.db # SQLite — queries, chats, providers (encrypted keys)
|
|
194
|
+
├── chroma_db/ # ChromaDB — vector embeddings (rebuildable)
|
|
195
|
+
└── Exports/ # .slothkb export archives
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> The SQLite database contains encrypted API keys. Never commit it to version control — it is excluded by `.gitignore`.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Keyboard Shortcuts
|
|
203
|
+
|
|
204
|
+
| Action | Shortcut |
|
|
205
|
+
|---|---|
|
|
206
|
+
| Send chat message | `Enter` |
|
|
207
|
+
| New line in input | `Shift + Enter` |
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Roadmap
|
|
212
|
+
|
|
213
|
+
- [ ] Schema Explorer with live table preview
|
|
214
|
+
- [ ] Query versioning and diff view
|
|
215
|
+
- [ ] Team shared knowledge base sync
|
|
216
|
+
- [ ] Slack / Teams bot integration
|
|
217
|
+
- [ ] Desktop wrapper (Tauri)
|
|
218
|
+
- [ ] MCP server support for AI coding agents
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Contributing
|
|
223
|
+
|
|
224
|
+
Branch naming:
|
|
225
|
+
```
|
|
226
|
+
feat/add-schema-versioning
|
|
227
|
+
fix/resolve-chromadb-sync
|
|
228
|
+
refactor/move-embedding-service
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
229
235
|
MIT — use freely, build on top, keep it local-first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# SlothQuery app package
|
|
1
|
+
# SlothQuery app package
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import uvicorn
|
|
2
|
-
import webbrowser
|
|
3
|
-
import threading
|
|
4
|
-
import time
|
|
5
|
-
from .main import app
|
|
6
|
-
|
|
7
|
-
def open_browser():
|
|
8
|
-
# Wait 1.5 seconds for uvicorn to initialize completely
|
|
9
|
-
time.sleep(1.5)
|
|
10
|
-
print("[*] Opening SlothQuery in default browser...")
|
|
11
|
-
webbrowser.open("http://127.0.0.1:8000")
|
|
12
|
-
|
|
13
|
-
def main():
|
|
14
|
-
print("===================================================")
|
|
15
|
-
print(" SlothQuery Local Launch ")
|
|
16
|
-
print("===================================================")
|
|
17
|
-
print("[*] Initializing local database and indexing vector store...")
|
|
18
|
-
|
|
19
|
-
# Start browser redirect in background thread
|
|
20
|
-
threading.Thread(target=open_browser, daemon=True).start()
|
|
21
|
-
|
|
22
|
-
# Launch uvicorn directly with the FastAPI app instance
|
|
23
|
-
uvicorn.run(app, host="127.0.0.1", port=8000, log_level="info")
|
|
24
|
-
|
|
25
|
-
if __name__ == "__main__":
|
|
26
|
-
main()
|
|
1
|
+
import uvicorn
|
|
2
|
+
import webbrowser
|
|
3
|
+
import threading
|
|
4
|
+
import time
|
|
5
|
+
from .main import app
|
|
6
|
+
|
|
7
|
+
def open_browser():
|
|
8
|
+
# Wait 1.5 seconds for uvicorn to initialize completely
|
|
9
|
+
time.sleep(1.5)
|
|
10
|
+
print("[*] Opening SlothQuery in default browser...")
|
|
11
|
+
webbrowser.open("http://127.0.0.1:8000")
|
|
12
|
+
|
|
13
|
+
def main():
|
|
14
|
+
print("===================================================")
|
|
15
|
+
print(" SlothQuery Local Launch ")
|
|
16
|
+
print("===================================================")
|
|
17
|
+
print("[*] Initializing local database and indexing vector store...")
|
|
18
|
+
|
|
19
|
+
# Start browser redirect in background thread
|
|
20
|
+
threading.Thread(target=open_browser, daemon=True).start()
|
|
21
|
+
|
|
22
|
+
# Launch uvicorn directly with the FastAPI app instance
|
|
23
|
+
uvicorn.run(app, host="127.0.0.1", port=8000, log_level="info")
|
|
24
|
+
|
|
25
|
+
if __name__ == "__main__":
|
|
26
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# SlothQuery routers package
|