Setup Guide
Quick Start
-
Install Dependencies
npm install -
Configure Environment Variables
Create a
.env.localfile in the root directory:# Required: Choose one AI provider ANTHROPIC_API_KEY=your_anthropic_api_key_here # OR OPENAI_API_KEY=your_openai_api_key_here # Required: Choose one vector database PINECONE_API_KEY=your_pinecone_api_key PINECONE_INDEX=your_index_name PINECONE_ENVIRONMENT=your_environment # OR Supabase SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key # Optional: Analytics SUPABASE_DB_URL=your_database_url # App Config NEXT_PUBLIC_SITE_URL=http://localhost:3000 -
Run Development Server
npm run dev -
Open Browser Navigate to http://localhost:3000
Getting API Keys
Anthropic Claude API
- Go to console.anthropic.com
- Sign up or log in
- Navigate to API Keys
- Create a new API key
- Copy and paste into
.env.local
Pinecone (Vector Database)
- Go to app.pinecone.io
- Sign up for a free account
- Create a new index:
- Name:
fountain-qa(or your choice) - Dimensions:
1536(for OpenAI embeddings) or1024(for Claude) - Metric:
cosine
- Name:
- Copy API key and index name to
.env.local
Alternative: Supabase Vector
- Go to supabase.com
- Create a new project
- Enable pgvector extension in SQL editor:
CREATE EXTENSION IF NOT EXISTS vector; - Copy project URL and anon key to
.env.local
Document Processing (Next Steps)
Once you have your source document:
-
Place Document
- Put your Fountain Workflows document in
data/source-document.docx
- Put your Fountain Workflows document in
-
Process Document (when implemented)
npm run process-doc -
Generate Embeddings (when implemented)
npm run generate-embeddings
Testing
Test the system with sample questions:
npm run test-queries
Troubleshooting
"ANTHROPIC_API_KEY is not set"
- Make sure
.env.localexists in the root directory - Verify the API key is correct
- Restart the dev server after adding environment variables
Vector Search Not Working
- The current implementation uses mock data
- You'll need to implement the actual vector search in
lib/vector/search.ts - Or use the simpler approach: put the entire document in Claude's context (200K tokens)
Build Errors
- Run
npm installagain - Delete
.nextfolder and rebuild - Check Node.js version (requires 18+)
Current Status
✅ Completed:
- Project structure
- UI components
- API routes
- AI integration (Claude)
- Intent classification
- Basic query processing
⏳ To Do:
- Document processing pipeline
- Vector database integration
- Embedding generation
- Analytics/logging
- Response caching
Next Steps
-
For MVP (Simpler Approach):
- Skip vector database initially
- Put entire lead-relevant document in Claude's context
- Use Claude 3.5 Sonnet with 200K token context
- Faster to implement and iterate
-
For Production (Full RAG):
- Implement document chunking
- Set up vector database
- Generate embeddings
- Implement similarity search
- Add caching layer
Support
If you encounter issues:
- Check the console for error messages
- Verify all environment variables are set
- Ensure API keys have proper permissions
- Review the README.md for more details
Related Documents
SUMMARY
permalink: ai-implementation
Retrieval & Prompts
Retrieval quality depends on two things: **what the extraction prompt produces**, and **how Vector Storage is configured**. Most people start with Vector Storage settings — but the bigger lever is the prompt. A well-structured memory block retrieves accurately even with default settings. A poorly structured one won't retrieve well no matter how much you tune.
App Review Support Guide — Switch2Go
Switch2Go is an **AAC (Augmentative and Alternative Communication)** app designed specifically for users with **Cerebral Visual Impairment (CVI)**. It allows non-verbal or communication-impaired users to compose and speak phrases entirely hands-free using:
RFC-BLite: High-Performance Embedded Document Database for .NET
**Status:** Draft (living document)