Skip to content

Commit 83e4f5b

Browse files
authored
Add Knowledge Assistant chatbot project (#448)
<img width="1488" alt="Screenshot 2025-05-28 at 10 48 32 AM" src="https://github.com/user-attachments/assets/e037a8ed-02a5-4e68-8259-77c784e8bf2c" /> re-doing a [previous PR ](#446 signed commits
1 parent 50b4a18 commit 83e4f5b

File tree

74 files changed

+25611
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+25611
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ database-diagram-builder @alexott
1111
downstreams @nfx @alexott
1212
go-libs @nfx @alexott
1313
ip_access_list_analyzer @alexott
14+
ka-chat-bot @taiga-db
1415
metascan @nfx @alexott
1516
runtime-packages @nfx @alexott
1617
sql_migration_copilot @robertwhiffin

ka-chat-bot/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.env
2+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
3+
4+
# dependencies
5+
frontend/node_modules
6+
frontend/.pnp
7+
frontend/.pnp.js
8+
9+
# testing
10+
frontend/coverage
11+
# misc
12+
frontend/.DS_Store
13+
frontend/.env.local
14+
frontend/.env.development.local
15+
frontend/.env.test.local
16+
frontend/.env.production.local
17+
18+
frontend/npm-debug.log*
19+
frontend/yarn-debug.log*
20+
frontend/yarn-error.log*
21+
.DS_Store
22+
23+
__pycache__
24+
utils/__pycache__
25+
chat_history.db

ka-chat-bot/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Knowledge Assistant Chatbot"
3+
language: python
4+
author: "Taiga Matsumoto"
5+
date: 2025-05-26
6+
---
7+
8+
# Databricks Chatbot Application
9+
10+
Chat applications powered by Databricks' model serving endpoints. This project provides a foundation for creating interactive chat interfaces that leverage Databricks' powerful AI framework and model serving infrastructure.
11+
12+
## Features
13+
14+
- 🚀 Real-time chat interface
15+
- 💾 Chat history persistence
16+
- 🔄 Message regeneration capability
17+
- ⚡ Streaming responses
18+
- 🔒 Secure authentication
19+
- 🎯 Rate limiting and error handling
20+
21+
## Architecture
22+
23+
The application is built with:
24+
- FastAPI for the backend API
25+
- SQLite for chat history storage
26+
- Async/await patterns for efficient request handling
27+
- Dependency injection for clean code organization
28+
29+
## Getting Started
30+
31+
1. Clone the repository
32+
2. Install dependencies:
33+
```bash
34+
pip install -r requirements.txt
35+
```
36+
37+
3. Building the Frontend
38+
39+
[1]. Navigate to the frontend directory:
40+
41+
```bash
42+
cd frontend
43+
```
44+
45+
[2]. Install dependencies:
46+
47+
```bash
48+
npm install
49+
```
50+
51+
[3]. Build the production version:
52+
53+
```bash
54+
npm run build
55+
```
56+
57+
4. Run the application:
58+
```bash
59+
python main.py
60+
```
61+
62+
## Example Interface
63+
64+
Here's how the chat interface looks like
65+
66+
![Databricks Chat Interface](./utils/Databricks_chatbot_app.png)
67+
68+
## Key Components
69+
70+
- `main.py`: FastAPI application entry point
71+
- `utils/`: Helper functions and utilities
72+
- `models.py`: Data models and schemas
73+
- `chat_database.py`: Database interactions
74+
- `token_minter.py`: Authentication handling

ka-chat-bot/app.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
command:
2+
- "gunicorn"
3+
- "main:app"
4+
- "-w"
5+
- "2"
6+
- "--worker-class"
7+
- "uvicorn.workers.UvicornWorker"
8+
9+
env:
10+
- name: "SERVING_ENDPOINT_NAME"
11+
valueFrom: "serving_endpoint"

0 commit comments

Comments
 (0)