DEVELOPERS
user guides:
AIFAQ Installation & Integration Tutorial
Connecting Data, People, and ProcessesβSecurely
π 1. Overview
AIFAQ (AI-powered FAQ / ChatBridge) connects enterprise data stored in Snowflake and privately owned repositories into a Retrieval-Augmented Generation (RAG) knowledge assistant.
Itβs designed to:
Respect data sovereignty (you keep your data).
Support public vs. private roles for content access.
Integrate easily within the LBGUPS business journey model (Learn β Buy β Get β Use β Pay β Support).
βοΈ 2. Core Installation Principles
Principle | Description | Implementation Focus |
|---|---|---|
Snowflake Data | AIFAQ connects to Snowflake via a secure read-only service account. | Use Snowflake OAuth or key-pair authentication, and configure Network Policies. |
Privately Owned Data | All files, FAQs, and documents remain in your controlled storage (S3, Azure Blob, or local disk). | AIFAQ indexes content locally or through a VPC-hosted vector databaseβnever sends data off-prem. |
Roles & Permissions | Defines who sees what. Public users get anonymized FAQs; private users get contextual data. | Managed via Snowflake roles + AIFAQ Access Tokens. |
π§© 3. Installation Steps
Step 1: Prepare Your Environment
Set up Snowflake with a dedicated Warehouse and Database for AIFAQ.
Create a service role (e.g.,
AIFAQ_READER_ROLE).Grant
SELECTpermissions on specific tables/views you want AIFAQ to access.If using private files: create a secure folder (e.g.,
data/private_docs/) and define read-only access policies.
CREATE ROLE AIFAQ_READER_ROLE;
GRANT USAGE ON DATABASE MYDATA TO ROLE AIFAQ_READER_ROLE;
GRANT SELECT ON ALL TABLES IN SCHEMA MYDATA.PUBLIC TO ROLE AIFAQ_READER_ROLE;
Step 2: Install AIFAQ
Clone the AIFAQ repository (GitHub or local package):
git clone https://github.com/ledgeracademy/aifaq.git cd aifaqInstall dependencies:
pip install -r requirements.txtConfigure your
.envfile:SNOWFLAKE_ACCOUNT=your_account SNOWFLAKE_USER=aifaq_reader SNOWFLAKE_PRIVATE_KEY_PATH=~/.ssh/aifaq_key.p8 VECTOR_DB_URL=postgresql://localhost:5432/aifaqdb DATA_SOURCE_PATH=./data/private_docs
Step 3: Connect to Snowflake
Use the AIFAQ setup CLI to verify Snowflake access:
python setup.py connect-snowflake
If successful, AIFAQ will automatically create metadata tables for:
Documents
Embeddings
Access control lists (ACLs)
Step 4: Index Private Data
Upload and embed your files locally:
python scripts/embed_docs.py --path ./data/private_docs
This will generate embeddings and store them in your private vector DB, keeping sensitive content off the public internet.
Step 5: Define Access Roles
In your AIFAQ Admin Console (localhost:8000/admin):
Create Public, Private, and Admin roles.
Assign permissions to datasets (e.g., public FAQ vs internal support playbook).
Role | Data Access | Example Use Case |
|---|---|---|
Public | Only published FAQs | Website chatbot |
Private | Snowflake + internal docs | Employee knowledge portal |
Admin | All data + logs | Compliance and monitoring |
π§ 4. Integrating with LBGUPS
LBGUPS Stage | How AIFAQ Supports It |
|---|---|
Learn | Create AI-driven FAQ widgets on your website to attract new users. |
Buy | Use contextual chat to simplify the checkout or onboarding journey. |
Get | Auto-generate personalized installation or delivery guides. |
Use | Provide product tutorials (like this one!) directly from your knowledge base. |
Pay | Connect billing/contract FAQs from Snowflake tables securely. |
Support | Enable private, role-based AI assistants for customers and staff. |
π 5. Data Security & Control
Data Never Leaves Your Environment β AIFAQ runs inside your VPC or Snowflake-native app.
Granular Access Controls β Snowflake RBAC + AIFAQ roles ensure data segmentation.
End-to-End Encryption β TLS in transit, AES-256 at rest.
Audit Logging β Every query and data access event is logged for compliance.
π 6. Verification & Testing
After deployment, run:
pytest tests/
Confirm:
Snowflake connection succeeds
Local embeddings are indexed
Public chatbots only show authorized data
β 7. Maintenance & Scaling
Schedule periodic re-embedding for updated datasets.
Use Snowflakeβs Task Scheduler to trigger nightly syncs.
Integrate with Snowflake Cortex AI functions for native enterprise deployment.
π‘ Summary
AIFAQ bridges the gap between fragmented business data and intelligent customer experiencesβall while respecting privacy, ownership, and access control.
By combining Snowflake governance, private data protection, and LBGUPS journey design, you can deliver secure, context-aware AI that works across your organization.
Project Plan: AIFAQ Snowflake Marketplace Launch
π App Name:
AIFAQ ChatBridge
π¬ Tagline:
"Smarter Answers. Seamless Integration. AI Agents for Your Enterprise Data."
ποΈ Soft Launch Timeline (January 2026)
Goal: App listed on Snowflake Marketplace with working demo and documentation by the end
β Key Soft Launch Deliverables
Snowflake Native App: AIFAQ ChatBridge
Functioning RAG-based assistant (with prompt tuning)
App listed on Snowflake Marketplace
GitHub repo with documentation
Internal demo recording & soft launch social post
Β
π§ Application Schema: AIFAQ ChatBridge
π¦ App Purpose:
Enable enterprise users to query structured/unstructured data via a Retrieval-Augmented Generation (RAG) pipeline using Snowflake Cortex and multi-agent orchestration.
π Core Components
Component | Description |
|---|---|
| Table of registered organization users and roles |
| Metadata for ingested documents (PDF, HTML, TXT, etc.) |
| Pre-processed text chunks with embeddings |
| Vector index of chunks used for semantic search |
| Log of user prompts and AI responses |
| System prompts for agents |
| Multi-agent interaction metadata |
| Environment-specific configurations (dev/test/prod) |
π§© Suggested Snowflake Tables & Columns
users
sqlCopyEdit
user_id STRING PRIMARY KEY, email STRING, role STRING, created_at TIMESTAMP
documents
sqlCopyEdit
doc_id STRING PRIMARY KEY, source_url STRING, type STRING, uploaded_by STRING, created_at TIMESTAMP
document_chunks
sqlCopyEdit
chunk_id STRING PRIMARY KEY, doc_id STRING, text STRING, embedding VECTOR(FLOAT), token_count INT, created_at TIMESTAMP
embedding_index
This may be an external vector database or Cortex-compatible Snowflake feature (e.g., VECTOR_SEARCH).
chat_sessions
sqlCopyEdit
session_id STRING, user_id STRING, question TEXT, answer TEXT, sources ARRAY, timestamp TIMESTAMP
π Application Dependencies
π§° Tooling & Frameworks
snowcli: Snowflake CLI for deploying native appsSnowflake Native App Framework: Required for packaging the appCortex: Snowflake's LLM interfaceLangChainorLlamaIndex: For building the multi-agent RAG layerPython: Backend logic (via UDFs or app layer)Streamlit(optional): Local UI prototype
π οΈ Developer Setup Guide: Step-by-Step
β Step 1: Environment Setup
Install Snowflake CLI:
bashCopyEdit
pip install snowflake-cli-labsAuthenticate with your Snowflake environment:
bashCopyEdit
snow auth loginClone the AIFAQ ChatBridge repo:
bashCopyEdit
git clone https://github.com/aifaq/chatbridge-snowflake.git
β Step 2: Schema & Data Prep
Run schema creation scripts:
bashCopyEdit
snow sql -f schema/schema.sqlUpload documents:
Use
PUTandCOPY INTOcommands to load sample PDFs or HTML data.Scripts should split text and embed each chunk using Cortex.
β Step 3: Implement Embedding & Vector Search
Use Cortex or integrated Python UDFs for embedding:
sqlCopyEdit
SELECT SNOWFLAKE.CORTEX.EMBED_TEXT('Your text here');Store vector output in
document_chunks.embedding.Configure semantic search:
Use LangChain
FAISSor similar with a fallback to keyword search.
β Step 4: Chat Interface Logic
Create a chat UDF to:
Accept user query
Retrieve top
krelevant chunks using vector searchFormat prompt with template
Call Cortex for LLM completion
Log all inputs/outputs in
chat_sessions.
β Step 5: Prompt Management
Define
prompt_templatestable to hold:Role-based system prompts
Meta-instructions for specific agents
β Step 6: Testing & Role Security
Test all flows in DEV environment.
Validate masking and permission rules using RBAC:
sqlCopyEdit
CREATE MASKING POLICY ...
β Step 7: Packaging & Deployment
Use
snowclito package app:bashCopyEdit
snow app packagePublish to private listing for test group.
Submit to Snowflake Marketplace for review.
β Optional: UI
Use Streamlit or another frontend to demo:
Chat interface
Query history
Source traceability
π€ Final Deliverables
Snowflake Native App (
chatbridge.snowflakeapp)GitHub repo with deployment scripts and docs
Demo video or live walkthrough
Snowflake Marketplace submission (logo, tagline, README)