veloxs-nexus 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. veloxs_nexus-2.3.0/LICENSE +75 -0
  2. veloxs_nexus-2.3.0/NOTICE +30 -0
  3. veloxs_nexus-2.3.0/PKG-INFO +153 -0
  4. veloxs_nexus-2.3.0/README.md +128 -0
  5. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/__init__.py +17 -0
  6. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/chunking.py +162 -0
  7. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/cli.py +62 -0
  8. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/config.py +96 -0
  9. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/engine.py +69 -0
  10. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/enrichment.py +64 -0
  11. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/io.py +55 -0
  12. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/models.py +41 -0
  13. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/pipeline.py +118 -0
  14. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/tokenization.py +215 -0
  15. veloxs_nexus-2.3.0/data-processing-enrichment/src/nexus_processing/transforms.py +68 -0
  16. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/__init__.py +18 -0
  17. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/cli.py +63 -0
  18. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/config.py +102 -0
  19. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/embeddings.py +81 -0
  20. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/engine.py +129 -0
  21. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/graph.py +112 -0
  22. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/hybrid.py +39 -0
  23. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/indexing.py +76 -0
  24. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/io.py +61 -0
  25. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/lexical.py +87 -0
  26. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/models.py +43 -0
  27. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/ranking.py +46 -0
  28. veloxs_nexus-2.3.0/embedding-retrieval-intelligence/src/nexus_retrieval/vector_store.py +78 -0
  29. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/__init__.py +16 -0
  30. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/batch.py +72 -0
  31. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/cdc.py +50 -0
  32. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/cli.py +88 -0
  33. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/config.py +64 -0
  34. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/integrity.py +80 -0
  35. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/models.py +47 -0
  36. veloxs_nexus-2.3.0/enterprise-data-pipeline/src/nexus_pipeline/streaming.py +45 -0
  37. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/__init__.py +25 -0
  38. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/api.py +87 -0
  39. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/assistant.py +46 -0
  40. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/auth.py +97 -0
  41. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/channels.py +28 -0
  42. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/cli.py +80 -0
  43. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/config.py +101 -0
  44. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/gateway.py +181 -0
  45. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/models.py +68 -0
  46. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/sdk.py +40 -0
  47. veloxs_nexus-2.3.0/experience-api-engagement/src/nexus_experience/service.py +75 -0
  48. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/__init__.py +16 -0
  49. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/alerts.py +69 -0
  50. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/cli.py +104 -0
  51. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/config.py +82 -0
  52. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/exporters.py +40 -0
  53. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/io.py +41 -0
  54. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/logging.py +47 -0
  55. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/metrics.py +47 -0
  56. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/models.py +87 -0
  57. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/service.py +96 -0
  58. veloxs_nexus-2.3.0/observability-monitoring/src/nexus_observability/traces.py +47 -0
  59. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/__init__.py +18 -0
  60. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/cli.py +70 -0
  61. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/config.py +97 -0
  62. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/engine.py +85 -0
  63. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/io.py +29 -0
  64. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/models.py +46 -0
  65. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/normalization.py +57 -0
  66. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/offtopic.py +41 -0
  67. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/orchestrator.py +84 -0
  68. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/pii.py +77 -0
  69. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/policy.py +77 -0
  70. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/prompt_security.py +40 -0
  71. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/rag.py +93 -0
  72. veloxs_nexus-2.3.0/orchestration-guardrails/src/nexus_guardrails/verification.py +57 -0
  73. veloxs_nexus-2.3.0/pyproject.toml +37 -0
  74. veloxs_nexus-2.3.0/security-governance/src/nexus_security/__init__.py +16 -0
  75. veloxs_nexus-2.3.0/security-governance/src/nexus_security/audit.py +34 -0
  76. veloxs_nexus-2.3.0/security-governance/src/nexus_security/cli.py +91 -0
  77. veloxs_nexus-2.3.0/security-governance/src/nexus_security/config.py +84 -0
  78. veloxs_nexus-2.3.0/security-governance/src/nexus_security/encryption.py +85 -0
  79. veloxs_nexus-2.3.0/security-governance/src/nexus_security/io.py +41 -0
  80. veloxs_nexus-2.3.0/security-governance/src/nexus_security/models.py +58 -0
  81. veloxs_nexus-2.3.0/security-governance/src/nexus_security/observability.py +41 -0
  82. veloxs_nexus-2.3.0/security-governance/src/nexus_security/rbac.py +40 -0
  83. veloxs_nexus-2.3.0/security-governance/src/nexus_security/service.py +65 -0
  84. veloxs_nexus-2.3.0/security-governance/src/nexus_security/tenant.py +30 -0
  85. veloxs_nexus-2.3.0/setup.cfg +4 -0
  86. veloxs_nexus-2.3.0/setup.py +27 -0
  87. veloxs_nexus-2.3.0/src/nexus/__init__.py +65 -0
  88. veloxs_nexus-2.3.0/src/nexus/cli.py +73 -0
  89. veloxs_nexus-2.3.0/src/nexus/client.py +188 -0
  90. veloxs_nexus-2.3.0/src/nexus/config.py +49 -0
  91. veloxs_nexus-2.3.0/src/nexus/database.py +66 -0
  92. veloxs_nexus-2.3.0/src/nexus/models.py +85 -0
  93. veloxs_nexus-2.3.0/src/nexus/platform.py +138 -0
  94. veloxs_nexus-2.3.0/veloxs_nexus.egg-info/PKG-INFO +153 -0
  95. veloxs_nexus-2.3.0/veloxs_nexus.egg-info/SOURCES.txt +96 -0
  96. veloxs_nexus-2.3.0/veloxs_nexus.egg-info/dependency_links.txt +1 -0
  97. veloxs_nexus-2.3.0/veloxs_nexus.egg-info/requires.txt +12 -0
  98. veloxs_nexus-2.3.0/veloxs_nexus.egg-info/top_level.txt +1 -0
@@ -0,0 +1,75 @@
1
+ Nexus — Proprietary Software License
2
+ Copyright 2026 Veloxs AI Inc. All rights reserved.
3
+
4
+ IMPORTANT — READ CAREFULLY. This is a legal agreement between you ("Licensee")
5
+ and Veloxs AI Inc. ("Veloxs"). By accessing, installing, copying, or otherwise
6
+ using the Nexus software and any associated documentation, data, models, and
7
+ materials (collectively, the "Software"), you agree to be bound by the terms of
8
+ this License. If you do not agree, you must not access or use the Software.
9
+
10
+ 1. OWNERSHIP
11
+ The Software is the confidential and proprietary property of Veloxs AI Inc.
12
+ and is protected by copyright, trade secret, and other intellectual property
13
+ laws. Veloxs retains all right, title, and interest in and to the Software,
14
+ including all intellectual property rights therein. No title to or ownership
15
+ of the Software is transferred to Licensee. All rights not expressly granted
16
+ are reserved by Veloxs.
17
+
18
+ 2. LICENSE GRANT
19
+ Subject to the terms of this License and any separate written agreement
20
+ executed between Licensee and Veloxs (including any pilot, evaluation, or
21
+ commercial subscription agreement, an "Order"), Veloxs grants Licensee a
22
+ limited, non-exclusive, non-transferable, non-sublicensable, revocable
23
+ license to use the Software solely for Licensee's internal business purposes
24
+ and only as permitted by the applicable Order. Absent an Order, no license
25
+ to use the Software is granted.
26
+
27
+ 3. RESTRICTIONS
28
+ Except as expressly permitted by an Order or by applicable law that cannot be
29
+ contractually waived, Licensee shall not, and shall not permit any third
30
+ party to: (a) copy, modify, or create derivative works of the Software;
31
+ (b) distribute, sell, sublicense, rent, lease, lend, or otherwise make the
32
+ Software available to any third party; (c) reverse engineer, decompile, or
33
+ disassemble the Software, or attempt to derive its source code; (d) remove,
34
+ alter, or obscure any proprietary notices; or (e) use the Software to build a
35
+ competing product or service.
36
+
37
+ 4. CONFIDENTIALITY
38
+ The Software and its source code constitute the confidential information and
39
+ trade secrets of Veloxs. Licensee shall protect the Software from
40
+ unauthorized use or disclosure using at least the same degree of care it uses
41
+ to protect its own confidential information of like importance, and in no
42
+ event less than a reasonable degree of care.
43
+
44
+ 5. THIRD-PARTY COMPONENTS
45
+ The Software incorporates third-party open-source components, each of which
46
+ remains subject to its own license. See the NOTICE file for attributions and
47
+ applicable terms. Nothing in this License limits Licensee's rights, or
48
+ Veloxs's obligations, under those third-party licenses.
49
+
50
+ 6. TERMINATION
51
+ This License is effective until terminated. It terminates automatically if
52
+ Licensee breaches any term. Upon termination, Licensee must cease all use of
53
+ the Software and destroy all copies in its possession or control.
54
+
55
+ 7. DISCLAIMER OF WARRANTY
56
+ THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
57
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
58
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
59
+ NON-INFRINGEMENT.
60
+
61
+ 8. LIMITATION OF LIABILITY
62
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL VELOXS BE LIABLE
63
+ FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR
64
+ ANY LOSS OF PROFITS, REVENUE, DATA, OR USE, ARISING OUT OF OR RELATED TO THIS
65
+ LICENSE OR THE SOFTWARE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, EVEN IF
66
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
67
+
68
+ 9. GENERAL
69
+ This License is governed by the laws of the jurisdiction in which Veloxs AI
70
+ Inc. is incorporated, without regard to conflict-of-laws principles. If any
71
+ provision is held unenforceable, the remaining provisions remain in effect.
72
+ This License, together with any applicable Order, is the entire agreement
73
+ between the parties regarding the Software.
74
+
75
+ For licensing inquiries, contact: legal@veloxs.ai
@@ -0,0 +1,30 @@
1
+ Nexus
2
+ Copyright 2026 Veloxs AI Inc.
3
+
4
+ This product includes software developed by Veloxs AI Inc. and the Nexus
5
+ project contributors. See the project's git history for the list of
6
+ individual contributors.
7
+
8
+ This software is proprietary and confidential. It is licensed, not sold,
9
+ under the terms of the Nexus Proprietary Software License (see the LICENSE
10
+ file). Unauthorized copying, distribution, modification, or use is strictly
11
+ prohibited. All rights reserved.
12
+
13
+ -------------------------------------------------------------------------------
14
+
15
+ This product depends on the following third-party libraries. Each
16
+ dependency retains its own license; see the dependency's distribution for
17
+ full terms.
18
+
19
+ - pydantic (MIT) https://github.com/pydantic/pydantic
20
+ - pyyaml (MIT) https://github.com/yaml/pyyaml
21
+ - typer (MIT) https://github.com/tiangolo/typer
22
+ - httpx (BSD-3) https://github.com/encode/httpx
23
+ - cryptography (Apache-2.0 / BSD-3)
24
+ https://github.com/pyca/cryptography
25
+ - fastapi (MIT, optional, [api])
26
+ https://github.com/tiangolo/fastapi
27
+ - uvicorn (BSD-3, optional, [api])
28
+ https://github.com/encode/uvicorn
29
+ - pytest (MIT, dev) https://github.com/pytest-dev/pytest
30
+ - ruff (MIT, dev) https://github.com/astral-sh/ruff
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: veloxs-nexus
3
+ Version: 2.3.0
4
+ Summary: A headless, layered data intelligence, PII sanitization, and 3072D vector projection engine.
5
+ Classifier: Development Status :: 5 - Production/Stable
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Programming Language :: Python :: 3.11
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ License-File: NOTICE
14
+ Requires-Dist: pydantic>=2.7.0
15
+ Requires-Dist: cryptography>=42.0.0
16
+ Requires-Dist: fastapi>=0.110.0
17
+ Requires-Dist: uvicorn>=0.28.0
18
+ Provides-Extra: postgres
19
+ Requires-Dist: pgvector>=0.2.5; extra == "postgres"
20
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "postgres"
21
+ Requires-Dist: sqlalchemy>=2.0.0; extra == "postgres"
22
+ Provides-Extra: yaml
23
+ Requires-Dist: pyyaml>=6.0.1; extra == "yaml"
24
+ Dynamic: license-file
25
+
26
+ # 🏛️ Nexus Enterprise AI (`veloxs-nexus`)
27
+
28
+ [![PyPI Version](https://img.shields.io/badge/pypi-v2.3.0-blue.svg)](https://pypi.org/project/veloxs-nexus/)
29
+ [![Python Versions](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg)](https://pypi.org/)
30
+ [![License: Proprietary](https://img.shields.io/badge/license-Veloxs--AI--Proprietary-red.svg)](LICENSE)
31
+ [![Vector Dimension](https://img.shields.io/badge/vector-3072D-green.svg)](#-vector-and-chunking-specification)
32
+ [![Concurrency](https://img.shields.io/badge/thread--safety-threading.Lock-brightgreen.svg)](#)
33
+
34
+ A high-performance, headless, layered data intelligence, format-aware chunking, PII sanitization, and **3072-dimensional vector projection** engine for enterprise AI applications.
35
+
36
+ ---
37
+
38
+ ## 📦 Installation
39
+
40
+ ```bash
41
+ # Standard in-memory installation
42
+ pip install veloxs-nexus
43
+
44
+ # With PostgreSQL + pgvector support
45
+ pip install veloxs-nexus[postgres]
46
+
47
+ # With YAML configuration support
48
+ pip install veloxs-nexus[yaml]
49
+ ```
50
+
51
+ ---
52
+
53
+ ## ⚡ Quick Start (`import nexus`)
54
+
55
+ ```python
56
+ import nexus
57
+
58
+ # 1. Initialize client in pure in-memory mode (zero disk I/O, serverless safe)
59
+ client = nexus.NexusClient(tenant_id="org-acme", in_memory_only=True)
60
+
61
+ # 2. Process tabular CSV, JSON, Markdown, or Text into 3072D vectors + PII-masked chunks
62
+ doc = client.process_document(
63
+ document_id="doc-001",
64
+ name="department_budgets.csv",
65
+ text="""department,quarter,budget_usd,status
66
+ Engineering,Q3 2025,1250000,Completed
67
+ Security,Q3 2025,350000,Completed""",
68
+ file_type="csv"
69
+ )
70
+
71
+ print(f"Total chunks: {len(doc.chunks)}")
72
+ print(f"First chunk text: {doc.chunks[0].text}")
73
+ print(f"Is Tabular: {doc.chunks[0].metadata['is_tabular']}")
74
+ print(f"Embedding length: {len(doc.chunks[0].embedding)}") # 3072 normalized floats
75
+
76
+ # 3. Ingest and execute fail-closed grounded guardrail Q&A
77
+ client.index_document(doc)
78
+ response = client.ask("What is the engineering budget?")
79
+ print(f"Decision: {response.decision}")
80
+ print(f"Answer: {response.answer}")
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 🏛️ Modular Sub-Layer Architecture
86
+
87
+ `veloxs-nexus` exports 7 decoupled sub-layers under the `nexus.*` namespace:
88
+
89
+ | Submodule | Purpose & Capabilities | Example Import |
90
+ |---|---|---|
91
+ | **`nexus.client`** | Top-level in-memory orchestrator | `from nexus import NexusClient` |
92
+ | **`nexus.processing`** | Format-aware chunking (CSV, JSON, Markdown) & FPE PAN tokenizers | `from nexus.processing.engine import ProcessingEngine` |
93
+ | **`nexus.retrieval`** | 3072D multi-gram embedding, hybrid RRF search, and knowledge graph | `from nexus.retrieval.engine import RetrievalEngine` |
94
+ | **`nexus.guardrails`** | Luhn credit card & PII masking, prompt injection defense, grounded RAG | `from nexus.guardrails.engine import GuardrailsEngine` |
95
+ | **`nexus.security`** | Multi-tenant RBAC, Fernet symmetric encryption & HKDF dynamic salting | `from nexus.security.encryption import encrypt_text` |
96
+ | **`nexus.experience`** | REST API service, assistant sessions, channel adapters | `from nexus.experience.service import ExperienceService` |
97
+ | **`nexus.pipeline`** | Batch file ingestion, API connectors, and CDC change data capture | `from nexus.pipeline.batch import run_batch_job` |
98
+ | **`nexus.observability`** | Distributed trace spans, latency metrics, and error alerting | `from nexus.observability.service import ObservabilityService` |
99
+ | **`nexus.database`** | PostgreSQL `pgvector` DDL schema and SQLAlchemy column types | `from nexus.database import PGVECTOR_DDL_SCHEMA` |
100
+
101
+ ---
102
+
103
+ ## 🗄️ PostgreSQL + pgvector Schema
104
+
105
+ For production database persistence, use the provided schema:
106
+
107
+ ```sql
108
+ CREATE EXTENSION IF NOT EXISTS vector;
109
+ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
110
+
111
+ CREATE TABLE knowledge_documents (
112
+ document_id VARCHAR(128) PRIMARY KEY,
113
+ name VARCHAR(255) NOT NULL,
114
+ file_type VARCHAR(32) NOT NULL,
115
+ file_size_bytes BIGINT NOT NULL,
116
+ content_hash VARCHAR(64) NOT NULL,
117
+ classification VARCHAR(64) DEFAULT 'general',
118
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
119
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
120
+ );
121
+
122
+ CREATE TABLE knowledge_chunks (
123
+ chunk_id VARCHAR(128) PRIMARY KEY,
124
+ document_id VARCHAR(128) NOT NULL REFERENCES knowledge_documents(document_id) ON DELETE CASCADE,
125
+ source_job VARCHAR(64) NOT NULL,
126
+ chunk_index INTEGER NOT NULL,
127
+ chunk_text TEXT NOT NULL,
128
+ metadata JSONB DEFAULT '{}'::jsonb,
129
+ embedding VECTOR(3072) NOT NULL,
130
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
131
+ );
132
+
133
+ CREATE INDEX idx_knowledge_chunks_embedding_hnsw
134
+ ON knowledge_chunks
135
+ USING hnsw (embedding vector_cosine_ops)
136
+ WITH (m = 16, ef_construction = 64);
137
+ ```
138
+
139
+ ---
140
+
141
+ ## 🔐 Multi-Tenant Cryptographic Isolation
142
+
143
+ Each tenant's encryption and tokenization uses dynamic salt derivation:
144
+ 38524\text{salt} = \text{HKDF-SHA256}(\text{"nexus-salt-"} \parallel \text{tenant\_id} \parallel \text{"-"} \parallel \text{key\_id})38524
145
+
146
+ This guarantees that two different tenants processing the same sensitive data produce cryptographically distinct ciphertexts.
147
+
148
+ ---
149
+
150
+ ## 📄 License
151
+
152
+ Proprietary and confidential software. Copyright © 2026 Veloxs AI Inc. All rights reserved.
153
+ See [LICENSE](LICENSE) for license terms.
@@ -0,0 +1,128 @@
1
+ # 🏛️ Nexus Enterprise AI (`veloxs-nexus`)
2
+
3
+ [![PyPI Version](https://img.shields.io/badge/pypi-v2.3.0-blue.svg)](https://pypi.org/project/veloxs-nexus/)
4
+ [![Python Versions](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg)](https://pypi.org/)
5
+ [![License: Proprietary](https://img.shields.io/badge/license-Veloxs--AI--Proprietary-red.svg)](LICENSE)
6
+ [![Vector Dimension](https://img.shields.io/badge/vector-3072D-green.svg)](#-vector-and-chunking-specification)
7
+ [![Concurrency](https://img.shields.io/badge/thread--safety-threading.Lock-brightgreen.svg)](#)
8
+
9
+ A high-performance, headless, layered data intelligence, format-aware chunking, PII sanitization, and **3072-dimensional vector projection** engine for enterprise AI applications.
10
+
11
+ ---
12
+
13
+ ## 📦 Installation
14
+
15
+ ```bash
16
+ # Standard in-memory installation
17
+ pip install veloxs-nexus
18
+
19
+ # With PostgreSQL + pgvector support
20
+ pip install veloxs-nexus[postgres]
21
+
22
+ # With YAML configuration support
23
+ pip install veloxs-nexus[yaml]
24
+ ```
25
+
26
+ ---
27
+
28
+ ## ⚡ Quick Start (`import nexus`)
29
+
30
+ ```python
31
+ import nexus
32
+
33
+ # 1. Initialize client in pure in-memory mode (zero disk I/O, serverless safe)
34
+ client = nexus.NexusClient(tenant_id="org-acme", in_memory_only=True)
35
+
36
+ # 2. Process tabular CSV, JSON, Markdown, or Text into 3072D vectors + PII-masked chunks
37
+ doc = client.process_document(
38
+ document_id="doc-001",
39
+ name="department_budgets.csv",
40
+ text="""department,quarter,budget_usd,status
41
+ Engineering,Q3 2025,1250000,Completed
42
+ Security,Q3 2025,350000,Completed""",
43
+ file_type="csv"
44
+ )
45
+
46
+ print(f"Total chunks: {len(doc.chunks)}")
47
+ print(f"First chunk text: {doc.chunks[0].text}")
48
+ print(f"Is Tabular: {doc.chunks[0].metadata['is_tabular']}")
49
+ print(f"Embedding length: {len(doc.chunks[0].embedding)}") # 3072 normalized floats
50
+
51
+ # 3. Ingest and execute fail-closed grounded guardrail Q&A
52
+ client.index_document(doc)
53
+ response = client.ask("What is the engineering budget?")
54
+ print(f"Decision: {response.decision}")
55
+ print(f"Answer: {response.answer}")
56
+ ```
57
+
58
+ ---
59
+
60
+ ## 🏛️ Modular Sub-Layer Architecture
61
+
62
+ `veloxs-nexus` exports 7 decoupled sub-layers under the `nexus.*` namespace:
63
+
64
+ | Submodule | Purpose & Capabilities | Example Import |
65
+ |---|---|---|
66
+ | **`nexus.client`** | Top-level in-memory orchestrator | `from nexus import NexusClient` |
67
+ | **`nexus.processing`** | Format-aware chunking (CSV, JSON, Markdown) & FPE PAN tokenizers | `from nexus.processing.engine import ProcessingEngine` |
68
+ | **`nexus.retrieval`** | 3072D multi-gram embedding, hybrid RRF search, and knowledge graph | `from nexus.retrieval.engine import RetrievalEngine` |
69
+ | **`nexus.guardrails`** | Luhn credit card & PII masking, prompt injection defense, grounded RAG | `from nexus.guardrails.engine import GuardrailsEngine` |
70
+ | **`nexus.security`** | Multi-tenant RBAC, Fernet symmetric encryption & HKDF dynamic salting | `from nexus.security.encryption import encrypt_text` |
71
+ | **`nexus.experience`** | REST API service, assistant sessions, channel adapters | `from nexus.experience.service import ExperienceService` |
72
+ | **`nexus.pipeline`** | Batch file ingestion, API connectors, and CDC change data capture | `from nexus.pipeline.batch import run_batch_job` |
73
+ | **`nexus.observability`** | Distributed trace spans, latency metrics, and error alerting | `from nexus.observability.service import ObservabilityService` |
74
+ | **`nexus.database`** | PostgreSQL `pgvector` DDL schema and SQLAlchemy column types | `from nexus.database import PGVECTOR_DDL_SCHEMA` |
75
+
76
+ ---
77
+
78
+ ## 🗄️ PostgreSQL + pgvector Schema
79
+
80
+ For production database persistence, use the provided schema:
81
+
82
+ ```sql
83
+ CREATE EXTENSION IF NOT EXISTS vector;
84
+ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
85
+
86
+ CREATE TABLE knowledge_documents (
87
+ document_id VARCHAR(128) PRIMARY KEY,
88
+ name VARCHAR(255) NOT NULL,
89
+ file_type VARCHAR(32) NOT NULL,
90
+ file_size_bytes BIGINT NOT NULL,
91
+ content_hash VARCHAR(64) NOT NULL,
92
+ classification VARCHAR(64) DEFAULT 'general',
93
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
94
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
95
+ );
96
+
97
+ CREATE TABLE knowledge_chunks (
98
+ chunk_id VARCHAR(128) PRIMARY KEY,
99
+ document_id VARCHAR(128) NOT NULL REFERENCES knowledge_documents(document_id) ON DELETE CASCADE,
100
+ source_job VARCHAR(64) NOT NULL,
101
+ chunk_index INTEGER NOT NULL,
102
+ chunk_text TEXT NOT NULL,
103
+ metadata JSONB DEFAULT '{}'::jsonb,
104
+ embedding VECTOR(3072) NOT NULL,
105
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
106
+ );
107
+
108
+ CREATE INDEX idx_knowledge_chunks_embedding_hnsw
109
+ ON knowledge_chunks
110
+ USING hnsw (embedding vector_cosine_ops)
111
+ WITH (m = 16, ef_construction = 64);
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 🔐 Multi-Tenant Cryptographic Isolation
117
+
118
+ Each tenant's encryption and tokenization uses dynamic salt derivation:
119
+ 38524\text{salt} = \text{HKDF-SHA256}(\text{"nexus-salt-"} \parallel \text{tenant\_id} \parallel \text{"-"} \parallel \text{key\_id})38524
120
+
121
+ This guarantees that two different tenants processing the same sensitive data produce cryptographically distinct ciphertexts.
122
+
123
+ ---
124
+
125
+ ## 📄 License
126
+
127
+ Proprietary and confidential software. Copyright © 2026 Veloxs AI Inc. All rights reserved.
128
+ See [LICENSE](LICENSE) for license terms.
@@ -0,0 +1,17 @@
1
+ # Copyright 2026 Veloxs AI Inc. All rights reserved.
2
+ #
3
+ # This file is part of Nexus, proprietary and confidential software of
4
+ # Veloxs AI Inc. Use is subject to the Nexus Proprietary Software License;
5
+ # see the LICENSE file in the project root. Unauthorized copying,
6
+ # distribution, or modification of this file, via any medium, is strictly
7
+ # prohibited.
8
+ #
9
+ # SPDX-License-Identifier: LicenseRef-Veloxs-AI-Proprietary
10
+
11
+ """Data processing and enrichment package."""
12
+
13
+ from .engine import ProcessingEngine
14
+
15
+ __all__ = ["__version__", "ProcessingEngine"]
16
+
17
+ __version__ = "0.1.0"
@@ -0,0 +1,162 @@
1
+ # Copyright 2026 Veloxs AI Inc. All rights reserved.
2
+ #
3
+ # This file is part of Nexus, proprietary and confidential software of
4
+ # Veloxs AI Inc. Use is subject to the Nexus Proprietary Software License;
5
+ # see the LICENSE file in the project root. Unauthorized copying,
6
+ # distribution, or modification of this file, via any medium, is strictly
7
+ # prohibited.
8
+ #
9
+ # SPDX-License-Identifier: LicenseRef-Veloxs-AI-Proprietary
10
+
11
+ from __future__ import annotations
12
+
13
+ import csv
14
+ import io
15
+ import json
16
+ import re
17
+
18
+
19
+ def chunk_csv(csv_str: str) -> list[str]:
20
+ """Transforms tabular CSV matrix rows into rich contextual narratives with explicit Row IDs."""
21
+ chunks: list[str] = []
22
+ try:
23
+ lines = [line for line in csv_str.strip().splitlines() if line.strip()]
24
+ if not lines:
25
+ return []
26
+ start_idx = 0
27
+ for idx, line in enumerate(lines):
28
+ if "," in line:
29
+ start_idx = idx
30
+ break
31
+ clean_csv = "\n".join(lines[start_idx:])
32
+ reader = csv.DictReader(io.StringIO(clean_csv))
33
+ for row_idx, row in enumerate(reader, start=1):
34
+ row_items = [f"{k.strip()}: {v.strip()}" for k, v in row.items() if k and v is not None]
35
+ if row_items:
36
+ narrative = f"[Row ID: {row_idx}] " + " | ".join(row_items)
37
+ chunks.append(narrative)
38
+ except Exception:
39
+ pass
40
+ return chunks if chunks else chunk_smart_text(csv_str)
41
+
42
+
43
+ def chunk_json(json_str: str) -> list[str]:
44
+ """Parses structural JSON payloads and extracts discrete, readable object/array records."""
45
+ try:
46
+ cleaned = json_str.strip()
47
+ if cleaned.startswith("```"):
48
+ cleaned = re.sub(r"^```(?:json)?\s*", "", cleaned)
49
+ cleaned = re.sub(r"\s*```$", "", cleaned)
50
+ start_arr = cleaned.find("[")
51
+ end_arr = cleaned.rfind("]")
52
+ start_obj = cleaned.find("{")
53
+ end_obj = cleaned.rfind("}")
54
+
55
+ if start_arr != -1 and end_arr != -1 and (start_obj == -1 or start_arr < start_obj):
56
+ json_payload = cleaned[start_arr : end_arr + 1]
57
+ elif start_obj != -1 and end_obj != -1:
58
+ json_payload = cleaned[start_obj : end_obj + 1]
59
+ else:
60
+ json_payload = cleaned
61
+
62
+ data = json.loads(json_payload)
63
+ chunks: list[str] = []
64
+ if isinstance(data, list):
65
+ for item in data:
66
+ chunks.append(json.dumps(item, indent=2))
67
+ elif isinstance(data, dict):
68
+ chunks.append(json.dumps(data, indent=2))
69
+ return chunks if chunks else [json_str]
70
+ except Exception:
71
+ return chunk_smart_text(json_str)
72
+
73
+
74
+ def chunk_smart_text(text: str, chunk_size: int = 1000, chunk_overlap: int = 200) -> list[str]:
75
+ """Intelligently split text on paragraph and sentence boundaries with configurable character overlap."""
76
+ chunks: list[str] = []
77
+ remaining_text = text.strip()
78
+ if not remaining_text:
79
+ return []
80
+
81
+ while len(remaining_text) > 0:
82
+ if len(remaining_text) <= chunk_size:
83
+ if remaining_text.strip():
84
+ chunks.append(remaining_text.strip())
85
+ break
86
+
87
+ # Priority 1: Double newline (paragraph boundary)
88
+ split_point = remaining_text.rfind("\n\n", 0, chunk_size)
89
+ # Priority 2: Sentence period followed by space
90
+ if split_point == -1 or split_point < chunk_size * 0.4:
91
+ split_point = remaining_text.rfind(". ", 0, chunk_size)
92
+ if split_point != -1:
93
+ split_point += 1
94
+ # Priority 3: Word space
95
+ if split_point == -1 or split_point < chunk_size * 0.4:
96
+ split_point = remaining_text.rfind(" ", 0, chunk_size)
97
+ # Fallback: Hard character cutoff
98
+ if split_point == -1 or split_point < chunk_size * 0.4:
99
+ split_point = chunk_size
100
+
101
+ chunk = remaining_text[:split_point].strip()
102
+ if chunk:
103
+ chunks.append(chunk)
104
+
105
+ next_start = max(0, split_point - chunk_overlap)
106
+ remaining_text = remaining_text[next_start:].strip()
107
+
108
+ return chunks
109
+
110
+
111
+ def chunk_words(text: str, max_tokens: int, overlap_tokens: int) -> list[str]:
112
+ """Word-based sliding window chunking with preserved token overlap."""
113
+ tokens = text.split()
114
+ if not tokens:
115
+ return []
116
+ if len(tokens) <= max_tokens:
117
+ return [" ".join(tokens)]
118
+
119
+ chunks: list[str] = []
120
+ start = 0
121
+ step = max_tokens - overlap_tokens
122
+ if step <= 0:
123
+ step = 1
124
+
125
+ while start < len(tokens):
126
+ end = min(start + max_tokens, len(tokens))
127
+ chunks.append(" ".join(tokens[start:end]))
128
+ if end == len(tokens):
129
+ break
130
+ start += step
131
+ return chunks
132
+
133
+
134
+ def chunk_text(text: str, max_tokens: int = 1000, overlap_tokens: int = 200) -> list[str]:
135
+ """Universal format-aware chunking router.
136
+
137
+ Automatically detects CSV, JSON, and document text to apply optimal chunking strategy.
138
+ """
139
+ stripped = text.strip()
140
+ if not stripped:
141
+ return []
142
+
143
+ # Detect JSON
144
+ if (stripped.startswith("{") and stripped.endswith("}")) or (stripped.startswith("[") and stripped.endswith("]")):
145
+ try:
146
+ json.loads(stripped)
147
+ return chunk_json(stripped)
148
+ except Exception:
149
+ pass
150
+
151
+ # Detect CSV (has commas, newlines, and consistent columns)
152
+ lines = [l for l in stripped.splitlines() if l.strip()]
153
+ if len(lines) >= 2 and all("," in l for l in lines[:5]):
154
+ try:
155
+ reader = list(csv.reader(lines[:5]))
156
+ if len(reader) >= 2 and len(reader[0]) > 1 and all(len(r) == len(reader[0]) for r in reader):
157
+ return chunk_csv(stripped)
158
+ except Exception:
159
+ pass
160
+
161
+ # Standard word-based chunking with overlap
162
+ return chunk_words(text, max_tokens=max_tokens, overlap_tokens=overlap_tokens)
@@ -0,0 +1,62 @@
1
+ # Copyright 2026 Veloxs AI Inc. All rights reserved.
2
+ #
3
+ # This file is part of Nexus, proprietary and confidential software of
4
+ # Veloxs AI Inc. Use is subject to the Nexus Proprietary Software License;
5
+ # see the LICENSE file in the project root. Unauthorized copying,
6
+ # distribution, or modification of this file, via any medium, is strictly
7
+ # prohibited.
8
+ #
9
+ # SPDX-License-Identifier: LicenseRef-Veloxs-AI-Proprietary
10
+
11
+ from __future__ import annotations
12
+
13
+ import argparse
14
+ from pathlib import Path
15
+
16
+ from .config import load_config
17
+ from .pipeline import hydrate_job_defaults, run_all as run_all_jobs
18
+ from .pipeline import run_job as run_single_job
19
+
20
+
21
+ def build_parser() -> argparse.ArgumentParser:
22
+ parser = argparse.ArgumentParser(
23
+ prog="processing", description="Data processing and enrichment control plane."
24
+ )
25
+ commands = parser.add_subparsers(dest="command", required=True)
26
+
27
+ validate_config = commands.add_parser("validate-config", help="Load and validate a processing config.")
28
+ validate_config.add_argument("config_path", type=Path)
29
+
30
+ run_job = commands.add_parser("run-job", help="Run a single processing job.")
31
+ run_job.add_argument("config_path", type=Path)
32
+ run_job.add_argument("job")
33
+
34
+ run_all = commands.add_parser("run-all", help="Run every processing job.")
35
+ run_all.add_argument("config_path", type=Path)
36
+
37
+ return parser
38
+
39
+
40
+ def main(argv: list[str] | None = None) -> int:
41
+ args = build_parser().parse_args(argv)
42
+ config = hydrate_job_defaults(load_config(args.config_path))
43
+
44
+ if args.command == "validate-config":
45
+ print(f"Loaded {len(config.jobs)} processing jobs.")
46
+ elif args.command == "run-job":
47
+ count = run_single_job(config, args.job, args.config_path.parent.parent)
48
+ print(f"Processed {count} outputs for {args.job}.")
49
+ elif args.command == "run-all":
50
+ counts = run_all_jobs(config, args.config_path.parent.parent)
51
+ for job, count in counts.items():
52
+ print(f"Processed {count} outputs for {job}.")
53
+ return 0
54
+
55
+
56
+ def app() -> None:
57
+ """Console-script entry point (kept for the `nexus_processing.cli:app` script target)."""
58
+ raise SystemExit(main())
59
+
60
+
61
+ if __name__ == "__main__":
62
+ raise SystemExit(main())