-
AI Skill
- Access Fingerprinter
- Accessibility Design
- Accountability Profile Builder
- Accountability Profile Verification
- Ad Campaign Optimization
- Advisor Action Framework
- AEO RECOMMENDATION TOOL - SYSTEM PROMPT
- Agentic Task Execution
- AI Candor Probe
- AI Citation Tracking
- AI Content Authenticity Detection
- AI Coworker Trust Protocol
- Ai Document Analysis
- AI Inference Boundary Review
- AI Journalism
- AI Project Showcase Skill
- AI Self-Report Calibration
- AI Vision Diagnosis
- Antigravity Browser QA
- Antigravity Parallel Debug
- Antigravity Test Orchestration
- Apache HTTPD Configuration
- API Design
- Appellate Brief Writer
- Apple Human Interface Design System
- AppSec Engineer — API Security Specialist
- AppSec Engineer — Cloud & Container Security Specialist
- AppSec Engineer — DevSecOps Specialist
- AppSec Engineer — IAM Security Specialist
- AppSec Engineer — Security Testing & Incident Response Specialist
- Arborist / Tree Care Specialist
- Atlanta Gardening
- Atlanta Guide
- B2B Media Consulting
- Botanical Garden Taxonomist
- Botanist / Plant Scientist
- Brand Voice Development
- Breach Data Analysis Specialist
- Business Proposal Evaluation
- Canvas Strategic Nonviolence
- Career Assessment
- Celery Task Management
- Chapter 22: Safety & Guardrails
- Chapter 26: Security Standards
- Chapter 28: Cursor Skills
- Children's Garden Educator
- Citation Checker
- Civic Tech Privacy Architecture
- Civil Resistance Theory
- Claims Integrity Audit
- CloudKit + Tauri Debugging
- Code Review
- Community Engagement Features
- Community Engagement Manager
- Competitive Analysis
- Conflict Zone Osint Specialist
- Conservation Biologist
- Content Gap Analysis
- Content Strategy
- Contract Analysis
- Conversational UI Design
- Cooking Technique Tutorial
- Copywriting
- Corporate Intelligence Investigator
- Culinary Knowledge Lookup
- Curator of Living Collections
- Customer Journey Methodology
- Customer Support
- Cyber Threat Literacy Journalist
- Dark Web Literacy Journalist
- Data Interpretation
- Democratic Health Monitoring
- Democratic Health Monitoring
- Dependency Hygiene
- Design Systems
- Dify Knowledge Base Management
- Director of Education
- Director of Horticulture
- Director of Science & Research
- Dive Conditions Forecasting
- Dive Planning
- Dive Site Data Ingestion
- Diversity, Equity & Inclusion (DEI) Coordinator
- Docker Compose Management
- Document Research Specialist
- Domain Infrastructure Investigator
- Education Curator
- Education Program Coordinator
- Eighth Amendment Legal Expert
- Election Law and Administration
- Election Threat Scenario Planner
- Election Threat Scoring
- Email Campaign Automation
- Email Parsing — Travel Bookings
- Environmental Osint Specialist
- Estate Accounting
- Estate and Trust Management
- Estate Document Extraction
- Estate Jurisdiction Engine
- Estate Manager — Build Plan
- Estate Manager — Updated Product Roadmap
- Estate Professional — CPA / Accountant
- Estate Professional — Elder Law Attorney
- Estate Professional — Enrolled Agent
- Estate Professional — Estate Planning Attorney
- Estate Professional — Financial Advisor
- Estate Professional — Insurance Agent
- Estate Professional — Probate Attorney
- Estate Professional — Probate Litigation Attorney
- Estate Professional — Real Estate Agent
- Estate Professional — Real Estate Appraiser
- Estate Professional — Real Estate Attorney
- Estate Professional — Tax Attorney
- Estate Professional — Title Company
- Estate Task Automation
- EventKit Calendar Sync
- Executive Advisor Board — Build Plan
- Executive Advisor Board — Updated Product Roadmap
- Executive Board Advisor
- Executive CCO (Chief Customer Success Officer)
- Executive CEO
- Executive CFO
- Executive CHRO
- Executive CMO
- Executive COO
- Executive CPO (Chief Product Officer)
- Executive CRO (Chief Revenue Officer)
- Executive CTO
- Executive General Counsel
- Expat Planning
- Expat Tax Compliance
- Fact-Checking
- Family Gamification Design
- FastAPI Development
- Federal Register API Integration
- FIFA 2026 World Cup Travel Advisory
- Fifth Amendment Legal Expert
- Financial Analysis
- First Amendment Legal Expert
- Flask Application Development
- FLUX Image Generation
- FLUX Operations
- Fourteenth Amendment Legal Expert
- Fourth Amendment Legal Expert
- Garden Technician
- Gardener / Groundskeeper
- Gene Sharp 198 Methods
- Generative Engine Optimization
- Geolocation Verification Specialist
- GIS / Mapping Specialist
- Grateful Dead Historian
- Greenhouse Manager
- Greenhouse Technician
- Guided Content Journeys
- Head Gardener / Garden Manager
- Herbarium Curator
- Horticulturist
- Image Generation Service Operations
- Immigration Detention Rights Expert
- Immigration Know Your Rights Expert
- Immigration Removal Defense Expert
- Immigration Workplace Enforcement Expert
- Influencer Marketing
- Infrastructure Operations
- Infrastructure Upgrades
- Integrated Pest Management (IPM) Specialist
- Interaction Design
- Internship Program Coordinator
- Interview Coaching Design
- Investigation Workflow Designer
- Irrigation Specialist
- ITI Audience Development
- ITI Consulting Intake
- ITI Content Strategy
- ITI Financial Modeling
- ITI Marketing Tone & Brand Voice
- ITI MD to Wordpress HTML Converter
- ITI Quality Assurance
- ITI Report Synthesis
- ITI Strategic Planning
- ITI Technology Strategy
- ITI Token Compression Skill
- Java Development
- Journey Mapping
- Landing Page Optimization
- Lead Qualification
- Legal Research Specialist
- Litigation Support Ediscovery Analyst
- Local SEO Optimization
- Marine Life Identification
- Market Research
- MCP Client for Tauri
- MCP Server Development
- Meal Planning
- Media Verification Specialist
- Meeting Management
- Mental Load Equity Design
- Multi-Agent Deliberation Design
- Multilingual Content Management
- Music Discovery
- n8n + Dify Testing
- n8n Debugging
- n8n Workflow Development
- Network Analysis Specialist
- News Credibility Scoring
- Nginx Reverse Proxy
- Objection Handling
- Onboarding Design
- Osint Automation Frameworks
- Osint Identity Researcher
- Osint Training Curriculum Designer
- Patriot Access Fingerprinter
- Patriot News Orchestrator
- Patriot Press Freedom Tracker
- Patriot Private Citizen Inclusion Gate
- Patriot Sanity Check
- Patriot Source Scanner
- Patriot Speech Analyzer
- Patriot Voting Research
- Pinecone Embedding Management
- Podcast Production
- Policy Analyst Legislative Specialist
- Political Speech Analyzer
- Portfolio HTML Files - Creation Summary
- PostgreSQL Administration
- Presentation Design
- Press Release Writing
- PRISM ZIP Code → Zone Lookup
- Privacy Compliance
- Product Design
- Product Roadmap Update Prompt
- Professional Selection
- Project Management
- Prompt Auditor
- Proposal Evaluation
- Public Corruption Ombudsman
- Public Records Research Specialist
- Public Relations Manager
- RabbitMQ Messaging
- Recipe Formatting
- Redis Operations
- Release Management
- Requirements Writing
- Research Associate / Lab Technician
- Retirement Calculator Engine
- Roadmap Build Planning
- Safety Guardrails
- Salary Negotiation Frameworks
- Schema Markup Generation
- School Programs Specialist
- Scope Control
- Scouting Trip Planning
- Screenshot Capture Guide
- Secure Source Communication
- Seed Bank Curator
- SEO & AEO Optimization
- Separation of Powers Legal Expert
- Session Context Protocol
- Sixth Amendment Legal Expert
- Skills Index
- Social Media Content Calendar
- Spokesperson Profile Builder
- Stable Diffusion Image Generation
- Tauri Desktop Development
- Tavily & Pinecone Integrations
- Tavily API Quick Reference - Factchecker Plugin
- Tech Debt Analysis
- Technical Writing
- Tenth Amendment Legal Expert
- Test Plan Writing
- Therapeutic Horticulture Program Manager
- Transportation Osint Investigator
- Travel Planning
- Trump Corruption Accountability Tracker
- Trump Family Financial Tracker
- Trump Voter Impact Framing
- Truth Bridging Talking Points
- Truth Reconciliation Design
- Truth Reconciliation Implementation
- TSP Route Optimization
- Twenty Second Amendment Legal Expert
- UI Design
- Us Truth Reconciliation Roadmap
- UX Research
- Vibe Coding Guardrails
- Video Scripting
- Visual Brand Design
- Volunteer Coordinator
- Voter Suppression Law
- Voting Rights Act Expert
- Weather Underground PWS Integration
- Weather-Disease Modeling
- Wildlife Habitat Certification Guide
- Wireless Spectrum Osint Specialist
- WordPress Development
- WordPress Role-Based Access
- WordPress SEO Plugin Integration
- Workflow Adapter Integration
- Show Remaining Articles (283) Collapse Articles
-
Product Showcase
- AEO Optimizer Product Showcase
- AI News Cafe Product Showcase
- AI Project Showcase: Journey Mapper (Customer Journey Mapper)
- AI Project Showcase: SEO Assistant with LLM
- Estate Manager Product Showcase
- Executive Advisor Board Product Showcase
- Expat Advisor Showcase
- Factchecker Product Showcase
- Farmers Bounty Product Showcase
- Gardener's Bounty AI Assistant Product Showcase
- GD Claude Chatbot Product Showcase
- IT Influentials Agent POC Product Showcase
- IT Influentials Agent Product Showcase
- IT Influentials Express Agents Product Showcase
- My TravelPlanner Product Showcase
- Patriot Agent Product Showcase
- Patriot University Showcase
- ScubaGPT — Product Showcase
- ScubaGPT Showcase
- WordPress Plugin Clone Safety Checker Showcase
- Show Remaining Articles (5) Collapse Articles
-
ITI Knowledge System
- Chapter 1: Introduction
- Chapter 10: n8n — Debugging & Operations
- Chapter 11: Dify — Knowledge Bases & RAG
- Chapter 12: The ITI Workflow Adapter
- Chapter 13: The ITI Shared Library
- Chapter 14: WordPress Plugin Development
- Chapter 15: Desktop Apps with Tauri 2
- Chapter 16: Python Services
- Chapter 17: iOS & macOS with Swift
- Chapter 18: Claude & the Anthropic API
- Chapter 19: Prompt Engineering
- Chapter 2: Workspace Overview
- Chapter 20: Agents, Skills & Pipelines
- Chapter 21: Knowledge Bases
- Chapter 22: Safety & Guardrails
- Chapter 23: Build Session Protocol
- Chapter 24: Required Product Artifacts
- Chapter 25: Testing
- Chapter 26: Security Standards
- Chapter 27: Deployment
- Chapter 28: Cursor Skills
- Chapter 29: Cursor Rules
- Chapter 3: The Docker Stack
- Chapter 30: MCP Integrations
- Chapter 31: Builder and Agent Roles
- Chapter 32: Builder's Portfolio
- Chapter 33: Claims Integrity & Content Governance
- Chapter 4: Daily Operations
- Chapter 5: Infrastructure Upgrades
- Chapter 6: PostgreSQL & pgvector
- Chapter 7: Redis
- Chapter 8: Nginx Reverse Proxy
- Chapter 9: n8n — Workflow Development
- Show Remaining Articles (18) Collapse Articles
-
AI Agent
-
User Guide
- ADMIN-SHORTCODES.html Update Summary
- Factchecker Plugin - Installation Guide
- Factchecker Plugin - Troubleshooting Guide
- Farmers Bounty - Quick Start Guide
- Farmers Bounty - Troubleshooting Guide
- Farmers Bounty - User Guide
- Farmers Bounty Chatbot - Complete Documentation
- Farmers Bounty Desktop User Guide
- Farmers Bounty Plugin - Gardener's Review Guide
- Farmers Bounty Plugin v6.6.0 - Release Notes
- Farmers Bounty v2.0 - Complete User Guide
- Farmers Bounty v5.3.0 - Complete User Guide
- SEO Assistant with LLM
- 🌱 Farmers Bounty Homepage Shortcode - Quick Start
- 🌱 Farmers Bounty Shortcodes
- 🌹 Grateful Dead Chatbot - Quickstart Guide ⚡
- Show Remaining Articles (1) Collapse Articles
-
Requirements
-
ScubaGPT
-
Grateful Dead Chatbot
-
Farmers Bounty
- 01 current state analysis
- 02 architecture overview
- 03 data sources
- 05 cost analysis
- 06 database schema
- 08 ui ux changes
- 09 ai context optimization
- 10 testing validation
- 11 risk mitigation
- 12 implementation checklist
- ADMIN-SHORTCODES.html Update Summary
- Atlanta Gardening
- Beneficial Insects Guide for Georgia Gardens
- Botanical Garden Taxonomist
- Children's Garden Educator
- Farmers Bounty - Quick Start Guide
- Farmers Bounty - Troubleshooting Guide
- Farmers Bounty - User Guide
- Farmers Bounty Chatbot - Complete Documentation
- Farmers Bounty Desktop User Guide
- Farmers Bounty Plugin - Gardener's Review Guide
- Farmers Bounty Plugin v6.6.0 - Release Notes
- Farmers Bounty v2.0 - Complete User Guide
- Farmers Bounty v5.3.0 - Complete User Guide
- Glossary
- Integrated Pest Management (IPM) Specialist
- PRISM ZIP Code → Zone Lookup
- Public Relations Manager
- Recipe Formatting
- Research Associate / Lab Technician
- School Programs Specialist
- Seed Bank Curator
- Volunteer Coordinator
- Weather-Disease Modeling
- Wildlife Habitat Certification Guide
- 🌱 Farmers Bounty Homepage Shortcode - Quick Start
- 🌱 Farmers Bounty Shortcodes
- Show Remaining Articles (22) Collapse Articles
-
Technical Document
- Accessibility Design
- Agentic Task Execution
- AI Candor Probe
- AI Coworker Trust Protocol
- AI Inference Boundary Review
- AI Vision Diagnosis
- Antigravity Browser QA
- Antigravity Parallel Debug
- Antigravity Test Orchestration
- AppSec Engineer — IAM Security Specialist
- Chapter 22: Safety & Guardrails
- Chapter 26: Security Standards
- Civic Tech Privacy Architecture
- ClaimReview Schema Integration
- Claims Evidence Registry
- Code Review
- IT Influentials Express Agents Product Showcase
- Java Development
- MCP Client for Tauri
- MCP Server Development
- Nginx Reverse Proxy
- Pinecone Embedding Management
- PostgreSQL Administration
- Product Roadmap Update Prompt
- Prompt Auditor
- RabbitMQ Messaging
- Redis Operations
- Release Management
- Retirement Calculator Engine
- Roadmap Build Planning
- Schema Markup Generation
- ScubaGPT — Architecture
- ScubaGPT Safety Guardrails - Quick Reference
- Session Context Protocol
- Stable Diffusion Image Generation
- Tauri Desktop Development
- Tavily & Pinecone Integrations
- Tavily API Quick Reference - Factchecker Plugin
- Tech Debt Analysis
- Test Plan Writing
- Travel Planner — n8n + Dify Integration Guide
- UI Design
- UX Research
- Vibe Coding Guardrails
- WordPress Plugin Clone Safety Checker Showcase
- Workflow Adapter Integration
- Show Remaining Articles (31) Collapse Articles
-
Answer Engine Optimizer
-
SEO Optimizer
-
Travel Planner
-
Fact Checker
-
Estate Manager
-
ITI Operations
- Access Fingerprinter
- Accessibility Design
- Advisor Action Framework
- Agentic Task Execution
- AI Candor Probe
- AI Content Authenticity Detection
- AI Coworker Trust Protocol
- AI Inference Boundary Review
- AI Project Showcase Skill
- AI Self-Report Calibration
- Antigravity Browser QA
- Antigravity Parallel Debug
- Antigravity Test Orchestration
- Apple Human Interface Design System
- AppSec Engineer — API Security Specialist
- AppSec Engineer — DevSecOps Specialist
- Chapter 32: Builder's Portfolio
- CloudKit + Tauri Debugging
- Code Review
- Content Strategy
- Customer Journey Methodology
- Customer Support
- Data Interpretation
- Dependency Hygiene
- End-User Documentation Requirements Document
- Farmers Bounty Plugin - Gardener's Review Guide
- Generative Engine Optimization
- Guided Content Journeys
- Influencer Marketing
- Infrastructure Upgrades
- Interaction Design
- IT Influentials Agent POC Product Showcase
- IT Influentials Agent Product Showcase
- IT Influentials Express Agents Product Showcase
- ITI Audience Development
- ITI Consulting Intake
- ITI Financial Modeling
- ITI Quality Assurance
- ITI Report Synthesis
- ITI Strategic Planning
- ITI Token Compression Skill
- Market Research
- MCP Server Development
- Multi-Agent Deliberation Design
- Multilingual Content Management
- n8n Debugging
- n8n Workflow Development
- Pinecone Embedding Management
- Privacy Compliance
- Product Roadmap Update Prompt
- Project Management
- Prompt Auditor
- Proposal Evaluation
- Redis Operations
- Release Management
- Requirements Writing
- Roadmap Build Planning
- Safety Guardrails
- Scope Control
- Screenshot Capture Guide
- Stable Diffusion Image Generation
- Tavily & Pinecone Integrations
- Technical Writing
- Test Plan Writing
- UI Design
- UX Research
- Vibe Coding Guardrails
- Wordpress Plugin Install Safety Features
- Show Remaining Articles (53) Collapse Articles
-
ITI Marketing
- Articles coming soon
-
Patriot University
-
Personal Assistant
Chapter 11: Dify — Knowledge Bases & RAG
Chapter 11: Dify — Knowledge Bases & RAG
Last Updated: 2026-03
## 11.1 Overview
Dify is the AI knowledge management platform. It provides:
– Knowledge bases — collections of documents chunked, embedded, and stored for retrieval.
– RAG (Retrieval-Augmented Generation) — the pipeline that retrieves relevant document chunks based on a query and injects them into an LLM prompt.
– LLM app configuration — a UI for designing and testing AI applications without writing code.
– REST API — accessed at http://localhost:3001 (through the Nginx proxy) for integration with n8n and product code.
The Dify console is at http://localhost:3000. This is the primary interface for managing knowledge bases and testing retrieval.
11.2 Knowledge Base Architecture
Document Input
│
▼
Chunking Split document into segments (e.g., 1000 chars, 100 overlap)
│
▼
Embedding Each chunk → vector via text-embedding-3-small (1536 dims)
│
▼
Storage Vector stored in PostgreSQL via pgvector
│ Metadata stored in PostgreSQL
│
At Query Time:
│
Query Embedding User query → vector
│
▼
Vector Search Find top-K chunks by cosine similarity
│
▼
Reranking (Optional) rerank results for precision
│
▼
Injection Chunks injected into LLM system prompt
│
▼
LLM Response Model generates answer grounded in retrieved context
11.3 Creating a Knowledge Base
- Open Dify console at
http://localhost:3000. - Navigate to Knowledge in the top navigation.
- Click Create Knowledge.
- Choose the data source:
- File Upload — PDF, DOCX, TXT, Markdown, HTML
- URL Sync — Crawl a web page or sitemap
- Notion — Sync from a Notion workspace
- Configure chunking:
- Automatic — Dify determines chunk size based on content type.
- Custom — Set chunk size (characters) and overlap manually.
- Choose the embedding model:
text-embedding-3-small(OpenAI) is the ITI default. - Click Save and Process.
Dify submits the indexing job to the Celery worker queue. Processing time depends on document size — a 100-page PDF typically takes 2–5 minutes.
11.4 Chunking Strategy
Chunk size and overlap significantly affect retrieval quality. ITI defaults:
| Setting | ITI Default | Notes |
|---|---|---|
| Chunk size | 1000 characters | Good for dense technical content |
| Overlap | 100 characters | Prevents context loss at chunk boundaries |
| Separator | Paragraph \n\n |
Preserves semantic units |
When to adjust:
- Long-form narrative content (articles, reports): larger chunks (1500–2000 chars) preserve more context per retrieved segment.
- Structured data (tables, FAQs, Q&A pairs): smaller chunks (500 chars) with exact sentence separators.
- Legal or regulatory content: preserve paragraph boundaries; use
\n\nas separator with 1000-char chunks.
11.5 Retrieval Testing
Before integrating a knowledge base into a product workflow, always test retrieval quality.
- Open the knowledge base in the Dify console.
- Click Retrieval Testing (top right).
- Enter representative queries that users will actually ask.
- Review:
- Are the top results relevant? Score should be > 0.7 for a well-configured KB.
- Is the retrieved text complete enough? If chunks are cut mid-sentence, increase chunk size or adjust separators.
- Are irrelevant results appearing? Consider reducing the top-K value or adding metadata filters.
Interpreting retrieval scores
| Score Range | Meaning |
|---|---|
| > 0.85 | Excellent match — very relevant content |
| 0.70–0.85 | Good match — relevant, may need refinement |
| 0.50–0.70 | Weak match — may introduce noise |
| < 0.50 | Poor match — likely irrelevant |
Configure the Score Threshold in the KB settings to filter out results below a minimum score.
11.6 Re-indexing a Knowledge Base
Re-index when:
- The embedding model has changed.
- Retrieval quality has degraded.
- The chunking configuration was changed.
- New documents were added that need consistent chunking.
Via Dify UI: Knowledge > select dataset > Re-index button.
Via Dify API:
curl -X POST "http://localhost:3001/console/api/datasets/<dataset-id>/indexing-estimate" \
-H "Authorization: Bearer <dify-api-key>" \
-H "Content-Type: application/json"
Note: Re-indexing deletes all existing embeddings for the dataset and regenerates them. For large datasets, this can take 10–30 minutes and will temporarily affect retrieval for any active workflows using that KB.
11.7 Integrating Dify KBs with n8n
The standard pattern for calling a Dify knowledge base from an n8n workflow:
// HTTP Request node configuration
{
url: "http://iti-dify-nginx:80/v1/datasets/<dataset-id>/retrieve",
method: "POST",
headers: {
"Authorization": "Bearer {{ $credentials.difyApiKey }}",
"Content-Type": "application/json"
},
body: {
query: "{{ $json.userQuery }}",
retrieval_model: {
search_method: "semantic_similarity",
top_k: 5,
score_threshold: 0.70,
score_threshold_enabled: true
}
}
}
Note: Within the Docker network, n8n nodes use the internal container name (
iti-dify-nginx) rather thanlocalhost. The internal port is80(not3001which is the host-exposed port).
11.8 Dify API Reference (Common Endpoints)
All endpoints are called against http://localhost:3001 from external clients, or http://iti-dify-nginx:80 from within the Docker network.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/console/api/datasets |
List all knowledge bases |
POST |
/console/api/datasets |
Create a new knowledge base |
GET |
/console/api/datasets/ |
Get KB metadata |
POST |
/v1/datasets/ |
Query a KB (retrieve chunks) |
POST |
/console/api/datasets/ |
Upload a document |
GET |
/console/api/datasets/ |
List documents in a KB |
DELETE |
/console/api/datasets/ |
Remove a document |
Authentication: Authorization: Bearer . The Dify API key is found in the Dify console under Settings > API Keys.
11.9 Troubleshooting Dify
Documents stuck in “Indexing” state
The Dify worker may be backed up or crashed.
# Check worker status
docker compose ps iti-dify-worker
# Check worker logs
docker compose logs iti-dify-worker --tail 50
# Check Redis queue depth
docker exec iti-redis redis-cli llen celery
# Restart worker if stuck
docker compose restart iti-dify-worker
Retrieval returns no results
- Verify the dataset ID is correct.
- Check that at least one document in the KB has status “Available” (not “Indexing” or “Error”).
- Lower the score threshold to 0.5 and test again.
- Verify the embedding model is configured correctly in the KB settings.
Dify console not loading (3000)
docker compose logs iti-dify-web --tail 20
docker compose restart iti-dify-web
Previous: Chapter 10 — n8n Debugging & Operations | Next: Chapter 12 — The ITI Workflow Adapter
