{"id":25418785,"url":"https://github.com/renardeinside/chatten","last_synced_at":"2025-05-05T21:36:27.689Z","repository":{"id":277168651,"uuid":"928585898","full_name":"renardeinside/chatten","owner":"renardeinside","description":"RAG application (backend \u0026 frontend) with sources retriveal and highlighting on the Databricks Platform","archived":false,"fork":false,"pushed_at":"2025-04-29T16:34:00.000Z","size":14262,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T17:39:20.664Z","etag":null,"topics":["dash","databricks","python","rag","vector-search"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/pulse/end-to-end-rag-application-source-retriveal-platform-ivan-trusov-znvqf/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renardeinside.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-06T21:54:54.000Z","updated_at":"2025-04-29T16:34:03.000Z","dependencies_parsed_at":"2025-02-12T14:47:43.712Z","dependency_job_id":"06990d82-f211-481d-8a76-2e4dff830d7f","html_url":"https://github.com/renardeinside/chatten","commit_stats":null,"previous_names":["renardeinside/chatten"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fchatten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fchatten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fchatten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fchatten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renardeinside","download_url":"https://codeload.github.com/renardeinside/chatten/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252580757,"owners_count":21771386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dash","databricks","python","rag","vector-search"],"created_at":"2025-02-16T18:05:03.440Z","updated_at":"2025-05-05T21:36:27.659Z","avatar_url":"https://github.com/renardeinside.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Chatten\n\nRAG with sources, built with **Dash**, **FastAPI**, and the **Databricks** platform.\n\n---\n\n## 💫 Showcase\n\nHere is an example of the app in action:\n\n\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg src=\"assets/showcase.gif\" alt=\"chatten\" style=\"max-width: 800px; height: auto;\"\u003e\n\u003c/div\u003e\n\n\n## 🛠 Developer Setup\n\nTo install the project, ensure you have the following dependencies:\n\n- 📦 [uv](https://docs.astral.sh/uv/): for managing the project\n- 🚀 [Databricks CLI](https://docs.databricks.com/dev-tools/cli/index.html): for deploying the app\n- 🌐 [Node.js](https://nodejs.org/en/): for building the UI\n\n### 📥 Installation Steps\n\n1. Clone the repo:\n\n   ```bash\n   git clone \u003crepo-url\u003e\n   ```\n\n2. Run sync:\n\n   ```bash\n   uv sync --all-packages\n   ```\n\n3. Configure environment variables in the `.env` file:\n\n   ```bash\n   # Name of your Databricks profile\n   CHATTEN_PROFILE=...\n   \n   # Optionally, you can include any bundle or Chatten variables:\n   CHATTEN_CATALOG=...\n   \n   # Optionally, by check default values in databricks.yml\n   BUNDLE_VAR_vsi_endpoint=...\n   ```\n\n---\n\n## 🏗 Development\n\n1. Start the UI watcher in one terminal:\n\n   ```bash\n   cd packages/chatten_ui \u0026\u0026 npm run watch\n   ```\n\n2. Run the server in another terminal:\n\n   ```bash\n   uvicorn chatten_app.app:app --reload\n   ```\n\n---\n\n## 🚀 Deployment\n\n1. Authenticate with Databricks:\n\n   ```bash\n   databricks auth login -p \u003cprofile-name\u003e\n   ```\n\n2. Deploy the app:\n\n   ```bash\n   # See Makefile for additional variables\n   make deploy profile=fe-az-ws catalog=\u003ccatalog-name\u003e\n   ```\n\n3. Run the RAG workflow:\n\n   ```bash\n   # See Makefile for additional variables\n   make run-rag profile=fe-az-ws catalog=\u003ccatalog-name\u003e\n   ```\n\n4. Grant app principal access to the Volume.\n5. Run the app:\n\n   ```bash\n   make run-app profile=fe-az-ws catalog=\u003ccatalog-name\u003e\n   ```\n\n6. Open the app from **Databricks Workspace** 🎉\n\n---\n\n## 🤖 Agent Serving Endpoint Response Parsing\n\nCheck the [`api_app`](packages/chatten_app/chatten_app/api_app.py) source code for details on how the agent serving endpoint response is parsed.\n\nSpecifically, the `/chat` API endpoint handles:\n- Parsing responses\n- Sending messages to the chat interface\n\n---\n\n## 🏛 App Implementation Details\n\nThe implementation consists of a **FastAPI** backend with two sub-apps:\n\n1. **Dash app (`/` route)**: Uses a custom component to render the chat UI.\n2. **FastAPI app (`/api` route)**: Provides API endpoints for the chat.\n\nThe chat is implemented as a **custom Dash component**, which is a React-based UI element that communicates with the FastAPI backend.\n\nThe `/api` app interacts with the **Databricks Serving Endpoint** to handle chat requests and responses. Another route is responsible for serving PDF files from **Databricks Volume**.\n\n---\n\n## 📂 Code Structure\n\n```\n📦 chatten  # Main package (FastAPI + Dash app)\n ┣ 📂 packages/chatten_ui  # Dash UI \u0026 custom chat component\n ┣ 📂 packages/chatten_rag  # RAG workflow implementation\n ┣ 📂 packages/chatten_app  # FastAPI \u0026 Dash apps\n ┣ 📂 src/chatten  # Common config \u0026 utilities\n ┣ 📂 src/chatten/app.py  # Main entry point\n```\n\n---\n\n## 🏗 Technologies Used\n\n### 🔥 Core Platform\n- [Databricks](https://databricks.com/)\n  - [Apps](https://www.databricks.com/product/databricks-apps) - App serving\n  - [Asset Bundles](https://docs.databricks.com/en/dev-tools/bundles/index.html) - Deployment\n  - [Mosaic AI Model Serving](https://docs.databricks.com/en/machine-learning/model-serving/index.html) - Model serving\n  - [Mosaic AI Vector Search](https://docs.databricks.com/en/generative-ai/vector-search.html) - Vector search\n\n### 🏗 Frameworks \u0026 Libraries\n- 🖥 [Dash](https://dash.plotly.com/) - UI framework\n- ⚡ [FastAPI](https://fastapi.tiangolo.com/) - Backend API\n- 🎨 [Tailwind CSS](https://tailwindcss.com/) - Styling\n- 📄 [react-pdf](https://github.com/wojtekmaj/react-pdf) - PDF rendering\n- 🔍 [Fuse.js](https://www.fusejs.io/) - Client-side fuzzy search\n- 📜 [pypdf](https://pypdf.readthedocs.io/en/stable/) - Server-side PDF text extraction\n- ⚡ [RapidFuzz](https://pypi.org/project/RapidFuzz/) - Fuzzy string matching\n- 📦 [uv](https://docs.astral.sh/uv/) - Dependency management\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenardeinside%2Fchatten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenardeinside%2Fchatten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenardeinside%2Fchatten/lists"}