ai-prishtina-text2sql-ltm


Nameai-prishtina-text2sql-ltm JSON
Version 1.0.10 PyPI version JSON
download
home_pagehttps://github.com/albanmaxhuni/text2sql-ltm
SummaryAdvanced Text-to-SQL library with AI features
upload_time2025-08-03 23:15:29
maintainerNone
docs_urlNone
authorAlban Maxhuni, PhD
requires_python>=3.8
licenseCommercial
keywords text2sql sql natural-language-processing nlp ai machine-learning database query-generation rag vector-database llm openai anthropic memory long-term-memory sql-validation security-analysis query-translation schema-discovery multimodal voice-to-sql image-to-sql enterprise production-ready
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AI Prishtina - Text2SQL-LTM: Professional Text-to-SQL Library

[![PyPI version](https://badge.fury.io/py/ai-prishtina-text2sql-ltm.svg)](https://badge.fury.io/py/ai-prishtina-text2sql-ltm)
[![Total Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)
[![Monthly Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm/month)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)
[![Weekly Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm/week)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)
[![PyPI Downloads](https://img.shields.io/pypi/dm/ai-prishtina-text2sql-ltm.svg)](https://pypi.org/project/ai-prishtina-text2sql-ltm/)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: Commercial](https://img.shields.io/badge/License-Commercial-red.svg)](#license)
[![Tests](https://img.shields.io/badge/tests-passing-green.svg)](tests/)
[![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen.svg)](tests/)


Growing adoption by developers worldwide.

## Support This Project

If you find this project helpful, please consider supporting it:

[![Donate](https://img.shields.io/badge/Donate-coff.ee%2Falbanmaxhuni-yellow.svg)](https://coff.ee/albanmaxhuni)

**AI PRISHTINA - Text2SQL-LTM** is a comprehensive Text-to-SQL library with AI capabilities. Built with production-ready architecture for natural language to SQL conversion.

## Features

### RAG-Enhanced Query Generation
- Vector-based knowledge retrieval with semantic search
- Schema-aware context augmentation for intelligent SQL generation
- Query pattern learning from successful executions
- Adaptive retrieval strategies that improve over time
- Knowledge fusion across different data sources

### SQL Validation & Auto-Correction
- Intelligent syntax validation with automatic error fixing
- Security vulnerability detection and prevention
- Performance optimization suggestions with impact analysis
- Cross-platform compatibility checking
- Best practice enforcement with educational feedback

### Query Explanation & Teaching System
- Step-by-step query breakdown with visual execution flow
- Adaptive explanations based on user expertise level
- Interactive learning modes with guided practice
- Personalized learning paths with progress tracking
- Real-time teaching assistance for SQL education

### Automated Schema Discovery & Documentation
- AI-powered relationship inference between tables
- Column purpose detection using pattern recognition
- Data quality assessment with improvement suggestions
- Auto-generated documentation in multiple formats
- Business rule extraction from data patterns

### Advanced Security Analysis
- SQL injection detection with real-time prevention
- Privilege escalation monitoring and alerts
- Data exposure analysis with compliance checking (GDPR, PCI DSS, SOX)
- Vulnerability scanning with remediation guidance
- Security best practice validation

### Cross-Platform Query Translation
- Intelligent dialect conversion between 8+ database platforms
- Syntax optimization for target platforms
- Compatibility analysis with migration guidance
- Performance tuning for specific database engines
- Feature mapping across different SQL dialects

### Automated Test Case Generation
- Comprehensive test suite creation for SQL queries
- Edge case detection and test generation
- Performance test automation with benchmarking
- Security test scenarios for vulnerability assessment
- Data validation testing with constraint checking

## Quick Start

### Installation

```bash
pip install ai-prishtina-text2sql-ltm
```

### 30-Second Setup

```python
import asyncio
from text2sql_ltm import create_simple_agent, Text2SQLSession

async def main():
    # Just provide your API key - everything else uses smart defaults
    agent = create_simple_agent(api_key="your_openai_key")

    async with Text2SQLSession(agent) as session:
        result = await session.query(
            "Show me the top 10 customers by revenue this year",
            user_id="user123"
        )

        print(f"Generated SQL: {result.sql}")
        print(f"Confidence: {result.confidence}")
        print(f"Explanation: {result.explanation}")

asyncio.run(main())
```

### Feature-Rich Setup

```python
# Enable advanced features with simple flags
agent = create_simple_agent(
    api_key="your_openai_key",
    enable_rag=True,                    # Vector-enhanced generation
    enable_security_analysis=True,      # Security scanning
    enable_explanation=True,            # AI teaching
    enable_test_generation=True         # Automated testing
)
```

### Production Configuration

```python
from text2sql_ltm import create_integrated_agent

# Load from configuration file
agent = create_integrated_agent(config_file="config/production.yaml")

# Or use configuration dictionary
agent = create_integrated_agent(config_dict={
    "memory": {
        "storage_backend": "postgresql",
        "storage_url": "postgresql://user:pass@localhost/db"
    },
    "agent": {
        "llm_provider": "openai",
        "llm_model": "gpt-4",
        "llm_api_key": "your_api_key"
    },
    "ai_features": {
        "enable_rag": True,
        "enable_validation": True,
        "enable_security_analysis": True
    }
})
```

## Advanced Examples

### Security Analysis

```python
# Security analysis
security_result = await agent.security_analyzer.analyze_security(
    query="SELECT * FROM users WHERE id = ?",
    user_id="user123",
    context={"user_input": True}
)

print(f"Security Score: {security_result.risk_score}/10")
print(f"Vulnerabilities: {len(security_result.vulnerabilities)}")
print(f"Compliance: {security_result.compliance_status}")
```

### Cross-Platform Translation

```python
# Translate between database dialects
translation_result = await agent.query_translator.translate_query(
    query="SELECT TOP 10 * FROM users",
    source_dialect="sqlserver",
    target_dialect="postgresql",
    optimize_for_target=True
)

print(f"Original: {translation_result.original_query}")
print(f"Translated: {translation_result.translated_query}")
print(f"Compatibility: {translation_result.compatibility}")
```

### Automated Testing

```python
# Generate test suite
test_suite = await agent.test_generator.generate_test_suite(
    query="SELECT name, COUNT(*) FROM users GROUP BY name",
    schema=schema_info,
    test_types=["functional", "edge_case", "performance", "security"]
)

print(f"Generated {len(test_suite.test_cases)} test cases")
```

## Architecture

Text2SQL-LTM features a modular, production-ready architecture:

### System Architecture

```
┌─────────────────────────────────────────────────────────────────────────────────┐
│                           AI-Prishtina-Text2SQL-LTM                             │
│                              Production Architecture                            │
└─────────────────────────────────────────────────────────────────────────────────┘

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   User Input    │    │  Natural Lang   │    │   SQL Output    │
│                 │───▶│   Processing    │───▶│                 │
│ "Show top users"│    │                 │    │ SELECT * FROM.. │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                            CORE AGENT LAYER                                     │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                  │
│  │ Session Manager │  │ Context Engine  │  │ SQL Generator   │                  │
│  │                 │  │                 │  │                 │                  │
│  │ • User Sessions │  │ • Query Context │  │ • LLM Interface │                  │
│  │ • State Mgmt    │  │ • Schema Context│  │ • SQL Generation│                  │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                  │
└─────────────────────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                           MEMORY SYSTEM                                        │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ Memory Manager  │  │ Storage Backend │  │ Schema Manager  │                │
│  │                 │  │                 │  │                 │                │
│  │ • Query History │  │ • InMemory      │  │ • Schema Cache  │                │
│  │ • User Context  │  │ • Redis         │  │ • Relationships │                │
│  │ • Learning      │  │ • PostgreSQL    │  │ • Metadata      │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
└─────────────────────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                            RAG SYSTEM                                          │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ Vector Store    │  │ Embeddings      │  │ Retrieval       │                │
│  │                 │  │                 │  │                 │                │
│  │ • ChromaDB      │  │ • OpenAI        │  │ • Semantic      │                │
│  │ • Pinecone      │  │ • Sentence-T    │  │ • Similarity    │                │
│  │ • Weaviate      │  │ • Custom        │  │ • Context       │                │
│  │ • 7 Databases   │  │                 │  │                 │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
└─────────────────────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                           AI FEATURES                                          │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ SQL Validator   │  │ Security        │  │ Query Explainer │                │
│  │                 │  │ Analyzer        │  │                 │                │
│  │ • Syntax Check  │  │ • Injection Det │  │ • Step-by-step  │                │
│  │ • Performance   │  │ • Risk Analysis │  │ • Educational   │                │
│  │ • Best Practice │  │ • Compliance    │  │ • Adaptive      │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
│                                                                                 │
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ Schema          │  │ Query           │  │ Test            │                │
│  │ Discovery       │  │ Translator      │  │ Generator       │                │
│  │                 │  │                 │  │                 │                │
│  │ • Auto Analysis │  │ • Cross-dialect │  │ • Auto Tests    │                │
│  │ • Relationships │  │ • 8+ Databases  │  │ • Edge Cases    │                │
│  │ • Documentation │  │ • Optimization  │  │ • Performance   │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
└─────────────────────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                         LLM PROVIDERS                                          │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ OpenAI          │  │ Anthropic       │  │ Google          │                │
│  │ • GPT-4         │  │ • Claude        │  │ • Gemini        │                │
│  │ • GPT-3.5       │  │ • Haiku         │  │ • PaLM          │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
│                                                                                 │
│  ┌─────────────────┐  ┌─────────────────┐                                      │
│  │ HuggingFace     │  │ Local Models    │                                      │
│  │ • Transformers  │  │ • Ollama        │                                      │
│  │ • Custom Models │  │ • Custom        │                                      │
│  └─────────────────┘  └─────────────────┘                                      │
└─────────────────────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                        DATABASE TARGETS                                        │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ PostgreSQL      │  │ MySQL           │  │ SQLite          │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
│                                                                                 │
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐                │
│  │ SQL Server      │  │ Oracle          │  │ MongoDB         │                │
│  └─────────────────┘  └─────────────────┘  └─────────────────┘                │
└─────────────────────────────────────────────────────────────────────────────────┘
```

### Component Directory Structure

```
text2sql_ltm/
├── __init__.py              # Main library interface
├── agent.py                 # Core agent implementation
├── factory.py               # Agent factory functions
├── types.py                 # Type definitions
├── exceptions.py            # Custom exceptions
├── config/                  # Configuration management
│   ├── __init__.py
│   ├── base.py             # Base configuration
│   ├── memory.py           # Memory configuration
│   ├── agent.py            # Agent configuration
│   └── ai_features.py      # AI features configuration
├── memory/                  # Long-term memory system
│   ├── __init__.py
│   ├── manager.py          # Memory manager
│   ├── simple_manager.py   # Simplified memory manager
│   ├── storage.py          # Storage backends
│   └── types.py            # Memory types
├── rag/                     # RAG implementation
│   ├── __init__.py
│   ├── manager.py          # RAG orchestration
│   ├── vector_store.py     # Vector storage (7 databases)
│   ├── embeddings.py       # Embedding generation
│   └── retrieval.py        # Context retrieval
├── ai_features/             # AI features
│   ├── __init__.py
│   ├── sql_validator.py    # SQL validation
│   ├── explainer.py        # Query explanation
│   ├── schema_discovery.py # Schema analysis
│   ├── query_translator.py # Cross-platform translation
│   ├── security_analyzer.py# Security analysis
│   └── test_generator.py   # Test automation
└── llm/                     # LLM providers
    ├── __init__.py
    ├── base.py             # Base LLM interface
    ├── openai_provider.py  # OpenAI integration
    ├── anthropic_provider.py# Anthropic integration
    ├── google_provider.py  # Google integration
    ├── huggingface_provider.py# HuggingFace integration
    └── local_provider.py   # Local model support
```

## Configuration

### YAML Configuration

```yaml
# config/production.yaml
memory:
  storage_backend: "postgresql"
  storage_url: "${DATABASE_URL}"

agent:
  llm_provider: "openai"
  llm_model: "gpt-4"
  llm_api_key: "${OPENAI_API_KEY}"

ai_features:
  enable_rag: true
  enable_validation: true
  enable_security_analysis: true

  rag:
    vector_store:
      provider: "pinecone"
      api_key: "${PINECONE_API_KEY}"
    embedding:
      provider: "openai"
      api_key: "${OPENAI_API_KEY}"

security:
  require_authentication: true
  rate_limiting_enabled: true
```

### Environment Variables

```bash
# Core API Keys
OPENAI_API_KEY=your_openai_key
DATABASE_URL=postgresql://user:pass@localhost/db

# Optional Services
PINECONE_API_KEY=your_pinecone_key
GOOGLE_VISION_API_KEY=your_google_key
REDIS_URL=redis://localhost:6379
```

## Testing

Run the comprehensive test suite:

```bash
# Install with test dependencies
pip install text2sql-ltm[test]

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=text2sql_ltm --cov-report=html

# Run specific test categories
pytest tests/test_rag_system.py -v
pytest tests/test_security.py -v
```

## Examples

Examples are available in the `examples/` directory:

- **[Basic Usage](examples/basic_usage.py)** - Getting started guide
- **[Advanced Features](examples/advanced_features.py)** - All features
- **[Production Deployment](examples/production_deployment.py)** - Enterprise setup
- **[Security Analysis](examples/security_examples.py)** - Security features

## Support & Licensing

### Commercial License

Text2SQL-LTM is a commercial product with advanced enterprise features.

**For licensing, pricing, and enterprise support, contact:**

**Alban Maxhuni, PhD**
**Email**: [info@albanmaxhuni.com](mailto:info@albanmaxhuni.com)
**Website**: [albanmaxhuni.com](https://albanmaxhuni.com)

### License Options

- **Individual License**: For personal and small team use
- **Enterprise License**: For large organizations with advanced features
- **Custom License**: Tailored solutions for specific requirements

### What's Included

- Full source code access
- Priority technical support
- Regular updates and new features
- Custom integration assistance
- Training and consultation
- SLA guarantees for enterprise

## Getting Started

1. **Install**: `pip install ai-prishtina-text2sql-ltm`
2. **Contact**: [info@albanmaxhuni.com](mailto:info@albanmaxhuni.com) for licensing
3. **Configure**: Set up your API keys and configuration
4. **Deploy**: Use our production-ready templates
5. **Scale**: Leverage enterprise features for your organization

---

**AI-Prishtina-Text2SQL-LTM: Professional database interaction through AI.**

*© 2025 AI Prishtina, Inc. All rights reserved.*

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/albanmaxhuni/text2sql-ltm",
    "name": "ai-prishtina-text2sql-ltm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "\"Alban Maxhuni, PhD\" <info@albanmaxhuni.com>",
    "keywords": "text2sql, sql, natural-language-processing, nlp, ai, machine-learning, database, query-generation, rag, vector-database, llm, openai, anthropic, memory, long-term-memory, sql-validation, security-analysis, query-translation, schema-discovery, multimodal, voice-to-sql, image-to-sql, enterprise, production-ready",
    "author": "Alban Maxhuni, PhD",
    "author_email": "\"Alban Maxhuni, PhD\" <info@albanmaxhuni.com>",
    "download_url": null,
    "platform": "any",
    "description": "# AI Prishtina - Text2SQL-LTM: Professional Text-to-SQL Library\n\n[![PyPI version](https://badge.fury.io/py/ai-prishtina-text2sql-ltm.svg)](https://badge.fury.io/py/ai-prishtina-text2sql-ltm)\n[![Total Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)\n[![Monthly Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm/month)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)\n[![Weekly Downloads](https://static.pepy.tech/badge/ai-prishtina-text2sql-ltm/week)](https://pepy.tech/project/ai-prishtina-text2sql-ltm)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/ai-prishtina-text2sql-ltm.svg)](https://pypi.org/project/ai-prishtina-text2sql-ltm/)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: Commercial](https://img.shields.io/badge/License-Commercial-red.svg)](#license)\n[![Tests](https://img.shields.io/badge/tests-passing-green.svg)](tests/)\n[![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen.svg)](tests/)\n\n\nGrowing adoption by developers worldwide.\n\n## Support This Project\n\nIf you find this project helpful, please consider supporting it:\n\n[![Donate](https://img.shields.io/badge/Donate-coff.ee%2Falbanmaxhuni-yellow.svg)](https://coff.ee/albanmaxhuni)\n\n**AI PRISHTINA - Text2SQL-LTM** is a comprehensive Text-to-SQL library with AI capabilities. Built with production-ready architecture for natural language to SQL conversion.\n\n## Features\n\n### RAG-Enhanced Query Generation\n- Vector-based knowledge retrieval with semantic search\n- Schema-aware context augmentation for intelligent SQL generation\n- Query pattern learning from successful executions\n- Adaptive retrieval strategies that improve over time\n- Knowledge fusion across different data sources\n\n### SQL Validation & Auto-Correction\n- Intelligent syntax validation with automatic error fixing\n- Security vulnerability detection and prevention\n- Performance optimization suggestions with impact analysis\n- Cross-platform compatibility checking\n- Best practice enforcement with educational feedback\n\n### Query Explanation & Teaching System\n- Step-by-step query breakdown with visual execution flow\n- Adaptive explanations based on user expertise level\n- Interactive learning modes with guided practice\n- Personalized learning paths with progress tracking\n- Real-time teaching assistance for SQL education\n\n### Automated Schema Discovery & Documentation\n- AI-powered relationship inference between tables\n- Column purpose detection using pattern recognition\n- Data quality assessment with improvement suggestions\n- Auto-generated documentation in multiple formats\n- Business rule extraction from data patterns\n\n### Advanced Security Analysis\n- SQL injection detection with real-time prevention\n- Privilege escalation monitoring and alerts\n- Data exposure analysis with compliance checking (GDPR, PCI DSS, SOX)\n- Vulnerability scanning with remediation guidance\n- Security best practice validation\n\n### Cross-Platform Query Translation\n- Intelligent dialect conversion between 8+ database platforms\n- Syntax optimization for target platforms\n- Compatibility analysis with migration guidance\n- Performance tuning for specific database engines\n- Feature mapping across different SQL dialects\n\n### Automated Test Case Generation\n- Comprehensive test suite creation for SQL queries\n- Edge case detection and test generation\n- Performance test automation with benchmarking\n- Security test scenarios for vulnerability assessment\n- Data validation testing with constraint checking\n\n## Quick Start\n\n### Installation\n\n```bash\npip install ai-prishtina-text2sql-ltm\n```\n\n### 30-Second Setup\n\n```python\nimport asyncio\nfrom text2sql_ltm import create_simple_agent, Text2SQLSession\n\nasync def main():\n    # Just provide your API key - everything else uses smart defaults\n    agent = create_simple_agent(api_key=\"your_openai_key\")\n\n    async with Text2SQLSession(agent) as session:\n        result = await session.query(\n            \"Show me the top 10 customers by revenue this year\",\n            user_id=\"user123\"\n        )\n\n        print(f\"Generated SQL: {result.sql}\")\n        print(f\"Confidence: {result.confidence}\")\n        print(f\"Explanation: {result.explanation}\")\n\nasyncio.run(main())\n```\n\n### Feature-Rich Setup\n\n```python\n# Enable advanced features with simple flags\nagent = create_simple_agent(\n    api_key=\"your_openai_key\",\n    enable_rag=True,                    # Vector-enhanced generation\n    enable_security_analysis=True,      # Security scanning\n    enable_explanation=True,            # AI teaching\n    enable_test_generation=True         # Automated testing\n)\n```\n\n### Production Configuration\n\n```python\nfrom text2sql_ltm import create_integrated_agent\n\n# Load from configuration file\nagent = create_integrated_agent(config_file=\"config/production.yaml\")\n\n# Or use configuration dictionary\nagent = create_integrated_agent(config_dict={\n    \"memory\": {\n        \"storage_backend\": \"postgresql\",\n        \"storage_url\": \"postgresql://user:pass@localhost/db\"\n    },\n    \"agent\": {\n        \"llm_provider\": \"openai\",\n        \"llm_model\": \"gpt-4\",\n        \"llm_api_key\": \"your_api_key\"\n    },\n    \"ai_features\": {\n        \"enable_rag\": True,\n        \"enable_validation\": True,\n        \"enable_security_analysis\": True\n    }\n})\n```\n\n## Advanced Examples\n\n### Security Analysis\n\n```python\n# Security analysis\nsecurity_result = await agent.security_analyzer.analyze_security(\n    query=\"SELECT * FROM users WHERE id = ?\",\n    user_id=\"user123\",\n    context={\"user_input\": True}\n)\n\nprint(f\"Security Score: {security_result.risk_score}/10\")\nprint(f\"Vulnerabilities: {len(security_result.vulnerabilities)}\")\nprint(f\"Compliance: {security_result.compliance_status}\")\n```\n\n### Cross-Platform Translation\n\n```python\n# Translate between database dialects\ntranslation_result = await agent.query_translator.translate_query(\n    query=\"SELECT TOP 10 * FROM users\",\n    source_dialect=\"sqlserver\",\n    target_dialect=\"postgresql\",\n    optimize_for_target=True\n)\n\nprint(f\"Original: {translation_result.original_query}\")\nprint(f\"Translated: {translation_result.translated_query}\")\nprint(f\"Compatibility: {translation_result.compatibility}\")\n```\n\n### Automated Testing\n\n```python\n# Generate test suite\ntest_suite = await agent.test_generator.generate_test_suite(\n    query=\"SELECT name, COUNT(*) FROM users GROUP BY name\",\n    schema=schema_info,\n    test_types=[\"functional\", \"edge_case\", \"performance\", \"security\"]\n)\n\nprint(f\"Generated {len(test_suite.test_cases)} test cases\")\n```\n\n## Architecture\n\nText2SQL-LTM features a modular, production-ready architecture:\n\n### System Architecture\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                           AI-Prishtina-Text2SQL-LTM                             \u2502\n\u2502                              Production Architecture                            \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502   User Input    \u2502    \u2502  Natural Lang   \u2502    \u2502   SQL Output    \u2502\n\u2502                 \u2502\u2500\u2500\u2500\u25b6\u2502   Processing    \u2502\u2500\u2500\u2500\u25b6\u2502                 \u2502\n\u2502 \"Show top users\"\u2502    \u2502                 \u2502    \u2502 SELECT * FROM.. \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                            CORE AGENT LAYER                                     \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                  \u2502\n\u2502  \u2502 Session Manager \u2502  \u2502 Context Engine  \u2502  \u2502 SQL Generator   \u2502                  \u2502\n\u2502  \u2502                 \u2502  \u2502                 \u2502  \u2502                 \u2502                  \u2502\n\u2502  \u2502 \u2022 User Sessions \u2502  \u2502 \u2022 Query Context \u2502  \u2502 \u2022 LLM Interface \u2502                  \u2502\n\u2502  \u2502 \u2022 State Mgmt    \u2502  \u2502 \u2022 Schema Context\u2502  \u2502 \u2022 SQL Generation\u2502                  \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                  \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                           MEMORY SYSTEM                                        \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 Memory Manager  \u2502  \u2502 Storage Backend \u2502  \u2502 Schema Manager  \u2502                \u2502\n\u2502  \u2502                 \u2502  \u2502                 \u2502  \u2502                 \u2502                \u2502\n\u2502  \u2502 \u2022 Query History \u2502  \u2502 \u2022 InMemory      \u2502  \u2502 \u2022 Schema Cache  \u2502                \u2502\n\u2502  \u2502 \u2022 User Context  \u2502  \u2502 \u2022 Redis         \u2502  \u2502 \u2022 Relationships \u2502                \u2502\n\u2502  \u2502 \u2022 Learning      \u2502  \u2502 \u2022 PostgreSQL    \u2502  \u2502 \u2022 Metadata      \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                            RAG SYSTEM                                          \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 Vector Store    \u2502  \u2502 Embeddings      \u2502  \u2502 Retrieval       \u2502                \u2502\n\u2502  \u2502                 \u2502  \u2502                 \u2502  \u2502                 \u2502                \u2502\n\u2502  \u2502 \u2022 ChromaDB      \u2502  \u2502 \u2022 OpenAI        \u2502  \u2502 \u2022 Semantic      \u2502                \u2502\n\u2502  \u2502 \u2022 Pinecone      \u2502  \u2502 \u2022 Sentence-T    \u2502  \u2502 \u2022 Similarity    \u2502                \u2502\n\u2502  \u2502 \u2022 Weaviate      \u2502  \u2502 \u2022 Custom        \u2502  \u2502 \u2022 Context       \u2502                \u2502\n\u2502  \u2502 \u2022 7 Databases   \u2502  \u2502                 \u2502  \u2502                 \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                           AI FEATURES                                          \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 SQL Validator   \u2502  \u2502 Security        \u2502  \u2502 Query Explainer \u2502                \u2502\n\u2502  \u2502                 \u2502  \u2502 Analyzer        \u2502  \u2502                 \u2502                \u2502\n\u2502  \u2502 \u2022 Syntax Check  \u2502  \u2502 \u2022 Injection Det \u2502  \u2502 \u2022 Step-by-step  \u2502                \u2502\n\u2502  \u2502 \u2022 Performance   \u2502  \u2502 \u2022 Risk Analysis \u2502  \u2502 \u2022 Educational   \u2502                \u2502\n\u2502  \u2502 \u2022 Best Practice \u2502  \u2502 \u2022 Compliance    \u2502  \u2502 \u2022 Adaptive      \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2502                                                                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 Schema          \u2502  \u2502 Query           \u2502  \u2502 Test            \u2502                \u2502\n\u2502  \u2502 Discovery       \u2502  \u2502 Translator      \u2502  \u2502 Generator       \u2502                \u2502\n\u2502  \u2502                 \u2502  \u2502                 \u2502  \u2502                 \u2502                \u2502\n\u2502  \u2502 \u2022 Auto Analysis \u2502  \u2502 \u2022 Cross-dialect \u2502  \u2502 \u2022 Auto Tests    \u2502                \u2502\n\u2502  \u2502 \u2022 Relationships \u2502  \u2502 \u2022 8+ Databases  \u2502  \u2502 \u2022 Edge Cases    \u2502                \u2502\n\u2502  \u2502 \u2022 Documentation \u2502  \u2502 \u2022 Optimization  \u2502  \u2502 \u2022 Performance   \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                         LLM PROVIDERS                                          \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 OpenAI          \u2502  \u2502 Anthropic       \u2502  \u2502 Google          \u2502                \u2502\n\u2502  \u2502 \u2022 GPT-4         \u2502  \u2502 \u2022 Claude        \u2502  \u2502 \u2022 Gemini        \u2502                \u2502\n\u2502  \u2502 \u2022 GPT-3.5       \u2502  \u2502 \u2022 Haiku         \u2502  \u2502 \u2022 PaLM          \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2502                                                                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                                      \u2502\n\u2502  \u2502 HuggingFace     \u2502  \u2502 Local Models    \u2502                                      \u2502\n\u2502  \u2502 \u2022 Transformers  \u2502  \u2502 \u2022 Ollama        \u2502                                      \u2502\n\u2502  \u2502 \u2022 Custom Models \u2502  \u2502 \u2022 Custom        \u2502                                      \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                                      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                \u2502\n                                \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                        DATABASE TARGETS                                        \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 PostgreSQL      \u2502  \u2502 MySQL           \u2502  \u2502 SQLite          \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2502                                                                                 \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                \u2502\n\u2502  \u2502 SQL Server      \u2502  \u2502 Oracle          \u2502  \u2502 MongoDB         \u2502                \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Component Directory Structure\n\n```\ntext2sql_ltm/\n\u251c\u2500\u2500 __init__.py              # Main library interface\n\u251c\u2500\u2500 agent.py                 # Core agent implementation\n\u251c\u2500\u2500 factory.py               # Agent factory functions\n\u251c\u2500\u2500 types.py                 # Type definitions\n\u251c\u2500\u2500 exceptions.py            # Custom exceptions\n\u251c\u2500\u2500 config/                  # Configuration management\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 base.py             # Base configuration\n\u2502   \u251c\u2500\u2500 memory.py           # Memory configuration\n\u2502   \u251c\u2500\u2500 agent.py            # Agent configuration\n\u2502   \u2514\u2500\u2500 ai_features.py      # AI features configuration\n\u251c\u2500\u2500 memory/                  # Long-term memory system\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 manager.py          # Memory manager\n\u2502   \u251c\u2500\u2500 simple_manager.py   # Simplified memory manager\n\u2502   \u251c\u2500\u2500 storage.py          # Storage backends\n\u2502   \u2514\u2500\u2500 types.py            # Memory types\n\u251c\u2500\u2500 rag/                     # RAG implementation\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 manager.py          # RAG orchestration\n\u2502   \u251c\u2500\u2500 vector_store.py     # Vector storage (7 databases)\n\u2502   \u251c\u2500\u2500 embeddings.py       # Embedding generation\n\u2502   \u2514\u2500\u2500 retrieval.py        # Context retrieval\n\u251c\u2500\u2500 ai_features/             # AI features\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 sql_validator.py    # SQL validation\n\u2502   \u251c\u2500\u2500 explainer.py        # Query explanation\n\u2502   \u251c\u2500\u2500 schema_discovery.py # Schema analysis\n\u2502   \u251c\u2500\u2500 query_translator.py # Cross-platform translation\n\u2502   \u251c\u2500\u2500 security_analyzer.py# Security analysis\n\u2502   \u2514\u2500\u2500 test_generator.py   # Test automation\n\u2514\u2500\u2500 llm/                     # LLM providers\n    \u251c\u2500\u2500 __init__.py\n    \u251c\u2500\u2500 base.py             # Base LLM interface\n    \u251c\u2500\u2500 openai_provider.py  # OpenAI integration\n    \u251c\u2500\u2500 anthropic_provider.py# Anthropic integration\n    \u251c\u2500\u2500 google_provider.py  # Google integration\n    \u251c\u2500\u2500 huggingface_provider.py# HuggingFace integration\n    \u2514\u2500\u2500 local_provider.py   # Local model support\n```\n\n## Configuration\n\n### YAML Configuration\n\n```yaml\n# config/production.yaml\nmemory:\n  storage_backend: \"postgresql\"\n  storage_url: \"${DATABASE_URL}\"\n\nagent:\n  llm_provider: \"openai\"\n  llm_model: \"gpt-4\"\n  llm_api_key: \"${OPENAI_API_KEY}\"\n\nai_features:\n  enable_rag: true\n  enable_validation: true\n  enable_security_analysis: true\n\n  rag:\n    vector_store:\n      provider: \"pinecone\"\n      api_key: \"${PINECONE_API_KEY}\"\n    embedding:\n      provider: \"openai\"\n      api_key: \"${OPENAI_API_KEY}\"\n\nsecurity:\n  require_authentication: true\n  rate_limiting_enabled: true\n```\n\n### Environment Variables\n\n```bash\n# Core API Keys\nOPENAI_API_KEY=your_openai_key\nDATABASE_URL=postgresql://user:pass@localhost/db\n\n# Optional Services\nPINECONE_API_KEY=your_pinecone_key\nGOOGLE_VISION_API_KEY=your_google_key\nREDIS_URL=redis://localhost:6379\n```\n\n## Testing\n\nRun the comprehensive test suite:\n\n```bash\n# Install with test dependencies\npip install text2sql-ltm[test]\n\n# Run all tests\npytest tests/ -v\n\n# Run with coverage\npytest tests/ --cov=text2sql_ltm --cov-report=html\n\n# Run specific test categories\npytest tests/test_rag_system.py -v\npytest tests/test_security.py -v\n```\n\n## Examples\n\nExamples are available in the `examples/` directory:\n\n- **[Basic Usage](examples/basic_usage.py)** - Getting started guide\n- **[Advanced Features](examples/advanced_features.py)** - All features\n- **[Production Deployment](examples/production_deployment.py)** - Enterprise setup\n- **[Security Analysis](examples/security_examples.py)** - Security features\n\n## Support & Licensing\n\n### Commercial License\n\nText2SQL-LTM is a commercial product with advanced enterprise features.\n\n**For licensing, pricing, and enterprise support, contact:**\n\n**Alban Maxhuni, PhD**\n**Email**: [info@albanmaxhuni.com](mailto:info@albanmaxhuni.com)\n**Website**: [albanmaxhuni.com](https://albanmaxhuni.com)\n\n### License Options\n\n- **Individual License**: For personal and small team use\n- **Enterprise License**: For large organizations with advanced features\n- **Custom License**: Tailored solutions for specific requirements\n\n### What's Included\n\n- Full source code access\n- Priority technical support\n- Regular updates and new features\n- Custom integration assistance\n- Training and consultation\n- SLA guarantees for enterprise\n\n## Getting Started\n\n1. **Install**: `pip install ai-prishtina-text2sql-ltm`\n2. **Contact**: [info@albanmaxhuni.com](mailto:info@albanmaxhuni.com) for licensing\n3. **Configure**: Set up your API keys and configuration\n4. **Deploy**: Use our production-ready templates\n5. **Scale**: Leverage enterprise features for your organization\n\n---\n\n**AI-Prishtina-Text2SQL-LTM: Professional database interaction through AI.**\n\n*\u00a9 2025 AI Prishtina, Inc. All rights reserved.*\n",
    "bugtrack_url": null,
    "license": "Commercial",
    "summary": "Advanced Text-to-SQL library with AI features",
    "version": "1.0.10",
    "project_urls": {
        "Bug Tracker": "https://github.com/AI-Prishtina/ai-prishtina-text2sql-ltm/issues",
        "Changelog": "https://github.com/AI-Prishtina/ai-prishtina-text2sql-ltm/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/AI-Prishtina/ai-prishtina-text2sql-ltm/blob/main/README.md",
        "Funding": "https://coff.ee/albanmaxhuni",
        "Homepage": "https://github.com/AI-Prishtina/ai-prishtina-text2sql-ltm",
        "Repository": "https://github.com/AI-Prishtina/ai-prishtina-text2sql-ltm"
    },
    "split_keywords": [
        "text2sql",
        " sql",
        " natural-language-processing",
        " nlp",
        " ai",
        " machine-learning",
        " database",
        " query-generation",
        " rag",
        " vector-database",
        " llm",
        " openai",
        " anthropic",
        " memory",
        " long-term-memory",
        " sql-validation",
        " security-analysis",
        " query-translation",
        " schema-discovery",
        " multimodal",
        " voice-to-sql",
        " image-to-sql",
        " enterprise",
        " production-ready"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "42974ade4d64626fbcb0660b87a8e3e813c437c28584b2019a93149514a29645",
                "md5": "07a99a2edc4cb4111f0af17d03caf305",
                "sha256": "d3610e48a0c8acecdcf3b3856432cebdf6fa6ac9a87a84735064b065f9a027bd"
            },
            "downloads": -1,
            "filename": "ai_prishtina_text2sql_ltm-1.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07a99a2edc4cb4111f0af17d03caf305",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 230340,
            "upload_time": "2025-08-03T23:15:29",
            "upload_time_iso_8601": "2025-08-03T23:15:29.416943Z",
            "url": "https://files.pythonhosted.org/packages/42/97/4ade4d64626fbcb0660b87a8e3e813c437c28584b2019a93149514a29645/ai_prishtina_text2sql_ltm-1.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 23:15:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "albanmaxhuni",
    "github_project": "text2sql-ltm",
    "github_not_found": true,
    "lcname": "ai-prishtina-text2sql-ltm"
}
        
Elapsed time: 1.07734s