Skip to content

renardeinside/chatten

Repository files navigation

🚀 Chatten

RAG with sources, built with Dash, FastAPI, and the Databricks platform.


💫 Showcase

Here is an example of the app in action:

chatten

🛠 Developer Setup

To install the project, ensure you have the following dependencies:

📥 Installation Steps

  1. Clone the repo:

    git clone <repo-url>
  2. Run sync:

    uv sync --all-packages
  3. Configure environment variables in the .env file:

    # Name of your Databricks profile
    CHATTEN_PROFILE=...
    
    # Optionally, you can include any bundle or Chatten variables:
    CHATTEN_CATALOG=...
    
    # Optionally, by check default values in databricks.yml
    BUNDLE_VAR_vsi_endpoint=...

🏗 Development

  1. Start the UI watcher in one terminal:

    cd packages/chatten_ui && npm run watch
  2. Run the server in another terminal:

    uvicorn chatten_app.app:app --reload

🚀 Deployment

  1. Authenticate with Databricks:

    databricks auth login -p <profile-name>
  2. Deploy the app:

    # See Makefile for additional variables
    make deploy profile=fe-az-ws catalog=<catalog-name>
  3. Run the RAG workflow:

    # See Makefile for additional variables
    make run-rag profile=fe-az-ws catalog=<catalog-name>
  4. Grant app principal access to the Volume.

  5. Run the app:

    make run-app profile=fe-az-ws catalog=<catalog-name>
  6. Open the app from Databricks Workspace 🎉


🤖 Agent Serving Endpoint Response Parsing

Check the api_app source code for details on how the agent serving endpoint response is parsed.

Specifically, the /chat API endpoint handles:

  • Parsing responses
  • Sending messages to the chat interface

🏛 App Implementation Details

The implementation consists of a FastAPI backend with two sub-apps:

  1. Dash app (/ route): Uses a custom component to render the chat UI.
  2. FastAPI app (/api route): Provides API endpoints for the chat.

The chat is implemented as a custom Dash component, which is a React-based UI element that communicates with the FastAPI backend.

The /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.


📂 Code Structure

📦 chatten  # Main package (FastAPI + Dash app)
 ┣ 📂 packages/chatten_ui  # Dash UI & custom chat component
 ┣ 📂 packages/chatten_rag  # RAG workflow implementation
 ┣ 📂 packages/chatten_app  # FastAPI & Dash apps
 ┣ 📂 src/chatten  # Common config & utilities
 ┣ 📂 src/chatten/app.py  # Main entry point

🏗 Technologies Used

🔥 Core Platform

🏗 Frameworks & Libraries

About

RAG application (backend & frontend) with sources retriveal and highlighting on the Databricks Platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published