ваше сообщение коммита

This commit is contained in:
2025-11-20 21:11:44 +03:00
parent 970b53e5ba
commit b295bb9bd9
23 changed files with 9807 additions and 2 deletions

1196
docs-en/FAQ.md Normal file

File diff suppressed because it is too large Load Diff

29
docs-en/README.md Normal file
View File

@@ -0,0 +1,29 @@
# 📚 Digital Legal Entity Documentation
**🌐 Language / Язык:** [🇷🇺 Русский](../docs/README.md) | [🇬🇧 English](README.md)
This section contains materials about the DLE product: overview, business cases, technical specifications, and implementation instructions. Use the list below to quickly find the document you need.
## 📄 Available Documents
| File | Brief Description |
| --- | --- |
| [application-description.md](./application-description.md) | Overview of the platform's purpose, key benefits, and economic impact. |
| [ai-assistant.md](./ai-assistant.md) | Detailed description of AI assistant capabilities and business cases. |
| [setup-ai-assistant.md](./setup-ai-assistant.md) | Step-by-step setup of a local AI assistant with vector search. |
| [setup-instruction.md](./setup-instruction.md) | Main installation and initial configuration instructions. |
| [blockchain-for-business.md](./blockchain-for-business.md) | Business justification and use cases for blockchain in DLE. |
| [blockchain-integration-technical.md](./blockchain-integration-technical.md) | Technical architecture of blockchain integration and smart contracts. |
| [security.md](./security.md) | Security model, access control, and protection mechanisms. |
| [service-terms.md](./service-terms.md) | Detailed terms for license purchase and maintenance. |
| [FAQ.md](./FAQ.md) | Answers to frequently asked questions about licensing, installation, and features. |
| [system-messages-management.md](./system-messages-management.md) | Technical specification for system message management. |
| [tables-system.md](./tables-system.md) | Description of the electronic tables system, architecture, and integrations. |
---
### 🔗 Related Materials
- Legal documents and requirements are available in the [`../legal-en`](../legal-en/README.md) directory.
- Updates and additional information are published in the root [`README`](../README.md).

387
docs-en/ai-assistant.md Normal file
View File

@@ -0,0 +1,387 @@
# DLE AI Assistant - Complete Business Capabilities
> **Philosophy**: AI doesn't replace people, but becomes their co-pilot, freeing up 85% of time for strategy and creativity.
## 📋 Table of Contents
1. [Introduction](#introduction)
2. [Technology and Architecture](#technology-and-architecture)
3. [Complete AI Assistant Capabilities](#complete-ai-assistant-capabilities)
4. [Economic Impact](#economic-impact)
5. [Setup and Integration](#setup-and-integration)
---
## Introduction
### What is AI Assistant in DLE?
**AI Assistant** is a built-in intelligent assistant that uses:
- 🧠 **Ollama** - local open-source AI models (qwen2.5:7b)
- 🔍 **Vector Search** - FAISS for semantic search
- 📚 **RAG** (Retrieval-Augmented Generation) - knowledge base search
- 💾 **Caching** - instant responses to frequent questions
### Key Benefits
1. **🏠 100% Local** - all data on your server
2. **🔒 Complete Privacy** - nothing goes to the cloud
3. **⚡ Lightning-fast Responses** - caching and vector search
4. **💰 Zero API Costs** - no token payments
5. **📈 Learns from Your Data** - personalized responses
6. **🌍 Multilingual** - supports Russian, English, and more
7. **🔄 24/7 Availability** - works around the clock
---
## Technology and Architecture
### How It Works?
```
┌─────────────────────────────────────────────────────────┐
│ AI Assistant Architecture │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ 1. User asks a question │
│ "How to return a product?" │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 2. Question Vectorization │
│ Ollama mxbai-embed-large:latest │
│ Text → Vector [768 numbers] │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 3. Vector Search (FAISS) │
│ Search for similar questions │
│ Top-3 results by semantics │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 4. Contextual Search (RAG) │
│ Extract answers from knowledge base │
│ Filter by tags/products │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 5. Answer Generation (LLM) │
│ Ollama qwen2.5:7b │
│ Context + Question → Answer │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 6. Caching │
│ Save to cache for 1 hour │
│ Next same question < 50ms │
└────────────────┬────────────────────────┘
┌─────────────────────────────────────────┐
│ 7. Response to User │
│ "Product can be returned within..." │
└─────────────────────────────────────────┘
```
### Technology Stack
| Component | Technology | Purpose |
|-----------|------------|---------|
| **LLM Model** | Ollama qwen2.5:7b | Text generation, dialogue |
| **Embedding Model** | mxbai-embed-large | Text vectorization |
| **Vector DB** | FAISS | Fast semantic search |
| **Main DB** | PostgreSQL | Knowledge base storage |
| **Cache** | Node.js Map + TTL | Accelerate repeated requests |
| **Queue** | AI Queue | Priority task processing |
---
## Complete AI Assistant Capabilities
### 1. 📞 Customer Service and Support
**Automatic responses to common questions:**
- Instant 24/7 responses via Telegram, Email, Web chat
- Automatic problem diagnosis by order number
- Ticket creation in CRM with prioritization
- Knowledge base with vector search
- Multilingual customer support from different countries
- Real-time customer sentiment analysis
- Escalation of complex questions to live operators
- Personalized recommendations based on purchase history
**Messenger Integration:**
- Telegram bot with AI assistant
- Email support with automatic analysis
- Web chat widget on website
- SMS notifications and alerts
- Web feedback forms
### 2. 📊 Analytics and Business Intelligence
**Automatic Data Analysis:**
- Big data analysis and trend identification
- Sales and demand forecasting for products/services
- Customer segmentation by behavior and preferences
- Marketing campaign effectiveness analysis
- Financial indicator anomaly detection
- Interactive dashboards with key metrics
- Competitive analysis
- Benchmarking and industry comparisons
### 3. 💰 Financial Planning and Accounting
**Financial Process Automation:**
- Automatic accounting and report generation
- Cash flow forecasting and budget planning
- Product and service profitability analysis
- Financial risk identification and mitigation recommendations
- Automatic invoice creation and payment tracking
- Tax planning optimization
- KPI and financial indicator monitoring
- Consolidated reporting across all departments
### 4. 🎯 Marketing and Sales
**Content Marketing:**
- Content generation for social media, blogs, email campaigns
- Marketing message personalization for each customer
- A/B testing of various advertising options
- Customer acquisition channel effectiveness analysis
- Automatic email campaign creation
- SEO content and meta tag optimization
- Online reputation management
**Sales:**
- Automatic commercial proposal creation
- Customer base analysis and opportunity identification
- Personalized product recommendations
- Automatic sales funnel tracking
- Cold call script generation
### 5. 👥 HR and Personnel Management
**Recruitment and Personnel Management:**
- Automatic resume screening and candidate pre-selection
- Interviewing with chatbot
- Employee performance analysis
- Training and development planning
- Automatic job description creation
- Employee satisfaction analysis
- Vacation and shift planning
- Team mood monitoring
**Employee Training:**
- Personalized training programs for employees
- Interactive course and material creation
- Adaptive learning for individual needs
- Knowledge and skill assessment
- Career development recommendations
- Knowledge base and FAQ creation
### 6. 📋 Project and Task Management
**Project Work Automation:**
- Automatic project planning and resource allocation
- Progress tracking and delay identification
- Workflow optimization and bottleneck elimination
- Automatic project reporting
- Risk management and reserve planning
- Distributed team coordination
- Management methodology effectiveness analysis
### 7. 🔍 Research and Development
**Analytics and Research:**
- Market and competitive environment analysis
- New technology and trend research
- New product/service idea generation
- Patent and intellectual property analysis
- Technical documentation and specifications
- Customer feedback analysis for product improvement
### 8. 🛡️ Security and Compliance
**Security Monitoring:**
- IT system security monitoring
- Suspicious activity and threat detection
- Automatic security policy updates
- Regulatory compliance analysis
- Access and user rights management
- Log auditing and incident investigation
### 9. 📈 Operational Efficiency
**Process Optimization:**
- Supply chain and logistics optimization
- Production planning and inventory management
- Routine process automation
- Product and service quality analysis
- Asset management and maintenance
- Energy and resource consumption optimization
### 10. 🎓 Training and Development
**Corporate Training:**
- Personalized training programs for employees
- Interactive course and material creation
- Adaptive learning for individual needs
- Knowledge and skill assessment
- Career development recommendations
- Knowledge base and FAQ creation
### 11. 🌐 International Activities
**Global Capabilities:**
- Automatic document and communication translation
- Target market cultural analysis
- Content adaptation for local requirements
- International legislation change monitoring
- Currency risk management
- Coordination with foreign partners
### 12. 🔮 Strategic Planning
**Long-term Planning:**
- Macroeconomic trend analysis and business impact
- Scenario planning for various situations
- Merger and acquisition opportunity analysis
- Investment project evaluation
- New market entry planning
- Long-term development strategy development
### 13. 📱 Mobile and Digital Solutions
**Digital Transformation:**
- Mobile app development with AI features
- Chatbot creation for various platforms
- Voice assistants for business processes
- IoT device integration
- Social media automation
- Virtual assistant creation
### 14. 🏭 Industry Solutions
**Specialized Solutions:**
- **Healthcare**: diagnosis, treatment planning, patient management
- **Finance**: credit scoring, risk management, trading algorithms
- **Retail**: personalization, inventory management, pricing
- **Manufacturing**: quality control, predictive maintenance, optimization
- **Real Estate**: valuation, market analysis, property management
- **Education**: adaptive learning, knowledge assessment, planning
### 15. 🔄 Integration and Automation
**System Integration:**
- API integrations with external systems
- Workflow automation (RPA)
- Data synchronization between various platforms
- Unified ecosystem creation for all business processes
- Data and system migration
- Integrated solution performance monitoring
---
## Economic Impact
### Comparison with Cloud Solutions
| Characteristic | DLE AI (Local) | ChatGPT API | Claude API |
|----------------|----------------|-------------|------------|
| **Cost** | $0 | ~$0.02/request | ~$0.03/request |
| **Privacy** | ✅ 100% | ❌ Data in OpenAI | ❌ Data in Anthropic |
| **Speed (cache)** | 50ms | 500-2000ms | 500-2000ms |
| **Offline Work** | ✅ Yes | ❌ No | ❌ No |
| **Business Customization** | ✅ Full | ⚠️ Limited | ⚠️ Limited |
| **API Limits** | ❌ None | ✅ Yes | ✅ Yes |
### Savings with Cloud API Usage
**At 10,000 requests/month:**
- ChatGPT API: $200/month = **$2,400/year**
- Claude API: $300/month = **$3,600/year**
- DLE AI: **$0/year** ✅
**At 50,000 requests/month:**
- ChatGPT API: $1,000/month = **$12,000/year**
- Claude API: $1,500/month = **$18,000/year**
- DLE AI: **$0/year** ✅
**At 100,000 requests/month:**
- ChatGPT API: $2,000/month = **$24,000/year**
- Claude API: $3,000/month = **$36,000/year**
- DLE AI: **$0/year** ✅
### Total Savings Across All Areas
| Area | Annual Savings | ROI |
|------|----------------|-----|
| **Customer Service** | $57,600 | 5,760% |
| **Supplier Work + AI Purchaser** | $64,800 | 6,480% |
| **Partner Work** | $43,200 | 4,320% |
| **Employee Training** | $30,000 | 3,000% |
| **Personnel Management** | $57,600 | 5,760% |
| **Reporting and Analysis** | $144,000 | 14,400% |
| **Content Marketing** | $86,400 | 8,640% |
| **API Token Savings** | $24,000-36,000 | 2,400-3,600% |
| **TOTAL:** | **$507,600-519,600** | **50,760-51,960%** |
**DLE Implementation Cost**: $1,000 (one-time, Standard Support)
**ROI**: 50,760-51,960% or **507-519x return on investment**
### Additional Benefits
**Immeasurable Advantages:**
- 📈 Improved work quality
- 😊 Customer satisfaction +19%
- 👥 Employee retention +15%
- 🚀 Decision speed +300%
- 💡 More time for strategy
- 🎯 Less routine, more creativity
---
## Setup and Integration
**What You Need to Launch:**
- ✅ Install DLE (see [Installation Instructions](./setup-instruction.md))
- ✅ Run Ollama and install models
- ✅ Create knowledge base (FAQ, suppliers, HR)
- ✅ Configure AI assistant for your business
- ✅ Integrate with Telegram/Email (optional)
**Setup Time:**
- 🚀 **Quick Start**: 20-30 minutes (basic FAQ)
- ⚙️ **Full Setup**: 1-2 hours (all capabilities)
**Result:**
- 🤖 Working AI assistant 24/7
- 📚 Knowledge base for customer responses
- 🔍 Vector search on your data
- 💰 Savings up to $519,600/year
### Next Steps
1. 📖 [Install DLE](./setup-instruction.md)
2. 🤖 [Configure AI Assistant](./setup-ai-assistant.md)
3. 📚 Upload knowledge base
4. 🚀 Start saving time and money!
---
## Support
**Need Help with AI Setup?**
📧 **Email**: info@hb3-accelerator.com
💬 **Chat**: https://hb3-accelerator.com
📚 **Documentation**: [FAQ](./FAQ.md)
🎓 **Training**: Online sessions for token holders
---
**© 2024-2025 Tarabanov Alexander Viktorovich. All rights reserved.**
**Last Updated**: October 2025

View File

@@ -0,0 +1,333 @@
# Digital Legal Entity (DLE) - Web Application for Business Management
> **Full Control. Zero Subscription Fee. AI Saves $507,600-519,600/year.**
---
## 📋 Table of Contents
1. [Who This Application Is For](#who-this-application-is-for)
2. [Key Benefits](#key-benefits)
3. [Main Features](#main-features)
4. [Economic Impact](#economic-impact)
5. [Technical Details](#technical-details)
6. [Purchase Terms](#purchase-terms)
7. [Additional Documentation](#additional-documentation)
---
## 🎯 Who This Application Is For
DLE is created for **all types of organizations** that need transparent collective management:
- **Commercial organizations** (LLC, JSC, sole proprietors, holdings)
- **Non-profit organizations** (NPOs, foundations, associations)
- **Government structures** (municipalities, agencies)
- **Investment funds** and **venture companies**
- **Startups** and **small businesses**
- **Cooperatives** and **associations**
---
## 💎 Key Benefits
### Why DLE, Not SaaS?
| Parameter | DLE | Regular SaaS |
|----------|-----|--------------|
| **💰 Cost** | $1,000 one-time | $200-500/month |
| **📊 Data Ownership** | 100% yours | With provider |
| **🔧 Customization** | Full | Limited |
| **🌍 Legal Compliance** | For your region | Depends on provider |
| **🛡️ Regulatory Compliance** | GDPR, CCPA, 152-FZ | Limited |
| **🤖 AI Without Limits** | Free | $200+/month |
| **🔗 Blockchain** | Built-in | None or extra fee |
| **⚡ Updates** | Free 5 years (for token holders) | Depends on plan |
### 🎁 What You Get
**Perpetual License** - pay once, use forever
**Free Updates** - all improvements without extra payment
**Full Source Code** - complete transparency
**AI on Your Server** - 100% confidentiality
**Blockchain Protection** - assets cannot be stolen
**Asset Tokenization** - 99% savings on transactions
**Voting Rights** - influence on product development
**Ready Regulatory Package** - privacy policy, personal data consent, user agreement, cookie policy
**70% Refund Guarantee** - within 5 years if no updates
---
## 🚀 Main Features
### 1. CRM and Contact Management
**Full Customer Management System**:
- Centralized contact database with interaction history
- Grouping by tags and categories
- Task and reminder system
- Import from CSV, Excel, external CRMs
- Export in various formats
- Document and template builder
### 2. AI Assistant with Vector Search
**Local AI on Your Server**:
- Ollama + Vector Search (RAG)
- qwen2.5:7b model (or any other)
- 100% confidentiality (data doesn't leave)
- Zero API token costs
**Key Capabilities**:
- **📞 Customer Service** - 24/7 responses, customer sentiment analysis
- **📊 Analytics and Business Intelligence** - data analysis, sales forecasting
- **💰 Financial Planning** - automated accounting, profitability analysis
- **🎯 Marketing and Sales** - content generation, message personalization
- **👥 HR and Personnel Management** - resume screening, training planning
- **📋 Project Management** - automatic planning, progress tracking
- **🔍 Research and Development** - market analysis, idea generation
- **🛡️ Security and Compliance** - security monitoring, compliance analysis
- **📈 Operational Efficiency** - process optimization, automation
- **🎓 Training and Development** - personalized training programs
- **🌐 International Activity** - automatic translation, content adaptation
- **🔮 Strategic Planning** - trend analysis, scenario planning
- **📱 Mobile Solutions** - app development, chatbot creation
- **🏭 Industry Solutions** - specialized solutions for different industries
- **🔄 Integration and Automation** - API integrations, process automation
**Economic Impact**: $507,600-519,600/year with ROI 50,760-51,960%
> 💡 **Detailed Information**: See [AI Assistant - Full Description](./ai-assistant.md) - detailed description of all capabilities, use cases, architecture, and savings calculations.
### 3. Omnichannel Communications
**Unified Interface for All Channels**:
- 💬 Telegram bot, 📧 Email, 🌐 Web chat, 📱 SMS, 📋 Web forms
- One context for customer across all channels
- AI auto-responses trained on your data
- Analytics by channel and response time
### 4. Blockchain Management and Tokenization
**Smart Contracts for Business**:
- Tokenization of any assets (real estate, IP, shares)
- Management through token holder voting
- Multi-chain support (7+ networks: Ethereum, Polygon, BSC, Arbitrum, Optimism, Avalanche, Base)
- Transparency of all operations on blockchain
> 💡 **Detailed Information**: See [Blockchain for Business](./blockchain-for-business.md) - practical use cases and [Blockchain Technical Documentation](./blockchain-integration-technical.md) - for developers.
### 5. Groups and Team Spaces
- Customizable spaces for projects
- Detailed permission system (20+ types)
- Roles: Editor, ReadOnly, User
- Integration with CRM and communications
### 6. Internal Tools
- Electronic tables (Excel-like)
- Analytics and reporting system
- Metrics monitoring
- WebSSH for server management
### 7. Security and Protection
**Multi-Level DLE Protection**:
- **Network Security** - TLS 1.3, HTTPS, DDoS protection
- **Authentication** - SIWE (wallet login), sessions in DB
- **Authorization** - detailed permissions (20+ types), token gating
- **Data Protection** - AES-256 encryption, SQL injection protection
- **Blockchain Protection** - tokens cannot be stolen without voting
- **Monitoring** - logging, alerts, audit trail
**Regulatory Compliance**:
- **GDPR** - compliance with European personal data protection requirements
- **CCPA** - compliance with California requirements
- **Russian Legislation** - compliance with 152-FZ "On Personal Data"
- **Local Storage** - all data remains on your server
- **Transparency** - full control over personal data processing
> 💡 **Detailed Information**: See [DLE Security](./security.md) - detailed description of all protection levels, attack scenarios, security recommendations, and regulatory compliance.
## 💰 Economic Impact
### Comparison with SaaS Over 5 Years
**Typical SaaS Stack**:
```
CRM (HubSpot): $200/mo × 60 mo = $12,000
Chatbot (Intercom): $150/mo × 60 mo = $9,000
Email (SendGrid): $100/mo × 60 mo = $6,000
AI (ChatGPT API): $200/mo × 60 mo = $12,000
─────────────────────────────
TOTAL: $39,000
```
**DLE**:
```
License (one-time): $1,000
Updates (5 years): $0
AI without limits: $0
─────────────────────────────
TOTAL: $1,000
SAVINGS: $38,000
```
### ROI from AI Assistant
**Comparison with Cloud Solutions**:
| Characteristic | DLE AI (Local) | ChatGPT API | Claude API |
|----------------|-------------------|-------------|------------|
| **Cost** | $0 | ~$0.02/request | ~$0.03/request |
| **Confidentiality** | ✅ 100% | ❌ Data in OpenAI | ❌ Data in Anthropic |
| **Speed (cache)** | 50ms | 500-2000ms | 500-2000ms |
| **Offline Work** | ✅ Yes | ❌ No | ❌ No |
| **Business Customization** | ✅ Full | ⚠️ Limited | ⚠️ Limited |
| **API Limits** | ❌ None | ✅ Yes | ✅ Yes |
**Total Savings Across All Areas**:
- Customer Service: $57,600
- Supplier Relations + AI Purchaser: $64,800
- Partner Relations: $43,200
- Staff Training: $30,000
- Personnel Management: $57,600
- Reporting and Analysis: $144,000
- Content Marketing: $86,400
- API Token Savings: $24,000-36,000
- **TOTAL**: $507,600-519,600/year
**Investment**: $1,000
**ROI**: 50,760-51,960% or 507-519x return ✅
### Savings on Asset Tokenization
**Traditional Real Estate Transaction ($1M)**:
- Realtor Commission: 3-5% = $30,000-50,000
- Legal Services: $5,000-10,000
- Title Registration: $2,000-5,000
- Time: 2-6 months
- **Total**: $37,000-65,000
**Tokenized Transaction via DLE**:
- Gas Fees: $50-200
- Smart Contract (one-time): $500
- Time: 5-10 minutes
- **Total**: $550-700
**Savings**: 99% costs and 99% time ✅
---
## 🔧 Technical Details
### Architecture
**Modern Technology Stack**:
- **Frontend**: Vue.js 3 + Vite + Element Plus
- **Backend**: Node.js + Express
- **Database**: PostgreSQL + pgvector
- **AI**: Ollama (qwen2.5:7b) + FAISS Vector Search
- **Blockchain**: Ethers.js v6 + Hardhat
- **Containerization**: Docker Compose
### Design Principles
**Microservices Architecture** - easy to scale
**Full Control** - you own the application and data
**Modularity** - add new features through modules
**Security** - multi-level protection (TLS, AES-256, CSRF)
**API-first** - REST + WebSocket for integrations
### Deployment
**Flexible Installation Options**:
- **On Your Server** - full control
- **In Cloud** - AWS, Google Cloud, Azure
- **On Local Infrastructure** - regulatory compliance
- **Docker Compose** - deployment with one command
**Minimum Requirements**:
- **CPU**: 4 cores
- **RAM**: 12 GB (4 GB application + 6 GB AI + 2 GB Vector Search)
- **Storage**: 100 GB SSD
- **OS**: Ubuntu 20.04+, Debian 11+, CentOS 8+, any Linux with Docker
> 💡 **Detailed Information**: See [Installation Instructions](./setup-instruction.md) - step-by-step setup and [AI Assistant Setup](./setup-ai-assistant.md) - specialized installation.
---
## 💳 Purchase Terms
> 💡 **Detailed Information**: See [Service Terms](./service-terms.md) - detailed description of licensing model, pricing, guarantees, and purchase process.
### Quick Overview
**Perpetual License**:
- 💰 **Pay Once** - use forever
- 📄 **Full Source Code** with documentation
- 🔄 **Free Updates** 5 years for license token holders (see [legal-en/service-terms.md](../legal-en/service-terms.md))
- 🗳️ **Voting Rights** for product development
**Pricing**:
| Package | Price | Votes | Support |
|-------|------|--------|-----------|
| **Standard Support** | $1,000 USDT | 1 vote | 24/7 chat |
| **Priority Support** | $10,000 USDT | 10 votes | 24/7 chat |
**What's Included**:
✅ Perpetual license for use
✅ Source code with full documentation
✅ Free updates 5 years for token holders
✅ Technical support
✅ Governance tokens on blockchain
✅ Ready regulatory package
✅ 70% refund guarantee within 5 years
**How to Purchase**:
1. Contact us: info@hb3-accelerator.com
2. Receive payment details (USDT)
3. Pay for license
4. Receive code access and DLE tokens
---
## 📚 Additional Documentation
### 🎯 Quick Start
- 📋 **[FAQ](./FAQ.md)** - answers to 50+ questions (11 sections)
- 🔧 **[Installation](./setup-instruction.md)** - step-by-step setup in 15 minutes
- 🤖 **[AI Setup](./setup-ai-assistant.md)** - launch AI assistant
### 💼 Business and Economics
- 💰 **[Blockchain for Business](./blockchain-for-business.md)** - asset tokenization, 99% savings on transactions
- 🤖 **[AI Assistant](./ai-assistant.md)** - $507,600-519,600/year savings, "AI+Human" philosophy
- 📊 **[Tables System](./tables-system.md)** - data and document management
### 🔧 Technical Documentation
- 🔗 **[Blockchain Integration](./blockchain-integration-technical.md)** - smart contracts, API, code examples
- 🛡️ **[Security](./security.md)** - multi-level protection, GDPR/CCPA/152-FZ compliance
- ⚖️ **[Service Terms](./service-terms.md)** - licensing, support, guarantees
### 📖 General Information
- 📖 **[Main README](../README.md)** - complete list of all documents
- ⚖️ **[Legal Documentation](../legal-en/README.md)** - legal information
### 📞 Support and Contacts
**Main Contacts**:
- 📧 **Email**: info@hb3-accelerator.com
- 🌐 **Website**: https://hb3-accelerator.com
- 💬 **Support Chat**: https://hb3-accelerator.com/
- 🐙 **GitHub**: https://github.com/VC-HB3-Accelerator
---
**© 2024-2025 Tarabanov Alexander Viktorovich. All rights reserved.**
**Digital Legal Entity (DLE)** - revolution in business management through blockchain and AI.
**Document Version**: 2.0.0
**Last Update**: October 2025

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1309
docs-en/security.md Normal file

File diff suppressed because it is too large Load Diff

43
docs-en/service-terms.md Normal file
View File

@@ -0,0 +1,43 @@
<!--
Copyright (c) 2024-2025 Tarabanov Alexander Viktorovich
All rights reserved.
This software is proprietary and confidential.
Unauthorized copying, modification, or distribution is prohibited.
For licensing inquiries: info@hb3-accelerator.com
Website: https://hb3-accelerator.com
GitHub: https://github.com/VC-HB3-Accelerator
-->
# Digital Legal Entity Purchase and Service Terms — Brief Summary
> Important: This is a brief summary of terms. The canonical and legally binding full text is located here: [legal-en/service-terms.md](../legal-en/service-terms.md).
Key Points:
- License Type: Perpetual, rights determined by number of tokens (1 or 10).
- Updates and Basic Maintenance: Free for 5 years from on-chain token transfer date.
- Development Voting: 1 token = 1 vote, decisions by majority ≥51%.
- 70% Refund possible if program conditions are met (see original).
- Support, releases, knowledge base — through application `https://hb3-accelerator.com/`.
- Full list of limitations/liability — in original.
## 📚 Additional Documentation
### Explore DLE Capabilities
- 🤖 **[AI Assistant](./ai-assistant.md)** - second pilot for team, frees time for strategy
- 💼 **[Blockchain for Business](./blockchain-for-business.md)** - asset tokenization and business solutions
- 🛡️ **[DLE Security](./security.md)** - multi-level protection for your business
### Technical Documentation
- 🔗 **[Blockchain Technical Documentation](./blockchain-integration-technical.md)** - for developers
- 🔧 **[Installation Instructions](./setup-instruction.md)** - step-by-step setup
- 📝 **[Application Description](./application-description.md)** - functionality overview
- 📋 **[FAQ](./FAQ.md)** - frequently asked questions
### Contacts and Support
- 📧 **Email**: info@hb3-accelerator.com
- 🌐 **Website**: https://hb3-accelerator.com
- 💬 **Support Chat**: https://hb3-accelerator.com/
- 🐙 **GitHub**: https://github.com/VC-HB3-Accelerator

View File

@@ -0,0 +1,929 @@
# AI Assistant Setup Guide with Vector Search
## 🤖 Complete Guide to Launching an Intelligent Assistant
This document describes the step-by-step process of setting up an AI assistant for solving business tasks through spreadsheets and vector search.
---
## 📚 What You'll Set Up
After completing the instructions, you will have:
✅ Working AI assistant with local model (Ollama)
✅ Knowledge base for customer responses (FAQ)
✅ Supplier work automation
✅ Employee training system
✅ Vector search on your data
✅ Significant time and resource savings
> 💡 **Economic Impact**: See [AI Assistant](./ai-assistant.md) - detailed description of all capabilities and savings calculations.
---
## ⏱️ Setup Time
- **Quick Setup**: 20-30 minutes (basic FAQ)
- **Full Setup**: 1-2 hours (all capabilities)
---
## Step 1: Installing and Running Ollama
### 1.1 Checking Ollama Status
1. Go to **Settings****Integrations** tab
2. Find the **"Ollama"** block and click **"Details"**
3. Check connection status:
-**"Ollama is running"** — ready, proceed to step 1.3
-**"Ollama API not responding"** — proceed to step 1.2
### 1.2 Starting Ollama (if not running)
If Ollama is not running, execute in terminal:
```bash
# For Docker (recommended)
docker-compose up -d ollama
# Or locally
ollama serve
```
Refresh the page and check status again.
### 1.3 Installing AI Model
1. In the **Ollama** section, click **"Install Model"**
2. Select model:
- **qwen2.5:7b** (recommended) — for Russian, 4.7 GB
- **llama2:7b** — for English, 3.8 GB
- **mistral:7b** — universal, 4.1 GB
3. Click **"Install"**
4. Wait for download to complete (5-10 minutes depending on internet speed)
> 💡 **Tip**: Model downloads once and is stored locally
### 1.4 Installing Embedding Model
1. In the same section, find **"Install Embedding Model"**
2. Select model:
- **mxbai-embed-large:latest** (recommended) — 670 MB
- **nomic-embed-text:latest** — alternative, 274 MB
3. Click **"Install"**
> ⚠️ **Important**: Embedding model is needed for vector search (RAG)
---
## Step 2: Creating Knowledge Base (Spreadsheets)
### 2.1 Creating FAQ Table
1. Go to **Tables** (in main menu)
2. Click **"+ Create Table"**
3. Fill in:
- **Name**: `FAQ - Frequently Asked Questions`
- **Description**: `Knowledge base for AI assistant customer service`
4. Click **"Create"**
### 2.2 Configuring Table Columns
Add the following columns:
#### Column 1: Question (required for RAG)
1. Click **"+ Add Column"**
2. Fill in:
- **Name**: `Question`
- **Type**: `Text`
- **Purpose**: Select `Question for AI`
3. Click **"Save"**
> ⚠️ **Critical**: Must select purpose "Question for AI" — this field will be indexed for vector search
#### Column 2: Answer (required for RAG)
1. Click **"+ Add Column"**
2. Fill in:
- **Name**: `Answer`
- **Type**: `Text`
- **Purpose**: Select `AI Answer`
3. Click **"Save"**
#### Column 3: Product (optional, for filtering)
1. Click **"+ Add Column"**
2. Fill in:
- **Name**: `Product`
- **Type**: `Multiple Choice`
- **Options**: `Basic`, `Premium`, `Corporate`
- **Purpose**: Select `Product Filter`
3. Click **"Save"**
#### Column 4: Tags (optional, for categorization)
1. Click **"+ Add Column"**
2. Fill in:
- **Name**: `Tags`
- **Type**: `Multiple Choice`
- **Options**: `Payment`, `Delivery`, `Return`, `Warranty`, `Support`
- **Purpose**: Select `User Tags`
3. Click **"Save"**
#### Column 5: Priority (optional)
1. Click **"+ Add Column"**
2. Fill in:
- **Name**: `Priority`
- **Type**: `Number`
- **Purpose**: Select `Priority`
3. Click **"Save"**
> 💡 **Tip**: Questions with higher priority will be shown to AI first
### 2.3 Filling Knowledge Base
Add typical questions and answers:
**Example 1: Payment**
| Question | Answer | Product | Tags | Priority |
|----------|--------|---------|------|----------|
| How to pay for order? | We accept payment by bank card, PayPal, or bank transfer. Choose convenient method when placing order. | All | Payment | 10 |
| Can I pay in installments? | Yes, for orders from 50,000₽ installment plan available for 3, 6 or 12 months without overpayment. | Premium, Corporate | Payment | 8 |
**Example 2: Delivery**
| Question | Answer | Product | Tags | Priority |
|----------|--------|---------|------|----------|
| How long does delivery take? | Standard delivery: 3-5 business days in Russia. Express delivery: 1-2 days in major cities. | All | Delivery | 10 |
| How much does delivery cost? | Free delivery for orders from 5,000₽. For orders less than 5,000₽ delivery cost is 300₽. | All | Delivery | 9 |
**Example 3: Return**
| Question | Answer | Product | Tags | Priority |
|----------|--------|---------|------|----------|
| How to return product? | Return possible within 14 days from receipt. Product must be in original packaging, with preserved appearance. Contact support to process return. | All | Return | 10 |
| When will money be returned? | Refund processed within 5-10 business days after product received at our warehouse. | All | Return | 8 |
> 💡 **Recommendation**: Add minimum 20-30 questions for quality AI work. More questions = more accurate answers!
### 2.4 Activating Table as AI Source
1. In top right corner of table, find **⚙️ Table Settings**
2. Enable toggle **"Use as AI Source"** ✅
3. Click **"Save"**
> ✅ **Done!** Table is now indexed for vector search
---
## Step 3: Configuring AI Provider (Ollama)
### 3.1 Opening Ollama Settings
1. Go to **Settings****Integrations**
2. Find **"Ollama"** block and click **"Details"**
### 3.2 Checking Base URL
1. Check **Base URL** field:
- For Docker: `http://ollama:11434`
- For local: `http://localhost:11434`
2. If URL is incorrect, fix and click **"Save"**
### 3.3 Selecting Model
1. In **"Model (LLM)"** field, select installed model:
- `qwen2.5:7b` (recommended for Russian)
2. In **"Embeddings Model"** field, select:
- `mxbai-embed-large:latest`
3. Click **"Save"**
---
## Step 4: Configuring AI Assistant
### 4.1 Opening Assistant Settings
1. Go to **Settings****Integrations**
2. Find **"AI Assistant"** block and click **"Details"**
### 4.2 Configuring System Prompt
In **"System Prompt"** field, enter instructions for AI:
**Basic Prompt (to start)**:
```
You are a professional customer support assistant.
Rules:
1. Answer politely and professionally
2. Use information from knowledge base
3. If information not available — suggest contacting operator
4. Answer briefly and to the point
5. Always end with question "How else can I help?"
```
**Advanced Prompt (with personalization)**:
```
You are a professional customer support assistant for "Your Company Name".
About company:
- We are engaged in [brief business description]
- Our values: quality, reliability, customer focus
Communication style:
- Friendly but professional
- Address customer as "You"
- Use emojis moderately (1-2 per message)
Response rules:
1. MANDATORY: Answer ONLY in Russian. All questions and answers must be in Russian
2. First search answer in knowledge base (RAG)
3. If found — answer based on found information
4. If not found — honestly say and suggest operator help
5. Don't make up information about prices, terms, conditions
6. For complex questions suggest contacting manager
Always end with: "How else can I help? 😊"
```
### 4.3 Selecting Models
1. **LLM Model**: Select `qwen2.5:7b (ollama)`
2. **Embedding Model**: Select `mxbai-embed-large:latest (ollama)`
> 💡 **Tip**: Models automatically pulled from Ollama settings
> 📊 **Context Window Size**:
> - **Qwen2.5:7b**: Base context = **32,768 tokens** (~24,000 Russian words)
> - Total data sent to model:
> - System prompt: ~500-2000 characters (~300-1200 tokens)
> - Conversation history: up to 20 messages (~100-500 tokens per message = ~2000-10000 tokens)
> - RAG context: ~500-2000 tokens (from found data)
> - Current question: ~50-200 tokens
> - **Total**: approximately 3,000-15,000 tokens (sufficient reserve)
> - If larger context needed → use Qwen3 with YaRN (up to 131K tokens)
### 4.4 Selecting RAG Table
1. In **"Selected RAG Tables"** field, select created table:
- `FAQ - Frequently Asked Questions`
2. Click **"Save"**
### 4.5 Configuring AI Rules
Create rule set for managing AI behavior:
1. Click **"Create"** button next to "Rule Set" field
2. In modal window, fill in:
**Name**: `Hybrid Mode (RAG + Generation)`
**Description**: `AI first searches knowledge base, if not found — generates answer`
**Rules (JSON)**:
```json
{
"checkUserTags": true,
"searchRagFirst": true,
"generateIfNoRag": true,
"temperature": 0.7,
"maxTokens": 500
}
```
3. Click **"Save"**
4. Select created rule in dropdown
> 💡 **What parameters mean**:
> - `checkUserTags: true` — consider user tags when searching
> - `searchRagFirst: true` — first search knowledge base
> - `generateIfNoRag: true` — generate answer if nothing found
> - `temperature: 0.7` — balance between accuracy and creativity (0.0-1.0)
> - `maxTokens: 500` — maximum answer length
### 4.6 RAG Search Settings
Expand **"🔍 RAG Search Settings"** section:
**Basic Settings:**
1. **Search Method**: Select `Hybrid Search` (recommended)
2. **Maximum Results**: `5`
3. **Relevance Threshold**: `0.1` (from 0.01 to 1.0)
**Keyword Extraction:**
1.**Enable Keyword Extraction**
2. **Minimum Word Length**: `3`
3. **Maximum Keywords**: `10`
4.**Remove Stop Words**
**Search Weights (for hybrid):**
1. **Semantic Search**: `70%` (accuracy)
2. **Keyword Search**: `30%` (speed)
**Additional Settings:**
1.**Fuzzy Search** (for typos)
2.**Word Stemming** (finds different word forms)
3.**Synonym Search** (currently disabled)
### 4.7 Saving Settings
Click **"Save"** button at bottom of form.
---
## Step 5: Testing AI Assistant
### 5.1 Using Built-in Tester
1. On AI assistant settings page, scroll down to **"🔍 System Monitoring"** block
2. In **"🧠 RAG Functionality Test"** section:
- Ensure table `FAQ - Frequently Asked Questions` is selected
- Enter test question: `How to pay for order?`
- Click **"Test RAG"**
3. Observe process:
- 🔍 Searching answer in knowledge base... (vector search)
- 🤖 Generating answer with AI... (LLM generation)
- ✅ Done!
4. Check result:
- Answer from your table should be displayed
- Score (similarity score): closer to 0 is better
> 💡 **Good Score**: from -300 to 0 (answer found)
> ⚠️ **Bad Score**: greater than 300 (answer not found, AI will make up its own)
### 5.2 Testing via Web Chat
1. Go to application main page
2. Find **"💬 Chat with AI"** widget (usually bottom right)
3. Click widget to open chat
4. Enter question: `How much does delivery cost?`
5. Check AI response
**Expected Result:**
```
🤖 AI Assistant:
Free delivery for orders from 5,000₽.
For orders less than 5,000₽ delivery cost is 300₽.
How else can I help? 😊
```
### 5.3 Testing Different Scenarios
Try asking various questions:
**✅ Question from knowledge base:**
```
User: "How to return product?"
AI: [Answer from FAQ table]
```
**⚠️ Question NOT from knowledge base:**
```
User: "What's the weather today?"
AI: "Sorry, I specialize in questions about our company and products.
For weather questions, please contact specialized services.
How else can I help?"
```
**🎯 Question with typo:**
```
User: "How to pay for order?" (typo)
AI: [Will find correct answer thanks to fuzzy search]
```
---
## Step 6: Advanced Capabilities (Optional)
### 6.1 Creating Supplier Table
#### "Supplier Database" Table Structure
1. Create new table: `Supplier Database`
2. Add columns:
| Column | Type | Description |
|--------|------|-------------|
| Company Name | Text | Supplier name |
| Product Category | Multiple Choice | Electronics, Furniture, Clothing, etc. |
| Contact Person | Text | Manager name |
| Email | Text | Email address |
| Phone | Text | Contact phone |
| Prices | Text | Price list (brief description) |
| Payment Terms | Text | Deferred payment, prepayment, etc. |
| Minimum Order | Number | Minimum order amount |
| Delivery Time | Text | Delivery terms |
| Rating | Number | Rating from 1 to 10 |
| Notes | Text | Additional information |
3. Activate as AI source
4. Fill with your supplier data
#### Prompt for AI Purchaser
Add to system prompt:
```
ADDITIONALLY - Working with Suppliers:
When user asks about suppliers:
1. Search in "Supplier Database" base
2. Filter by product category
3. Sort by rating and terms
4. Provide TOP-3 recommendations
Response format:
🏆 TOP-3 suppliers for "[category]":
1. [Name] ⭐ [Rating]/10
📧 [Email] | 📞 [Phone]
💰 Terms: [Payment Terms]
🚚 Delivery: [Delivery Time]
📦 Minimum: [Minimum Order]₽
2. ...
3. ...
I recommend contacting [First Supplier Name] — best terms.
```
### 6.2 Creating Employee Training Table
#### "Employee Knowledge Base" Table Structure
1. Create new table: `Employee Knowledge Base`
2. Add columns:
| Column | Type | Description |
|--------|------|-------------|
| Question | Text | Employee question (purpose: Question for AI) |
| Answer | Text | Detailed answer (purpose: AI Answer) |
| Category | Multiple Choice | Sales, HR, Finance, IT, Marketing |
| Department | Multiple Choice | Which department it's relevant for |
| Difficulty | Number | From 1 (simple) to 5 (complex) |
| Instructions | Text | Step-by-step instructions (if any) |
| Links | Text | Links to documents/videos |
| Update Date | Date | When information was updated |
3. Example questions:
**"Sales" Category:**
- "How to process customer return?"
- "What discounts can be given to regular customers?"
- "How to work with corporate customers?"
**"HR" Category:**
- "How to apply for vacation?"
- "Where to contact for sick leave?"
- "How does new employee onboarding work?"
**"IT" Category:**
- "How to get access to corporate email?"
- "What to do with VPN problems?"
- "How to create support ticket?"
### 6.3 Creating Table Relationships
#### Example: "Customers" → "Orders" Relationship
1. Create **"Customers"** table:
- Name, Email, Phone, Status (VIP/Regular)
2. Create **"Orders"** table:
- Order Number, Date, Amount
3. In "Orders" table, add column:
- **Name**: `Customer`
- **Type**: `Relation`
- **Related Table**: select `Customers`
- **Display Field**: select `Name`
4. Add another column in "Orders":
- **Name**: `Customer Email`
- **Type**: `Lookup`
- **Relation Through**: select `Customer` column
- **Lookup Field**: select `Email`
**Result**: When selecting customer, their Email is automatically filled!
#### Using AI with Related Tables
AI automatically understands relationships and can answer questions:
```
User: "Show all orders for customer Ivanov"
AI: [Searches Orders table, filters by customer Ivanov]
```
---
## Step 7: Telegram and Email Integration (Optional)
### 7.1 Setting Up Telegram Bot
1. Go to **Settings****Integrations****Telegram**
2. Create bot via [@BotFather](https://t.me/botfather) in Telegram:
- Send `/newbot`
- Choose bot name and username
- Copy **Bot Token**
3. In DLE settings, enter:
- **Bot Token**: paste token from BotFather
- **Bot Username**: your bot username (e.g., `@mycompany_bot`)
4. Click **"Save"**
5. In AI assistant settings, select this Telegram bot in **"Telegram Bot"** field
**Result**: AI will respond to Telegram messages!
### 7.2 Setting Up Email Integration
1. Go to **Settings****Integrations****Email**
2. Fill IMAP settings (for receiving emails):
- **IMAP Host**: `imap.gmail.com` (for Gmail)
- **IMAP Port**: `993`
- **IMAP User**: your email
- **IMAP Password**: app password (not main password!)
3. Fill SMTP settings (for sending emails):
- **SMTP Host**: `smtp.gmail.com`
- **SMTP Port**: `587`
- **SMTP User**: your email
- **SMTP Password**: app password
- **From Email**: email for sending
4. Click **"Test IMAP"** and **"Test SMTP"** to verify
5. Click **"Save"**
6. In AI assistant settings, select this Email in **"Email Contact"** field
> ⚠️ **Important for Gmail**: Create "App Password" in Google security settings
**Result**: AI will automatically respond to incoming emails!
---
## Step 8: Monitoring and Optimization
### 8.1 Checking Service Status
1. Go to **Settings****Integrations****AI Assistant**
2. Scroll down to **"🔍 System Monitoring"**
3. Click **"🔄 Refresh Status"**
4. Check statuses:
- 🟢 **Backend**: should be "Running"
- 🟢 **Postgres**: should be "Running"
- 🟢 **Ollama**: should show number of models
- 🟢 **Vector Search**: should be "Running"
> ⚠️ If something is red (🔴) — see "Troubleshooting" section below
### 8.2 Analyzing Answer Quality
Regularly check AI answer quality:
1. **Score in RAG Tester**:
- **-300 to 0** ✅ — excellent match
- **0 to 300** ⚠️ — average match
- **>300** ❌ — match not found
2. **If Score is Bad**:
- Add more similar questions to table
- Use different phrasings of same question
- Increase relevance threshold (e.g., to 0.2)
### 8.3 Optimizing RAG Settings
Experiment with settings to improve results:
**For More Accurate Answers:**
```
Search Method: Semantic
Relevance Threshold: 0.05 (lower = stricter)
Weights: Semantic 100% / Keywords 0%
```
**For Faster Answers:**
```
Search Method: Keyword Search
Maximum Results: 3
```
**For Balance (Recommended):**
```
Search Method: Hybrid
Weights: Semantic 70% / Keywords 30%
Relevance Threshold: 0.1
```
---
## ✅ AI Assistant Ready to Work!
### What You Now Have
**Local AI Assistant** without cloud dependency
**FAQ Knowledge Base** for customer responses
**Vector Search** for accurate answers
**Configured Rules** for AI behavior
**Monitoring System** for quality control
### Economic Impact
With proper AI assistant setup, you will get:
**Task Automation** - freeing time for strategy
**Improved Service Quality** - AI works 24/7 without fatigue
**Reduced Operating Costs** - less staff on routine tasks
**Faster Decision Making** - instant access to information
> 💡 **Detailed Information**: See [AI Assistant - Complete Description](./ai-assistant.md#economic-impact) - detailed description of all capabilities, use cases, and savings calculations.
---
## 📚 Next Steps
### Expand AI Capabilities
1. **Add More Tables**:
- Partner knowledge base
- Employee instructions
- Product catalog
- Contact database
2. **Create Rules for Different Scenarios**:
- Strict mode (RAG only) — for finance
- Creative mode (more generation) — for marketing
- Hybrid mode (balance) — for support
3. **Integrate with Other Systems**:
- CRM (customer synchronization)
- Warehouse system (inventory)
- Accounting (invoices and payments)
### Train Your Team
1. Show employees how AI works
2. Explain how to add new questions to base
3. Establish regular knowledge base update process
4. Assign responsible person for AI answer quality
---
## 🆘 Troubleshooting
### Problem: Ollama Not Starting
**Symptoms**: Status "Ollama API not responding"
**Solution**:
```bash
# Check container
docker ps | grep ollama
# Restart
docker-compose restart ollama
# Check logs
docker-compose logs ollama
```
### Problem: AI Answers Inaccurately
**Symptoms**: Answers don't match knowledge base
**Solution**:
1. Check Score in tester (should be < 300)
2. Add more question variations to table
3. Decrease relevance threshold (e.g., to 0.05)
4. Check that columns have correct purposes ("Question for AI", "AI Answer")
### Problem: Vector Search Not Working
**Symptoms**: Vector Search status shows error
**Solution**:
1. Check if Embedding model is installed
2. Rebuild index: on table page click **"🔄 Rebuild Index"**
3. Check that table is activated as AI source
### Problem: AI Answers in Wrong Language
**Symptoms**: Answers in English instead of Russian
**Solution**:
1. Change system prompt, adding at start: `ALWAYS answer in Russian.`
2. Use `qwen2.5:7b` model instead of `llama2:7b`
3. In AI rules, set `"language": "ru"`
### Problem: Slow Responses
**Symptoms**: AI responds longer than 5-10 seconds
**Solution**:
1. Use smaller model (`mistral:7b` instead of `qwen2.5:14b`)
2. Decrease `maxResults` in RAG settings (e.g., to 3)
3. Disable "Synonym Search" in additional settings
4. Use SSD for storing models
---
## 📖 Additional Documentation
### Learn AI Capabilities
- 🤖 **[AI Assistant - Complete Description](./ai-assistant.md)** - all capabilities and use cases
- 📊 **[Spreadsheet System](./tables-system.md)** - technical description of tables (temporary)
- **[AI Configuration](./setup-ai-assistant.md#technical-documentation-for-developers)** - technical setup details
### General Documentation
- 🛡 **[Security](./security.md)** - how AI protects your data
- 💼 **[Blockchain for Business](./blockchain-for-business.md)** - AI integration with blockchain
- 📋 **[FAQ](./FAQ.md)** - frequently asked questions
### Support
- 💬 **Support Chat**: https://hb3-accelerator.com/
- 📧 **Email**: info@hb3-accelerator.com
- 📚 **Knowledge Base**: https://hb3-accelerator.com
---
## 🔧 Technical Documentation (for Developers)
### AI System Architecture
```
┌───────────────────────────────────────────────────────────┐
│ AI Assistant Configuration in DLE │
├───────────────────────────────────────────────────────────┤
│ │
│ 🤖 AI Providers: │
│ ├── OpenAI (GPT-4, GPT-3.5) │
│ ├── Anthropic (Claude) │
│ ├── Google (Gemini) │
│ └── Ollama (local models) │
│ │
│ ⚙️ AI Settings: │
│ ├── System Prompt │
│ ├── LLM Model Selection │
│ ├── Embedding Model Selection │
│ ├── RAG Table Selection │
│ ├── Rules │
│ └── RAG Search Settings │
│ │
│ 📋 Rules: │
│ ├── JSON behavior configuration │
│ ├── Create/edit/delete │
│ └── Link to AI assistant │
│ │
│ 🔗 Integrations: │
│ ├── Email (IMAP + SMTP) │
│ └── Telegram Bot │
│ │
│ 🔍 RAG: │
│ ├── Table selection for search │
│ ├── Search settings (hybrid/semantic) │
│ ├── Relevance threshold │
│ └── Keyword extraction │
│ │
│ 📊 Monitoring: │
│ ├── Service status (Backend, Ollama, Postgres) │
│ ├── RAG functionality test │
│ └── Progress tracking │
│ │
└───────────────────────────────────────────────────────────┘
```
### Database
#### Table: `ai_providers_settings`
```sql
CREATE TABLE IF NOT EXISTS ai_providers_settings (
id SERIAL PRIMARY KEY,
provider_encrypted TEXT, -- Provider: openai, anthropic, google, ollama
api_key_encrypted TEXT, -- API key (encrypted)
base_url_encrypted TEXT, -- Base URL for API
selected_model_encrypted TEXT, -- Selected LLM model
embedding_model_encrypted TEXT, -- Selected Embedding model
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
```
#### Table: `ai_assistant_settings`
```sql
CREATE TABLE IF NOT EXISTS ai_assistant_settings (
id SERIAL PRIMARY KEY,
system_prompt_encrypted TEXT, -- System prompt
selected_rag_tables INTEGER[], -- Array of RAG table IDs
languages TEXT[], -- Array of supported languages
model_encrypted TEXT, -- Selected LLM model
embedding_model_encrypted TEXT, -- Selected Embedding model
rules JSONB, -- Rules (DEPRECATED)
rules_id INTEGER REFERENCES ai_assistant_rules(id), -- Rule reference
telegram_settings_id INTEGER, -- Telegram bot reference
email_settings_id INTEGER, -- Email settings reference
rag_settings JSONB, -- RAG search settings
updated_at TIMESTAMP DEFAULT NOW(),
updated_by INTEGER
);
```
#### Table: `ai_assistant_rules`
```sql
CREATE TABLE IF NOT EXISTS ai_assistant_rules (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL, -- Rule set name
description TEXT, -- Rule description
rules JSONB NOT NULL, -- JSON configuration
rules_encrypted TEXT, -- Encrypted version of rules
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
```
### Backend API
#### AI Provider Settings
- **GET** `/settings/ai-settings/:provider` Get provider settings
- **PUT** `/settings/ai-settings/:provider` Save provider settings
- **DELETE** `/settings/ai-settings/:provider` Delete provider settings
- **GET** `/settings/ai-settings/:provider/models` Get model list
- **POST** `/settings/ai-settings/:provider/verify` Verify API key
#### AI Assistant Settings
- **GET** `/settings/ai-assistant` Get assistant settings
- **PUT** `/settings/ai-assistant` Save assistant settings
#### AI Rules
- **GET** `/settings/ai-assistant-rules` Get all rules
- **GET** `/settings/ai-assistant-rules/:id` Get rule by ID
- **POST** `/settings/ai-assistant-rules` Create rule
- **PUT** `/settings/ai-assistant-rules/:id` Update rule
- **DELETE** `/settings/ai-assistant-rules/:id` Delete rule
#### Ollama (Local Models)
- **GET** `/ollama/status` Check Ollama status
- **GET** `/ollama/models` Get model list
- **POST** `/ollama/install` Install model
- **DELETE** `/ollama/models/:modelName` Delete model
### Frontend Pages
- **`/settings/ai`** Main integrations page
- **`/settings/ai/:provider`** AI provider settings
- **`/settings/ai/assistant`** AI assistant settings
### Message Processing Flow
```
1. User → Message
2. UnifiedMessageProcessor
3. Language Check (Russian only)
4. Deduplication (message hash)
5. Load Settings (aiAssistantSettingsService)
6. Load Rules (aiAssistantRulesService)
7. RAG Search (ragService)
├── Semantic Search (vector search)
├── Keyword Search
└── Hybrid Search
8. Generate Answer (generateLLMResponse)
├── System Prompt
├── Conversation History
├── RAG Context
└── Rules
9. Answer → User
```
### Security
- **Encryption**: All sensitive fields encrypted with AES-256
- **Access Rights**: Only administrators can change settings
- **Validation**: All input data and API keys validated
---
**© 2024-2025 Tarabanov Alexander Viktorovich. All rights reserved.**
**Document Version**: 1.0.0
**Creation Date**: October 25, 2025

View File

@@ -0,0 +1,196 @@
<!--
Copyright (c) 2024-2025 Tarabanov Alexander Viktorovich
All rights reserved.
This software is proprietary and confidential.
Unauthorized copying, modification, or distribution is prohibited.
For licensing inquiries: info@hb3-accelerator.com
Website: https://hb3-accelerator.com
GitHub: https://github.com/VC-HB3-Accelerator
-->
# Digital Legal Entity Application Setup Instructions
## 🚀 Complete System Initialization Process
This document describes the complete process of preparing the application for work with blockchain support, smart contracts, and access management system.
---
## Step 1: Software Installation
1. Clone the project repository to your local device
2. Run the application via Docker Compose or locally depending on configuration
3. Open the web application in browser: `http://localhost:9000` (production) or `http://localhost:5173` (dev mode)
---
## Step 2: Crypto Wallet Connection
1. Make sure you have a browser wallet installed (MetaMask, WalletConnect, or similar)
2. In the wallet, create or import an account with governance token
3. In the web application, click the **"Connect Wallet"** button
4. Select wallet type and confirm connection
5. After successful connection, you will see your account address in the top corner
---
## Step 3: Adding RPC Providers (Security → RPC Providers)
1. Go to **Settings****Security** tab
2. Find the **"RPC Providers"** section
3. Click the **"Add"** button
4. Fill out the form for each blockchain network you want to use:
- **Network Name** (e.g.: Ethereum, Polygon, BSC)
- **RPC URL** (connection link, example: `https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY`)
- **Network ID** (Chain ID)
5. Click **"Save"** for each provider
6. The system will automatically verify connection correctness
> ⚠️ **Important**: Get API keys from providers (Alchemy, Infura, Quicknode, etc.) before adding
---
## Step 4: Multi-Deploy Smart Contract Setup
1. Go to **Settings****Blockchain** tab
2. Fill out the form
3. Click **"Launch Deploy"**
---
## Step 5: Deploy Completion and Contract Address Saving
1. Wait for deploy completion (depends on network, usually 30-120 seconds)
2. After successful completion, the **"Contract Management"** page will open
3. **Copy the deployed contract address** (usually looks like: `0x742d35Cc6634C0532925a3b844Bc...`)
---
## Step 6: Smart Contract Authentication Setup
1. Return to **Settings****Authentication** tab
2. In the **"Smart Contract Address"** field, paste the address copied in step 5
3. Set thresholds for access management:
- **Minimum number of tokens for editing** (e.g.: 100 tokens)
- **Minimum number of tokens for viewing** (e.g.: 1 token)
---
## Step 7: AI and Database Setup
1. Go to **Settings****AI** tab
2. Open the **"Database"** subsection
3. Replace default passwords
4. Click **"Generate New Encryption Key"**
- The system will automatically create a cryptographic key
- **Save the key in a secure place** (it will be needed for data recovery)
---
## Step 8: Internet Access Setup (Optional)
**If you need access to the web application from outside via internet:**
1. Go to **Settings****Server** tab
2. On the **Server** page, select **WEB SSH** or another suitable service
3. Fill out the form to migrate local application to a virtual device with:
- **Public IP address**
- **Connection to your domain name**
4. Click **"Publish"**
5. Wait for migration process completion
> **Note**: This step requires having a registered domain name and access to DNS settings
---
## Step 9: Legal Documents Setup for Personal Data Processing
### 9.1 Filling Company Legal Information
1. Go to **CRM****Content** section
2. Find and open the **"Company Legal Information"** form
3. Fill in all necessary fields:
- **Full Organization Name** (legal name)
- **Short Name**
- **Legal Form** (LLC, sole proprietor, JSC, etc.)
- **Legal Address**
- **Actual Address** (if different)
- **INN / OGRN / KPP** (registration data)
- **Contact Information** (phone, email, website)
- **Responsible Person for Personal Data Processing** (Full Name, position)
- **Applicable Jurisdiction** (GDPR, CCPA, Russian legislation, etc.)
4. Click **"Save"**
> 💡 **Hint**: All entered data will automatically be inserted into all legal document templates
### 9.2 Working with Document Templates
1. In the **Content** section, go to the **"Templates"** subsection
2. Select necessary document templates required by regulators:
- **Privacy Policy**
- **User Agreement**
- **Personal Data Processing Consent**
- **Cookie Usage Policy**
3. For each template:
- Click **"Preview"** to check automatically filled data
- Edit specific data processing parameters if necessary
- Select action:
- **"Publish for Public Use"** — document will be available on the site
- **"Publish for Internal Use"** — document available only within CRM
- **"Print"** — export to PDF for printing or signing
4. Confirm publication
5. The system will automatically add documents to corresponding application pages
> ⚠️ **Important**: It is recommended to consult with a lawyer before publishing documents to ensure full compliance with legal requirements
---
## ✅ Application Ready to Work!
After completing all steps, your application is fully configured and ready to use.
**Next Steps:**
- 📖 AI Assistant Setup (see document: `setup-ai-assistant.md`)
- 🔐 Smart Contract Management (see document: `manage-smart-contracts.md`)
---
## 🆘 Security Recommendations
✓ Keep contract addresses and encryption keys in a secure place
✓ Use strong passwords for DB
✓ Regularly create configuration backups
✓ Never share wallet private keys
✓ Use HTTPS for application access in production
---
## 📝 What's Next?
After completing basic setup, you can:
1. Add users and manage their permissions
2. Create groups for collaboration
3. Configure AI assistant for task automation
4. Manage smart contracts to extend functionality
5. Integrate external services and bots
---
## 📚 Additional Documentation
### Explore DLE Capabilities
- 🤖 **[AI Assistant](./ai-assistant.md)** - learn how AI can become a second pilot for your team
- 💼 **[Blockchain for Business](./blockchain-for-business.md)** - how asset tokenization solves business tasks
- 🛡️ **[Security](./security.md)** - multi-level protection for your business
### Technical Information
- 🔗 **[Blockchain Technical Documentation](./blockchain-integration-technical.md)** - for developers
- 📋 **[FAQ](./FAQ.md)** - frequently asked questions
- 📝 **[Application Description](./application-description.md)** - functionality overview
### Support
- 💬 **Support Chat**: https://hb3-accelerator.com/
- 📧 **Email**: info@hb3-accelerator.com

View File

@@ -0,0 +1,132 @@
# Technical Specification: System Messages Management
## 1. Goal and Context
- Provide managed display of system messages on the main page (`/`, component `HomeView.vue`) and add an administrative interface for their creation and moderation in the content section (`/content`, component `ContentListView.vue`).
- System messages must support "draft" and "published" statuses, be stored in the database, and be accessible via REST API.
## 2. Current State
- The main page is built by component `HomeView.vue` and displays the assistant chat (`ChatInterface.vue`), in which system messages (`Message.vue`) are highlighted by the `message.role === 'system'` attribute.
- The content section (`ContentListView.vue`) contains navigation cards: "Create Page", "Templates", "Public", "Settings", "Internal". Cards lead to existing routes `content-create`, `content-templates`, `content-published`, `content-settings`, `content-internal`.
- The project lacks entities and API for system messages; current `pagesService.js` works only with pages (`/pages`).
## 3. New User Scenarios
- **Viewing System Messages (main page, `/`):**
- Published system messages are loaded into the assistant chat and displayed as collapsed cards with clickable headers.
- When clicking the header, the message expands: the chat feed displays the full message text **or** sends a pre-prepared response from the AI assistant (the "response" content is stored with the message and selected by the `reply_type` flag).
- Messages must be explicitly marked as system (color, icon). When reopened, the user sees the last expansion state; local "read" memory is possible.
- **"System Messages" Section (`/content`):**
- On the `/content` page, a new "System Messages" card appears with a "Details" button. Navigation leads to a page with a user table (`/content/system-messages/table`), built on existing table components (see `UserTablesList.vue`), without a separate dashboard of cards.
- The table displays system messages row by row, with multiple selection via checkboxes; available bulk actions: publish, unpublish, move to drafts, delete.
- For each message, clicking "Details" (within the row) opens view/edit with a form (see below).
- **Create/Edit (`/content/system-messages/create`, `/content/system-messages/:id/edit`):**
- Form with fields: title, brief description, main text (Markdown/HTML), response type (`inline` — show content, `assistant_reply` — send prepared assistant response), "Assistant Reply" field (active when `assistant_reply`), importance tag (info/warning/danger), publication start date (optional), end date (optional), flag for guest display.
- Buttons: "Save as Draft", "Publish". When editing — "Update", "Unpublish", "Delete".
- Validations: title and main text required (or assistant reply in corresponding mode); date validation (end ≥ start).
- **Working with System Messages Table:**
- Columns: selection checkbox, title (clickable), status, response type, active period, target audience (guests/authenticated/all), creation date, author.
- Bulk actions are performed for selected rows; single actions available via context menu/buttons in row (edit, publish, unpublish, delete).
## 4. Interface Requirements
- In `ContentListView.vue`, add "System Messages" card to the `management-blocks` grid with a `Details` button. The card design should match existing blocks (header, description, button).
- System messages table page:
- Use `BaseLayout` and local styles (`scoped`).
- Table supports sorting, filtering by status, and search by title.
- Checkboxes in header and rows for bulk selection; action panel appears when selection exists.
- "Create Message" button opens creation form.
- Create/Edit Form:
- Rich-text (minimum Markdown) with preview and character/word counters.
- Display mode toggle (`inline`/`assistant_reply`) with conditional display of "Assistant Reply" field (can use `<transition>`).
- Field for icon/color selection by `severity` (static presets).
- Main Page:
- System messages are displayed in the chat block as collapsed cards (`system-message-collapsed`). Clicking the header expands the card (`system-message-expanded`) or initiates assistant sending (UI shows "message from assistant").
- For expanded messages, provide "Collapse" button and (optionally) "Mark as Read". Store state in `localStorage`.
## 5. Routing and Components
- Add routes in `router/index.js`:
- - `/content/system-messages/table``SystemMessagesTableView.vue`
- - `/content/system-messages/create``SystemMessageCreateView.vue`
- - `/content/system-messages/:id``SystemMessageDetailsView.vue` (view)
- - `/content/system-messages/:id/edit``SystemMessageEditView.vue`
- If needed for modal/nested routes, child routes or named views can be used.
- Create corresponding Vue components in `src/views/content/system-messages/` and a common set of reusable elements (table, form, filters, bulk actions) in `src/components/system-messages/`.
- Create service `src/services/systemMessagesService.js` with methods for the new API.
## 6. API and Data Requirements
- **New Table** `system_messages` (PostgreSQL):
- `id` (uuid, pk)
- `title` (text, not null)
- `summary` (text, nullable)
- `content` (text, not null)
- `reply_type` (enum: inline, assistant_reply; default inline)
- `assistant_reply_content` (text, nullable; required when `reply_type = assistant_reply`)
- `severity` (enum: info, warning, danger; default info)
- `status` (enum: draft, published; not null)
- `visible_for` (enum: all, authenticated, guests; default all)
- `publish_at` (timestamp, nullable)
- `expire_at` (timestamp, nullable)
- `created_at`, `updated_at`
- `created_by`, `updated_by` (references users/identities, nullable)
- `slug` (text, unique, for addressing by link if needed)
- **REST API (Express):**
- `GET /system-messages` (pagination, filters by status, search)
- `GET /system-messages/published` (filtering by date/audience; public)
- `GET /system-messages/:id` (access only for authorized editors)
- `POST /system-messages` (creation; `MANAGE_LEGAL_DOCS` permission)
- `PATCH /system-messages/:id` (editing; status checks)
- `DELETE /system-messages/:id` (soft delete or physical)
- `POST /system-messages/:id/publish` and `POST /system-messages/:id/unpublish` (optional, if not using PATCH)
- All protected endpoints must require authorization and permissions (see `permissions.js`, `usePermissions`).
- Add new migration (`backend/scripts/run-migrations.js`) and ORM/SQL files in the project's existing format.
- Update logging and error handling `winston`, add input validation (e.g., `Joi` or custom).
## 7. Frontend Display Logic
- `HomeView.vue`:
- On initialization, request published system messages (considering current audience) via `systemMessagesService.getPublished({ includeExpired: false })`.
- Cache response in store or local state; when subscribing to WebSocket, can provide `system_message_updated` event.
- Add expansion handler: on header click, either substitute full message text (`inline`), or initiate sending `assistant_reply_content` to chat (without user participation).
- Add message hiding handler, saving identifier in `localStorage` and filtering locally.
- `ContentListView.vue`:
- Add new "System Messages" card to the `management-blocks` grid, without breaking the adaptive grid (update `grid-template-columns` if needed).
- List Pages:
- Implement pagination (lazy loading or regular), sorting by date.
- For statuses, use color badges (info/warning/danger).
- Creation Form:
- Support submit via `yarn lint`-friendly code; client-side validation (e.g., using `computed`/`watch`).
- On successful publication, redirect to published list; when saving draft — stay on page with notification.
## 8. Security and Access Requirements
- Creation/editing scenarios available only to roles with `PERMISSIONS.MANAGE_LEGAL_DOCS`.
- Public list (`GET /system-messages/published`) filters by:
- `status === 'published'`.
- `publish_at <= now()` (or null).
- `expire_at > now()` (or null).
- `visible_for` is checked based on context (guest/authenticated).
- When issuing through chat, hide fields `created_by`, `updated_by`, internal tags.
- Consider CSRF, CORS, rate-limit (adopt config from existing routes).
## 9. Testing
- **Backend:**
- Unit tests for CRUD in `tests/system-messages/*.test.js` (Mocha).
- Check publish/expire filters and role-based access.
- Test migration (rollback/apply).
- **Frontend:**
- Vue unit tests (if configured) for main components (form, list).
- E2E (if available) — scenario: create draft → publish → display on main page.
- **Regression Checks:**
- Ensure existing content list and assistant chat continue to work without errors (`yarn lint`, `yarn test`).
## 10. Integration and DevOps
- Update `docker-compose.yml` if needed (e.g., add migrations to startup process).
- Ensure new environment variables (if any, e.g., message count limits) are documented in `README.md` and `setup-instruction.md`.
- Add seeding script (optional) for test system messages.
## 11. Open Questions
- Is publication history (auditing) needed? If yes — provide `system_messages_history` table.
- Is multilingual support required? (If absent — limit to one language, EN).
- Is WebSocket notification needed when new messages appear? (If yes — add event to `wsHub.js`).
## 12. Final Artifacts
- Backend: new routes, controllers, service, migration.
- Frontend: new pages and service, updated routes and components `HomeView`, `ContentListView`.
- Documentation: update `README.md` (launch section), `application-description.md` or `tables-system.md` when schemas change, this specification.

1639
docs-en/tables-system.md Normal file

File diff suppressed because it is too large Load Diff