A π©π«π’π―πππ²-ππ’π«π¬π πππ ππ ππ¬π¬π’π¬πππ§π ππ¨π« ππ¨π«πππ«ππ¬π¬.
The RAG application runs with a π©π«π’π―ππππ₯π² π‘π¨π¬πππ πππ, ensuring your data never leaves your infrastructure - no third-party AI APIs, no external data sharing.
π§ Dynamic data indexing β create, update, or delete your AI knowledge base directly from the WordPress admin panel
π RAG-powered, only context-aware answers
π Full data ownership & protection
π§© Native WordPress UI
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β (WordPress Admin Panel) β
β http://localhost:8000 β
β Provides interactive web interface for document management β
β and AI-powered question answering β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β User Interaction
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WordPress Plugin (assistant-interface) β
β Location: assistant-interface/wordpress/wp-content/ β
β plugins/assistant-interface/ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Frontend Layer (React + Webpack) β β
β β β’ Renders responsive UI components β β
β β β’ Handles user input and form submissions β β
β β β’ Manages client-side state and interactions β β
β β β’ Compiles JSX/CSS into optimized bundles β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Backend Layer (PHP) β β
β β β’ Processes HTTP requests from frontend β β
β β β’ Manages WordPress integration and hooks β β
β β β’ Forwards API calls to semantic-engine β β
β β β’ Handles authentication and authorization β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Infrastructure (Docker) β β
β β β’ Nginx serves static assets and routes requests β β
β β β’ PHP-FPM processes WordPress application logic β β
β β β’ MySQL stores WordPress data and configurations β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β REST API Calls (HTTP/HTTPS)
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RAG Backend (semantic-engine) β
β Location: ai-assistant/semantic-engine/ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Indexing Module (app/index/) β β
β β β’ Dynamically indexes documents in vector database β β
β β β’ Processes and chunks documents for embedding β β
β β β’ Manages document lifecycle (store/delete/re-index) β β
β β β’ Generates vector embeddings using Ollama β β
β β β β
β β API Endpoints: β β
β β POST /index/store - Index new documents β β
β β DELETE /index/delete - Remove indexed documents β β
β β POST /index/re-store - Reindex existing documents β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Retrieval Module (app/retrieval/) β β
β β β’ Performs semantic search on user queries β β
β β β’ Augments prompts with retrieved context β β
β β β’ Generates AI responses using RAG approach β β
β β β’ Retrieves relevant document chunks and metadata β β
β β β β
β β API Endpoints: β β
β β POST /retrieval - Query with RAG β β
β β GET /retrieval/document - Fetch specific document β β
β β GET /retrieval/documents- List all documents β β
β β GET /retrieval/points - Get vector points β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Infrastructure (Docker) β β
β β β’ Node.js runtime executes application logic β β
β β β’ Nginx reverse proxy with SSL termination β β
β β β’ Ollama integration for embeddings and generation β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β Vector Operations
β (Embedding Storage & Retrieval)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Vector Database (Qdrant) β
β Storage: qdrant_db/ β
β β’ Stores high-dimensional vector embeddings β
β β’ Performs fast similarity search using HNSW algorithm β
β β’ Manages document metadata and payloads β
β β’ Enables semantic retrieval for RAG operations β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β²
β
Powered by Ollama
β
ββββββββββββββββββββββββββββββ
β Ollama (Local AI) β
β β’ Generates embeddings β
β β’ Produces AI responses β
β β’ Runs locally on host β
ββββββββββββββββββββββββββββββ
The RAG system maintains conversation context through an intelligent summarization approach that preserves conversation history while optimizing token usage.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β First Question (Initial Query) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β User Query β
β β β
β βββΊ Semantic Search (Qdrant) β
β β β
β βββΊ Context Retrieval β
β β β
β βββΊ Prompt Augmentation β
β β β
β βββΊ AI Response Generation β
β β
β Output: β
β β’ AI Answer β
β β’ Summary (Initial Context) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Second and Nth Question (Context-Aware Query) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β User Query + Previous Summary β
β β β
β βββΊ Semantic Search (with conversation context) β
β β β
β βββΊ Context Retrieval β
β β β
β βββΊ Prompt Augmentation β
β β (Previous Summary + New Context) β
β β β
β βββΊ AI Response Generation β
β β
β Output: β
β β’ AI Answer β
β β’ Updated Summary β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Context Preservation: Each question builds upon previous interactions
- Token Efficiency: Summaries compress conversation history without losing key information
- Semantic Continuity: Follow-up questions can reference earlier topics naturally
- Scalable Conversations: Long conversations remain manageable through progressive summarization
- Enhanced Retrieval: Cumulative context improves relevance of retrieved documents
ai-assistant-services/
β
βββ ai-assistant/ # Main Git Repository
β βββ semantic-engine/ # RAG Backend Application
β β βββ app/
β β β βββ index/ # Document Indexing Module
β β β β βββ controllers/
β β β β β βββ storeController.js
β β β β β βββ deleteController.js
β β β β β βββ reStoreController.js
β β β β βββ services/
β β β β β βββ createDocumentService.js
β β β β β βββ deleteDocumentService.js
β β β β βββ routes.js
β β β β
β β β βββ retrieval/ # Query & Retrieval Module
β β β β βββ controllers/
β β β β β βββ retrievalController.js
β β β β β βββ getDocumentController.js
β β β β β βββ getDocumentsController.js
β β β β β βββ getPointsController.js
β β β β βββ services/
β β β β β βββ prompt-augmentation.js
β β β β βββ routes.js
β β β β
β β β βββ helpers/
β β β β βββ utilities.js
β β β βββ types/
β β β βββ point.js
β β β
β β βββ docker-configs/ # Docker Configuration
β β β βββ certs/
β β β β βββ cert.pem
β β β β βββ key.pem
β β β βββ default.conf
β β β βββ nginx.dockerfile
β β β βββ node.dockerfile
β β β
β β βββ qdrant_db/ # Vector Database Storage
β β βββ app.js # Main Application Entry
β β βββ docker-compose.yml
β β βββ package.json
β β βββ nodemon.json
β β βββ .env
β β βββ .env-example
β β
β βββ assistant-interface/ # a copy of the plugin
β
βββ assistant-interface/ # WordPress Development Environment
βββ wordpress/ # WordPress Core
β βββ wp-content/
β β βββ plugins/
β β β βββ assistant-interface/ # Main WordPress Plugin
β β β βββ app/
β β β β βββ Core.php # Plugin Core
β β β β βββ Lib/ # Library Classes
β β β β β βββ Response.php
β β β β β βββ Http.php
β β β β β βββ SingleTon.php
β β β β βββ Services/ # Business Logic
β β β β β βββ KnowledgeBase.php
β β β β β βββ AdminInterface.php
β β β β β βββ Assets.php
β β β β βββ Views/
β β β β βββ admin.php
β β β β
β β β βββ resources/ # Frontend Assets (Source)
β β β β βββ components/
β β β β β βββ IndexForm.jsx
β β β β βββ app.js
β β β β βββ app.css
β β β β
β β β βββ build/ # Compiled Frontend Assets
β β β βββ vendor/ # PHP Dependencies (Composer)
β β β βββ node_modules/ # JS Dependencies (npm)
β β β βββ index.php # Plugin Entry Point
β β β βββ composer.json
β β β βββ package.json
β β β βββ webpack.config.js
β β β βββ postcss.config.js
β β β βββ README.md
β β β
β β βββ themes/
β β βββ uploads/
β β
β βββ wp-admin/
β βββ wp-includes/
β βββ wp-config.php
β βββ index.php
β
βββ configs/ # Server Configurations
β βββ nginx/
β
βββ db/ # MySQL Database Files
β βββ mysql/
β βββ performance_schema/
β βββ sys/
β βββ wp/
β
βββ docker-compose.yml # WordPress Docker Setup
- Runtime: Node.js
- Web Server: Nginx (Reverse Proxy)
- Vector Database: Qdrant
- Container: Docker
- AI/ML: Ollama (for embeddings and generation)
- CMS: WordPress
- Backend Language: PHP
- Frontend Framework: React (JSX)
- Build Tool: Webpack
- CSS: PostCSS
- Dependency Management: Composer (PHP), npm (JavaScript)
- Web Server: Nginx
- Database: MySQL
- Container: Docker
- User Input: User interacts with WordPress admin panel
- Frontend Processing: React components handle user interactions
- API Request: WordPress plugin sends HTTP requests to semantic-engine
- Document Indexing: semantic-engine processes and stores documents in Qdrant
- Query Processing: User queries are augmented and sent to Qdrant for semantic search
- AI Generation: Retrieved context is used for RAG-based response generation
- Response Delivery: Results are returned to WordPress and displayed to user
- Docker & Docker Compose
- Node.js & npm
- Composer
- Ollama (for AI capabilities)
cd assistant-interface
docker-compose up -d --buildAccess WordPress at: http://localhost:8000
# Inside the PHP container
cd wordpress/wp-content/plugins/assistant-interface
composer install
npm install
npm run buildcd ai-assistant/semantic-engine
docker-compose up -d --build# Inside the engine container
npm install- POST
/index/store- Index new documents - DELETE
/index/delete- Delete documents - POST
/index/re-store- Re-index documents - POST
/retrieval- Query documents (RAG) - GET
/retrieval/document- Get specific document - GET
/retrieval/documents- Get all documents - GET
/retrieval/points- Get vector points
- Upload and index documents
- Delete and re-index capabilities
- Vector-based storage in Qdrant
- Context-aware query processing
- Prompt augmentation for better results
- Vector similarity search
- Native WordPress admin interface
- React-based interactive UI
- RESTful API integration