Skip to content

Repository files navigation

Zenlytic RFI Assistant

TL;DR: AI-powered tool for answering security questionnaires, RFIs, and vendor assessments. Uses Claude + Notion + Zenlytic docs to generate citation-backed responses. Restricted to @zenlytic.com Google accounts.

Live: https://zenlytic-rfi-assistant.netlify.app


Table of Contents


Features

Feature Description
Ask Single question lookup with real-time AI responses
Batch Upload Excel/CSV questionnaires, process all at once, download results
Admin Manage approved Q&A pairs for common questions
Google Auth Restricted to @zenlytic.com accounts only
Citations Every response includes source citations

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Netlify (Hosting)                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Frontend (React + Vite + Tailwind)                         β”‚
β”‚  └── packages/web/                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Serverless Functions (Netlify Functions)                   β”‚
β”‚  └── netlify/functions/                                     β”‚
β”‚      β”œβ”€β”€ ask.ts          - Single question endpoint         β”‚
β”‚      β”œβ”€β”€ batch.ts        - Batch processing endpoint        β”‚
β”‚      β”œβ”€β”€ qa-pairs.ts     - Q&A management                   β”‚
β”‚      β”œβ”€β”€ auth-*.ts       - Google OAuth endpoints           β”‚
β”‚      └── _shared/                                           β”‚
β”‚          β”œβ”€β”€ claude.ts   - Claude API + tool orchestration  β”‚
β”‚          β”œβ”€β”€ notion-tools.ts - Notion search/fetch          β”‚
β”‚          β”œβ”€β”€ docs-tools.ts   - Docs search/fetch            β”‚
β”‚          └── auth.ts     - Auth middleware                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  External Services                                          β”‚
β”‚  β”œβ”€β”€ Claude API (Anthropic) - AI responses                  β”‚
β”‚  β”œβ”€β”€ Notion API - Internal policies & procedures            β”‚
β”‚  β”œβ”€β”€ Google OAuth - Authentication                          β”‚
β”‚  └── docs/ submodule - Public documentation                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

Prerequisites

  • Node.js 20+
  • npm
  • Git
  • Zenlytic Google account (@zenlytic.com)

Installation

# Clone with submodules
git clone --recurse-submodules https://github.com/Zenlytic/rfi-assistent.git
cd rfi-assistent

# Install all dependencies
npm install
cd netlify/functions && npm install && cd ../..
cd packages/web && npm install && cd ../..

# Copy environment template
cp .env.example .env

Configure Environment

Edit .env with your credentials (see Environment Variables).

Run Locally

# Option 1: Run servers separately (recommended for debugging)
# Terminal 1 - Functions
npx netlify functions:serve

# Terminal 2 - Frontend
cd packages/web && npm run dev

# Option 2: Run together via Netlify CLI
npx netlify dev

Environment Variables

Required for Core Functionality

Variable Description Where to Get
ANTHROPIC_API_KEY Claude API key console.anthropic.com
NOTION_TOKEN Notion integration token notion.so/my-integrations

Required for Authentication (Production)

Variable Description Where to Get
GOOGLE_CLIENT_ID Google OAuth client ID Google Cloud Console
GOOGLE_CLIENT_SECRET Google OAuth client secret Google Cloud Console
SESSION_SECRET Random 32+ char string for JWT signing openssl rand -hex 32
SITE_URL Production URL https://zenlytic-rfi-assistant.netlify.app

Optional

Variable Description
SLACK_BOT_TOKEN Slack bot integration
SLACK_SIGNING_SECRET Slack webhook verification
SLACK_APP_TOKEN Slack app-level token

Local Development

Project Structure

rfi-assistent/
β”œβ”€β”€ packages/web/           # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   └── hooks/          # Custom React hooks
β”‚   └── vite.config.ts      # Vite configuration
β”œβ”€β”€ netlify/functions/      # Serverless backend
β”‚   β”œβ”€β”€ _shared/            # Shared utilities
β”‚   └── *.ts                # API endpoints
β”œβ”€β”€ docs/                   # Git submodule (zenlytic-docs)
β”œβ”€β”€ config/                 # Static configuration
└── netlify.toml            # Netlify configuration

Common Tasks

# Update docs submodule to latest
git submodule update --remote docs

# Type check
cd packages/web && npm run build

# Add new dependencies to functions
cd netlify/functions && npm install <package>

Deployment

Deployment is automatic via Netlify:

  1. Push to main β†’ Production deploy
  2. Create PR β†’ Deploy preview (unique URL)
  3. Merge PR β†’ Production deploy

Manual Deploy

Trigger from Netlify dashboard or:

npx netlify deploy --prod

Environment Variables in Production

Set in Netlify Dashboard β†’ Site settings β†’ Environment variables.


API Reference

All endpoints require authentication (session cookie).

POST /api/ask

Ask a single question.

Request:

{
  "question": "What encryption does Zenlytic use?",
  "context": "Optional context about the customer"
}

Response:

{
  "answer": "Zenlytic uses AES-256 encryption...",
  "citations": ["Security Policy", "docs.zenlytic.com"],
  "searches": ["search_notion: encryption", "search_docs: encryption"]
}

POST /api/batch

Process multiple questions (max 10).

Request:

{
  "questions": [
    { "id": "1", "question": "SOC2 certified?", "context": "" },
    { "id": "2", "question": "Data retention policy?" }
  ]
}

Response:

{
  "total": 2,
  "processed": 2,
  "results": [
    { "id": "1", "question": "...", "answer": "...", "citations": [] },
    { "id": "2", "question": "...", "answer": "...", "citations": [] }
  ]
}

GET /api/auth-status

Check authentication status.

Response:

{
  "authenticated": true,
  "user": {
    "email": "user@zenlytic.com",
    "name": "User Name",
    "picture": "https://..."
  }
}

GET /api/auth-login

Redirects to Google OAuth.

GET /api/auth-logout

Clears session and redirects to home.


Knowledge Sources

The assistant searches these sources to answer questions:

1. Notion Workspace (Internal)

  • Employee Handbook - HR policies, CC* controls, training
  • Security Homepage - SOC2 reports, audit evidence
  • Engineering Wiki - Architecture, technical documentation

2. Public Documentation (docs.zenlytic.com)

Synced via git submodule from zenlytic-docs:

  • /data-sources/ - Database connection guides
  • /authentication-and-security/ - SSO, security features
  • /legal-and-support/ - Terms, DPA, subprocessors

3. Q&A Pairs (Cached Responses)

Pre-approved answers stored in config/qa-pairs.json. Manage via Admin page.


Contributing

Branch Protection

The main branch is protected:

  • Requires pull request
  • Requires 1 approval (bypass available for admins)
  • No force pushes

Workflow

  1. Create feature branch from main
  2. Make changes
  3. Create PR
  4. Admin review/bypass and merge

Code Style

  • TypeScript for all code
  • React functional components with hooks
  • Tailwind CSS for styling

Security

  • Authentication restricted to @zenlytic.com Google Workspace
  • API keys stored in Netlify environment variables (not in code)
  • Session tokens expire after 7 days
  • All API routes protected with auth middleware

License

Proprietary - Zenlytic Internal Use Only

About

AI-powered application for responding to security questionnaires, RFIs, RFPs, and vendor risk assessments. Uses Claude API with live Notion workspace access to provide citation-backed answers.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages