Technical Architecture
← Back to HomePilar Technical Architecture Documentation
Pilar is a platform made up of specialized components and services that work together to deliver intelligent, bilingual assistance. Each service focuses on a specific part of the workflow:
- Tenaya handles real‑time retrieval and response generation.
- Tioga ingests and processes unstructured documents into AI‑ready knowledge bases.
- Conness provides the database schema for multi‑tenant analytics, performance tracking, and security.
Tenaya - Request Processing and Response Generation
Tenaya is the Retrieval-Augmented Generation (RAG) API system designed to provide intelligent document retrieval and response generation through multiple interfaces. The system serves communities with bilingual support (English/Spanish) and is built with clean architecture principles.
Key Technical Characteristics
- State-of-the-Art Technology: Built with modern AI/ML frameworks and cloud infrastructure
- Multi-Interface Support: Direct API endpoints and SMS webhook processing
- Unified Orchestration: Centralized request processing
- Parallel Processing: Optimized async operations for minimal latency
- Agent-Specific Configuration: Custom knowledge bases and personality profiles
- Production-Ready: Comprehensive error handling, monitoring, and deployment
System Architecture
The system follows a clean layered architecture with clear separation of concerns:
┌─────────────────────────────────────────────────────────────┐ │ Interface Layer │ │ ┌─────────────────┐ ┌─────────────────┐ │ │ │ Direct API │ │ SMS Webhook │ │ │ │ Endpoints │ │ Processing │ │ │ └─────────────────┘ └─────────────────┘ │ └─────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────┐ │ Orchestration Layer (Secret Sauce) │ └─────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────┐ │ Service Layer │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ RAG │ │ AI │ │ Database │ │ │ │ Service │ │ Service │ │ Service │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ └─────────────────────────────────────────────────────────────┘
Core Design Patterns
Unified Orchestration: The system implements a standardized request processing workflow that handles both API and SMS requests through the same core logic. This pattern ensures consistency, reduces maintenance overhead, and provides a single point for business logic updates.
Parallel Processing: The system implements sophisticated parallel processing to minimize latency, with sequential dependencies for agent resolution and user management, while executing independent operations concurrently.
System Components
Interface Layer: Provides two main entry points - a direct API endpoint for programmatic access and an SMS webhook for real-time message processing. Both interfaces validate input, process requests through the unified orchestration layer, and return appropriate responses.
RAG Service: Provides intelligent document retrieval using state-of-the-art infrastructure. It implements semantic search capabilities to find relevant documents from knowledge bases and synthesize responses based on retrieved content.
AI Service: Handles prompt engineering and response generation. It builds contextual prompts combining user messages with conversation history and knowledge base content, then generates responses with comprehensive error handling and fallback mechanisms.
Database Service: Manages data persistence and user interactions through agent configurations, performance tracking, conversation logging, and user interaction tracking.
Resilience Layer: Provides comprehensive error handling and fault tolerance mechanisms with retry logic, timeout protection, and circuit breaker patterns to prevent cascading failures.
Tioga – Document Ingestion & Processing Pipeline
Tioga powers the Document Ingestion and Processing Pipeline within the Pilar platform. It transforms unstructured documents into searchable, AI‑ready knowledge bases that feed into Pilar's intelligent agents and semantic search capabilities.
Core Components
1. Document Processing Pipeline
- Storage Integration – Connects to secure cloud storage buckets for document retrieval
- Format Detection – Automatically identifies file formats and routes to appropriate parsers
- Intelligent Parsing – Specialized parsers handle complex formats (PDF, DOCX) as well as lightweight formats (Markdown, plain text)
- Metadata Enrichment – Adds file origins, processing timestamps, and parser details to every document
- Chunking Strategy – Configurable chunking with overlap to preserve context during retrieval
2. Vector Index Management
- Index Creation – Generates agent‑specific vector indexes in a managed vector database
- Embedding Integration – Uses modern embedding models for semantic vector generation
- Metadata Preservation – Retains full document metadata in the vector store
- Agent Association – Links each index to specific AI agents for targeted retrieval
3. API Layer
- Synchronous Processing – Direct ingestion with immediate response
- Asynchronous Processing – Background job handling for large document sets
- Message Queue Integration – Reliable async processing via a distributed queue system
- Error Handling – Comprehensive error tracking and reporting with retries
Technical Features
- Multi‑Format Support – PDF, DOCX, Markdown, and more
- Parser Selection – Automatically chooses the optimal parser based on file type
- Rate Limiting – Batch processing with configurable delays to prevent throttling
- Parallel Processing – Concurrent file handling for improved throughput
- Graceful Degradation – Continues processing even if individual files fail
- Detailed Logging – Success/failure metrics at every stage
- Resource Cleanup – Automatic deletion of temporary processing resources
Conness – Database Service
Conness is the database service powering multi‑tenant organization support, analytics, and secure data management for the platform. It manages core entities such as organizations, activity logs for full audit tracking, file metadata for document storage, and detailed RAG performance metrics for query analytics. Built with strong security principles, Conness enforces Row Level Security (RLS) for strict data isolation, uses security invoker views to ensure permissions are respected, maintains comprehensive audit logs, and includes account lockout mechanisms to prevent brute force attacks. To ensure speed and scalability, it employs foreign key and composite indexes, partial indexes for active records, text search indexes for message content, and database triggers for automated timestamp updates, hit count tracking, and importance score calculations.
How Tenaya and Tioga Work Together
┌──────────────────────────────────┐ │ Pilar Tioga │ │ Document Ingestion & Processing │ └──────────────────────────────────┘ │ ▼ ┌──────────────────────────────────┐ │ Vector Indexes in LlamaIndex │ │ (with metadata & embeddings) │ └──────────────────────────────────┘ │ ▼ ┌──────────────────────────────────┐ │ Pilar Tenaya │ │ Response Generation (Conness) │ └──────────────────────────────────┘ │ ▼ ┌──────────────────────────────────┐ │ End Users via API or SMS │ └──────────────────────────────────┘
- Tenaya handles the real‑time conversation and retrieval.
- Tioga ensures the knowledge powering those responses is structured, enriched, and ready for search.
- Conness powers secure storage, analytics, and performance insights across organizations.
Joshua fully designed and built Pilar from the ground up, from the architecture and orchestration layer to AI integration, resilience strategies, and observability. This demonstrates an engineering approach focused on starting with real problems, designing for production from day one, and delivering something maintainable, scalable, and measurable. For more technical details or implementing similar systems for your business, contact joshua@sscf.org.