Agentic Data Assistant

Demo

Note: I saw an open-source project on GitHub (its code can be seen in the Reference section at the bottom) a while ago, and I am implementing/integrating the features below on top of it.

My main motivation behind the project is to improve my skills in building a full-stack application that is ready to be used by real people and, more importantly, to enhance my understanding of how various components in a full-stack application work together, rather than just building a simple chatbot.

Features

Agentic System

Evaluation

Frontend

Backend

Security

Deployment

System

HTTPS: Certificates and the TLS Handshake

Sign Up, Log In, Argon2id Password Hashing, and JWT Authentication

File Upload

Agentic Data Extraction

Agents

Containerization, Orchestration, and Deployment on AWS EC2

Evaluation

Manual Data Collection

The list of web pages that have the technical information that might be beneficial for the agents:

Offline Evaluation

Online Evaluation

Evaluation Platform

To track these metrics, there were many options such as:

Considering that I had already used LangChain and LangGraph during the process, and that LangSmith already provides many features that make it easy to evaluate the system and build dashboards, I decided to use LangSmith.

Dashboard

To be announced

Deploy in AWS

1) Create EC2 Instance

Note: By default, EC2 blocks all inbound traffic. The security group acts as a firewall for the EC2 instance and determines which sources and ports are allowed to access the machine.

2) Connect and Prepare the Machine

Run the command below in your computer’s terminal to connect to the EC2 instance from the terminal.

ssh -i your-key.pem ubuntu@your-public-ip

This connects your terminal to the EC2 instance. Next, run the commands below to install Git, Docker, and Docker Compose on EC2, start Docker, and add the ubuntu user to the docker group so you can run Docker without sudo.

sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io git
sudo systemctl enable --now docker
sudo usermod -aG docker ubuntu
sudo apt install -y docker-compose-plugin

3) Deploy Code

Clone the project repository from GitHub.

git clone https://github.com/ozyurtf/agentic-data-assistant.git
cd agentic-data-assistant

Create a files folder inside the api folder.

mkdir -p api/files

Copy the variables below.

# Cesium 
VUE_APP_CESIUM_TOKEN=<your_cesium_ion_token>   # Get from https://ion.cesium.com/signin
VUE_APP_CESIUM_RESOURCE_ID=3

# Google Maps Platform
VUE_APP_GOOGLE_MAPS_KEY=<your_google_maps_key>

# MapTiler 
VUE_APP_MAPTILER_KEY=<your_maptiler_key>       

# OpenAI 
LLM_PROVIDER=anthropic
OPENAI_API_KEY=<your_openai_api_key>         
ANTHROPIC_API_KEY=<your_anthropic_api_key>

# Firecrawl
FIRECRAWL_API_KEY=<your_firecrawl_api_key>     # Get from https://www.firecrawl.dev

# Chatbot
CHAINLIT_AUTH_SECRET=<your_chainlit_secret>    # Get from https://docs.chainlit.io/authentication/overview

# Set the maximum file size allowed for uploading
MAX_FILE_SIZE_MB=100

# Set how long cached data should stay in Redis (in seconds)
CACHE_TTL_SECONDS=3600

# Set the number of data types that can be extracted from the file in a single request.
MAX_MESSAGE_TYPES=3

# App settings
USER_AGENT=drone-chatbot

# Ports and hosts 
REDIS_PORT=6379
CHATBOT_PORT=8000
API_PORT=8001

# Redis password
REDIS_PASSWORD=<enter_a_password_for_redis>

# Auth
JWT_SECRET=<a_long_random_string>               # Generate with: python3 -c "import secrets; print(secrets.token_urlsafe(48))"
JWT_TTL_SECONDS=604800                          # JWT validity window, in seconds (default: 7 days)
AUTH_COOKIE_SECURE=true                         # Set to true in production (requires HTTPS)
AUTH_COOKIE_SAMESITE=lax                        # lax (default) for same-origin dev; none + secure=true for cross-site iframes

Create an empty .env file, set the values of the copied variables inside the .env file, and save it.

touch .env
nano .env 

4) Register a Domain Name

Buy a domain (let’s call it agenticdas.com) from a registrar (e.g., Namecheap, Cloudflare, GoDaddy, or Google Domains). A .com domain costs about $10/year.

5) Point the Domain at the EC2 Instance

In the DNS panel, create two A records for mapping the domain into the IP address of the EC2 instance:

6) Verify the Mapping Locally

Run the command below in your terminal to verify whether the domain points to the EC2 created in the 1st step.

dig +short agenticdas.com

7) Obtain a Certificate from Certificate Authority

Install the Certbot on the EC2.

sudo apt install -y certbot
sudo certbot certonly --standalone -d agenticdas.com -d www.agenticdas.com

After this, the certificate (fullchain.pem) and the private key (privkey.pem) are saved to the EBS volume (/etc/letsencrypt/live/agenticdas.com/).

Note: The nginx.conf.template file references these files:

ssl_certificate /etc/letsencrypt/live/agenticdas.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/agenticdas.com/privkey.pem;

8) Enable Secure Cookies

Make sure that AUTH_COOKIE_SECURE is defined as true in the .env file.

9) Launch Services in EC2

docker compose up -d --build

10) Access

References