analyxa 0.1.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 (59) hide show
  1. analyxa-0.1.0/.gitignore +11 -0
  2. analyxa-0.1.0/CLAUDE.md +131 -0
  3. analyxa-0.1.0/LICENSE +191 -0
  4. analyxa-0.1.0/PKG-INFO +242 -0
  5. analyxa-0.1.0/README.md +210 -0
  6. analyxa-0.1.0/docker/docker-compose.yaml +26 -0
  7. analyxa-0.1.0/examples/conversations/coaching_crisis.txt +16 -0
  8. analyxa-0.1.0/examples/conversations/coaching_progress.txt +13 -0
  9. analyxa-0.1.0/examples/conversations/sales_demo.txt +13 -0
  10. analyxa-0.1.0/examples/conversations/sales_objection.txt +13 -0
  11. analyxa-0.1.0/examples/conversations/support_billing.txt +12 -0
  12. analyxa-0.1.0/examples/conversations/support_cancellation.txt +11 -0
  13. analyxa-0.1.0/examples/conversations/universal_greeting.txt +10 -0
  14. analyxa-0.1.0/examples/conversations/universal_technical.txt +9 -0
  15. analyxa-0.1.0/examples/results/dogfood_report.json +5 -0
  16. analyxa-0.1.0/memory/ANALYXA-BLUEPRINT.md +128 -0
  17. analyxa-0.1.0/memory/ANALYXA-CHANGELOG.md +308 -0
  18. analyxa-0.1.0/memory/ANALYXA-DECISIONS.md +155 -0
  19. analyxa-0.1.0/memory/ANALYXA-STATE.md +77 -0
  20. analyxa-0.1.0/memory/CLAUDE.md +131 -0
  21. analyxa-0.1.0/pyproject.toml +58 -0
  22. analyxa-0.1.0/scripts/dogfood.py +324 -0
  23. analyxa-0.1.0/setup.cfg +4 -0
  24. analyxa-0.1.0/src/analyxa/__init__.py +8 -0
  25. analyxa-0.1.0/src/analyxa/analyzer.py +183 -0
  26. analyxa-0.1.0/src/analyxa/batch.py +185 -0
  27. analyxa-0.1.0/src/analyxa/cli.py +367 -0
  28. analyxa-0.1.0/src/analyxa/config.py +149 -0
  29. analyxa-0.1.0/src/analyxa/embeddings.py +71 -0
  30. analyxa-0.1.0/src/analyxa/llm_client.py +229 -0
  31. analyxa-0.1.0/src/analyxa/prompt_builder.py +165 -0
  32. analyxa-0.1.0/src/analyxa/schema.py +155 -0
  33. analyxa-0.1.0/src/analyxa/schemas/coaching.yaml +165 -0
  34. analyxa-0.1.0/src/analyxa/schemas/sales.yaml +100 -0
  35. analyxa-0.1.0/src/analyxa/schemas/support.yaml +81 -0
  36. analyxa-0.1.0/src/analyxa/schemas/universal.yaml +153 -0
  37. analyxa-0.1.0/src/analyxa/sinks/__init__.py +0 -0
  38. analyxa-0.1.0/src/analyxa/sinks/json_sink.py +20 -0
  39. analyxa-0.1.0/src/analyxa/sinks/qdrant_sink.py +173 -0
  40. analyxa-0.1.0/src/analyxa/sinks/stdout_sink.py +11 -0
  41. analyxa-0.1.0/src/analyxa/sources/__init__.py +0 -0
  42. analyxa-0.1.0/src/analyxa/sources/file_source.py +47 -0
  43. analyxa-0.1.0/src/analyxa/sources/redis_source.py +158 -0
  44. analyxa-0.1.0/src/analyxa.egg-info/PKG-INFO +242 -0
  45. analyxa-0.1.0/src/analyxa.egg-info/SOURCES.txt +57 -0
  46. analyxa-0.1.0/src/analyxa.egg-info/dependency_links.txt +1 -0
  47. analyxa-0.1.0/src/analyxa.egg-info/entry_points.txt +2 -0
  48. analyxa-0.1.0/src/analyxa.egg-info/requires.txt +11 -0
  49. analyxa-0.1.0/src/analyxa.egg-info/top_level.txt +1 -0
  50. analyxa-0.1.0/tests/test_analyzer.py +377 -0
  51. analyxa-0.1.0/tests/test_batch.py +161 -0
  52. analyxa-0.1.0/tests/test_cli.py +187 -0
  53. analyxa-0.1.0/tests/test_config.py +111 -0
  54. analyxa-0.1.0/tests/test_llm_client.py +267 -0
  55. analyxa-0.1.0/tests/test_multi_vertical.py +235 -0
  56. analyxa-0.1.0/tests/test_prompt_builder.py +143 -0
  57. analyxa-0.1.0/tests/test_qdrant_sink.py +211 -0
  58. analyxa-0.1.0/tests/test_redis_source.py +162 -0
  59. analyxa-0.1.0/tests/test_schema.py +152 -0
@@ -0,0 +1,11 @@
1
+ .env
2
+ .venv/
3
+ __pycache__/
4
+ *.pyc
5
+ .pytest_cache/
6
+ *.egg-info/
7
+ dist/
8
+ build/
9
+ .memoria.json
10
+ .memoria-sessions.json
11
+ node_modules/
@@ -0,0 +1,131 @@
1
+ # ANALYXA — Contexto para Claude
2
+
3
+ > Este archivo es la puerta de entrada al proyecto.
4
+ > Cualquier sesión de Claude que trabaje en este proyecto debe leer este archivo primero.
5
+ > Última actualización: 2026-03-12
6
+
7
+ ---
8
+
9
+ ## ¿Qué es Analyxa?
10
+
11
+ Analyxa es un motor de extracción multi-dimensional que convierte conversaciones de agentes de IA en inteligencia estructurada, indexada y consultable. Toma una conversación opaca y la descompone en N dimensiones configurables (sentimiento, intensidad, temas, riesgo, progreso, etc.) almacenadas como vectores semánticos de 1,536 dimensiones.
12
+
13
+ **Dominio:** analyxa.ai
14
+ **Paquete PyPI:** analyxa
15
+ **Licencia:** Apache 2.0 (motor) + Propietario (schemas premium, cloud)
16
+ **Origen:** Genericización de MNEMOS, el motor de análisis clínico de Ishara (plataforma terapéutica IA)
17
+
18
+ ---
19
+
20
+ ## Arquitectura
21
+
22
+ ```
23
+ Conversación → [Source] → [Analyzer] → [LLM + Schema YAML] → [JSON N campos + Vector 1536D] → [Sink]
24
+ ```
25
+
26
+ **Sources:** Redis, archivos, API REST
27
+ **Sinks:** Qdrant, JSON, stdout
28
+ **LLM:** Claude Sonnet (primario), OpenAI GPT-4o (compatible)
29
+ **Embeddings:** OpenAI text-embedding-3-small (1536D)
30
+ **Schemas:** YAML configurables. Universal (10 campos) + Verticales premium
31
+
32
+ ---
33
+
34
+ ## Schema Universal (10 campos base)
35
+
36
+ | # | Campo | Tipo | Descripción |
37
+ |---|-------|------|-------------|
38
+ | 1 | title | string | Nombre corto de la sesión (5-8 palabras) |
39
+ | 2 | summary | string | Resumen 3-5 oraciones. Se vectoriza. |
40
+ | 3 | sentiment | keyword | positive / negative / mixed / neutral |
41
+ | 4 | sentiment_intensity | keyword | low / medium / high |
42
+ | 5 | topics | keyword[] | Temas reales detectados |
43
+ | 6 | session_outcome | keyword | resolved / unresolved / escalated / abandoned |
44
+ | 7 | user_intent | string | Lo que el usuario realmente buscaba |
45
+ | 8 | risk_signals | keyword[] | Señales de alerta |
46
+ | 9 | key_entities | keyword[] | Personas, productos, fechas mencionadas |
47
+ | 10 | action_items | string[] | Compromisos o siguientes pasos |
48
+
49
+ ---
50
+
51
+ ## Verticales Premium
52
+
53
+ - **Soporte:** +6 campos (satisfaction_prediction, issue_category, escalation_needed, resolution_quality, first_contact_resolution, customer_effort_score)
54
+ - **Ventas:** +6 campos (buying_stage, objections, budget_signals, decision_urgency, competitive_mentions, next_best_action)
55
+ - **Coaching:** +8 campos (emotional_valence, emotional_intensity, progress_indicators, behavioral_patterns, growth_markers, therapeutic_momentum, adaptation_level, coping_strategies)
56
+
57
+ ---
58
+
59
+ ## Stack Tecnológico
60
+
61
+ | Componente | Tecnología |
62
+ |-----------|-----------|
63
+ | LLM primario | Claude Sonnet (Anthropic) |
64
+ | Embeddings | OpenAI text-embedding-3-small |
65
+ | Conversaciones | Redis 7 (Docker) |
66
+ | Vectores | Qdrant (Docker) |
67
+ | Lenguaje | Python 3.10+ |
68
+ | CLI | Click |
69
+ | VPS | Contabo 66.94.117.83, Ubuntu 22.04, 8GB RAM |
70
+
71
+ ---
72
+
73
+ ## Estructura del Proyecto
74
+
75
+ ```
76
+ /opt/analyxa/
77
+ ├── memory/ # Artefactos MEMORIA v3.0
78
+ ├── src/analyxa/ # Código fuente
79
+ │ ├── analyzer.py # Orquestador principal
80
+ │ ├── schema.py # Carga y valida schemas YAML
81
+ │ ├── prompt_builder.py
82
+ │ ├── llm_client.py
83
+ │ ├── embeddings.py
84
+ │ ├── config.py
85
+ │ ├── cli.py
86
+ │ ├── batch.py
87
+ │ ├── sources/ # redis_source.py, file_source.py
88
+ │ ├── sinks/ # qdrant_sink.py, json_sink.py, stdout_sink.py
89
+ │ └── schemas/ # universal.yaml, support.yaml, sales.yaml, coaching.yaml
90
+ ├── tests/
91
+ ├── examples/
92
+ ├── docs/
93
+ ├── docker/
94
+ ├── .env
95
+ └── pyproject.toml
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Sistema de Memoria
101
+
102
+ Protocolo MEMORIA v3.0. Los archivos viven en `memory/`:
103
+
104
+ | Archivo | Propósito | Actualización |
105
+ |---------|-----------|---------------|
106
+ | CLAUDE.md | Puerta de entrada | Cuando cambian fundamentos |
107
+ | ANALYXA-STATE.md | Estado actual | Cada IF completada |
108
+ | ANALYXA-BLUEPRINT.md | Plan de fabricación | Cada IF completada |
109
+ | ANALYXA-CHANGELOG.md | Log de cambios | Cada IF completada |
110
+ | ANALYXA-DECISIONS.md | Decisiones (ADR) | Cada decisión importante |
111
+
112
+ ### Protocolo de sesión
113
+
114
+ **Al iniciar:** Leer ANALYXA-STATE.md → verificar consistencia (Gate)
115
+ **Durante:** Diseñar IF según ANALYXA-BLUEPRINT.md
116
+ **Al cerrar:** Verificar que fabricante actualizó memoria
117
+
118
+ ---
119
+
120
+ ## Modelo de Negocio
121
+
122
+ 1. **GitHub Open Source** → Adopción de developers
123
+ 2. **Product Hunt + Content** → Visibilidad
124
+ 3. **Fiverr + Servicios directos** → Ingresos inmediatos ($297-$997)
125
+ 4. **Cloud API SaaS** → Escala ($49-$199/mes)
126
+
127
+ ---
128
+
129
+ ## Estado Actual
130
+
131
+ > **Ver ANALYXA-STATE.md para el estado detallado actualizado.**
analyxa-0.1.0/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 Next AI Ecosystem
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
analyxa-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,242 @@
1
+ Metadata-Version: 2.4
2
+ Name: analyxa
3
+ Version: 0.1.0
4
+ Summary: Multi-dimensional extraction engine for AI conversations
5
+ Author-email: Next AI Ecosystem <nextaiecosystem@gmail.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://analyxa.ai
8
+ Project-URL: Repository, https://github.com/next-ai-ecosystem/analyxa
9
+ Project-URL: Documentation, https://analyxa.ai/docs
10
+ Keywords: ai,conversations,analytics,llm,extraction,nlp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: anthropic>=0.40.0
22
+ Requires-Dist: openai>=1.0.0
23
+ Requires-Dist: click>=8.0.0
24
+ Requires-Dist: python-dotenv>=1.0.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: redis>=5.0.0
27
+ Requires-Dist: qdrant-client>=1.7.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # Analyxa
34
+
35
+ **Multi-dimensional extraction engine for AI conversations.**
36
+
37
+ Analyxa takes opaque conversations between users and AI agents and decomposes them into N configurable dimensions — sentiment, intensity, topics, risk signals, intent, entities, and more — stored as 1,536-dimensional semantic vectors.
38
+
39
+ [![PyPI version](https://badge.fury.io/py/analyxa.svg)](https://pypi.org/project/analyxa/)
40
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
41
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
42
+
43
+ ---
44
+
45
+ ## What it does
46
+
47
+ ```
48
+ Conversation → Analyxa → Structured JSON (N fields) + Semantic Vector (1536D)
49
+ ```
50
+
51
+ One conversation in, structured intelligence out:
52
+
53
+ - **10 universal fields** extracted from any conversation (sentiment, topics, risk signals, intent, entities, action items...)
54
+ - **Vertical schemas** add domain-specific fields: support (16), sales (16), coaching (18)
55
+ - **Semantic vectors** enable similarity search across thousands of conversations
56
+ - **Pipeline ready**: Redis queue → Analyxa → Qdrant vector DB
57
+
58
+ ## Quick Start
59
+
60
+ ### Installation
61
+
62
+ ```bash
63
+ pip install analyxa
64
+ ```
65
+
66
+ ### Python API
67
+
68
+ ```python
69
+ from analyxa import analyze
70
+
71
+ result = analyze(
72
+ "User: I was charged twice for my subscription.\n"
73
+ "Agent: I see the duplicate charge. Processing a refund now.\n"
74
+ "User: Thanks, but please make sure it doesn't happen again.",
75
+ schema="support"
76
+ )
77
+
78
+ print(result.fields["sentiment"]) # "negative"
79
+ print(result.fields["satisfaction_prediction"]) # "dissatisfied"
80
+ print(result.fields["issue_category"]) # "billing"
81
+ print(result.fields["risk_signals"]) # ["frustration", "repeat_contact"]
82
+ ```
83
+
84
+ ### CLI
85
+
86
+ ```bash
87
+ # Analyze a conversation file
88
+ analyxa analyze conversation.txt --schema support --output result.json
89
+
90
+ # List available schemas
91
+ analyxa schemas list
92
+
93
+ # Show schema fields
94
+ analyxa schemas show support
95
+
96
+ # Batch analyze a directory
97
+ analyxa batch ./conversations/ --schema universal --output-dir ./results/
98
+ ```
99
+
100
+ ### Environment Setup
101
+
102
+ Create a `.env` file:
103
+
104
+ ```bash
105
+ ANTHROPIC_API_KEY=sk-ant-... # Required for analysis
106
+ OPENAI_API_KEY=sk-... # Optional, for embeddings
107
+ ANALYXA_PROVIDER=anthropic # or "openai"
108
+ ANALYXA_SCHEMA=universal # Default schema
109
+ ```
110
+
111
+ ## Schemas
112
+
113
+ Analyxa uses YAML schemas to define what to extract. Schemas are hierarchical — vertical schemas inherit all universal fields.
114
+
115
+ | Schema | Fields | Description |
116
+ |--------|--------|-------------|
117
+ | **universal** | 10 | Base fields for any conversation |
118
+ | **support** | 16 | Customer support (+satisfaction, issue category, effort score...) |
119
+ | **sales** | 16 | Sales conversations (+buying stage, objections, budget signals...) |
120
+ | **coaching** | 18 | Coaching/therapeutic (+emotional valence, behavioral patterns, coping strategies...) |
121
+
122
+ ### Universal Fields (included in all schemas)
123
+
124
+ | Field | Type | Description |
125
+ |-------|------|-------------|
126
+ | title | string | Descriptive session name |
127
+ | summary | string | 3-5 sentence summary (vectorized for search) |
128
+ | sentiment | keyword | User sentiment: positive, negative, mixed, neutral |
129
+ | sentiment_intensity | keyword | low, medium, high |
130
+ | topics | keyword_array | Specific topics discussed |
131
+ | session_outcome | keyword | resolved, unresolved, escalated, abandoned |
132
+ | user_intent | string | What the user really needed |
133
+ | risk_signals | keyword_array | frustration, churn_risk, complaint, urgency... |
134
+ | key_entities | keyword_array | People, products, dates, amounts mentioned |
135
+ | action_items | string_array | Explicit commitments or next steps |
136
+
137
+ ### Custom Schemas
138
+
139
+ Create your own schema by inheriting from universal:
140
+
141
+ ```yaml
142
+ metadata:
143
+ name: my_vertical
144
+ version: "1.0"
145
+ description: "Custom schema for my use case"
146
+ inherits: universal
147
+
148
+ fields:
149
+ - name: custom_field
150
+ type: keyword
151
+ required: true
152
+ description: "My custom dimension"
153
+ prompt_hint: "Instructions for the LLM on how to extract this field"
154
+ allowed_values: [option_a, option_b, option_c]
155
+ ```
156
+
157
+ ## Production Pipeline
158
+
159
+ ### Redis → Analyxa → Qdrant
160
+
161
+ ```bash
162
+ # Start infrastructure
163
+ cd docker && docker compose up -d
164
+
165
+ # Push conversations to Redis queue
166
+ analyxa redis push conversation.txt --schema support
167
+
168
+ # Process all pending conversations
169
+ analyxa redis process
170
+
171
+ # Search by semantic similarity
172
+ analyxa search "frustrated customer with billing issue" --limit 5
173
+ ```
174
+
175
+ ### Python Pipeline
176
+
177
+ ```python
178
+ from analyxa.sources.redis_source import RedisSource
179
+ from analyxa.sinks.qdrant_sink import QdrantSink
180
+ from analyxa.batch import batch_analyze_from_redis
181
+
182
+ # Process Redis queue → Qdrant
183
+ result = batch_analyze_from_redis()
184
+ print(f"Processed: {result.successful}/{result.total}")
185
+
186
+ # Search similar conversations
187
+ sink = QdrantSink()
188
+ similar = sink.search_similar(query_embedding, limit=10, filters={"sentiment": "negative"})
189
+ ```
190
+
191
+ ## Configuration
192
+
193
+ All settings via environment variables or `.env` file:
194
+
195
+ | Variable | Default | Description |
196
+ |----------|---------|-------------|
197
+ | ANTHROPIC_API_KEY | — | Anthropic API key |
198
+ | OPENAI_API_KEY | — | OpenAI API key (for embeddings) |
199
+ | ANALYXA_PROVIDER | anthropic | LLM provider: anthropic or openai |
200
+ | ANALYXA_MODEL | (provider default) | Model override |
201
+ | ANALYXA_SCHEMA | universal | Default schema |
202
+ | ANALYXA_EMBEDDINGS | true | Enable/disable embeddings |
203
+ | REDIS_URL | redis://localhost:6379 | Redis connection |
204
+ | QDRANT_URL | http://localhost:6333 | Qdrant connection |
205
+
206
+ ## Architecture
207
+
208
+ ```
209
+ src/analyxa/
210
+ ├── analyzer.py # Pipeline orchestrator
211
+ ├── schema.py # YAML schema loader with inheritance
212
+ ├── prompt_builder.py # Dynamic prompt generation from schemas
213
+ ├── llm_client.py # Multi-provider LLM abstraction
214
+ ├── embeddings.py # Semantic vector generation (1536D)
215
+ ├── config.py # Centralized configuration
216
+ ├── cli.py # Click CLI
217
+ ├── batch.py # Batch processing
218
+ ├── sources/
219
+ │ ├── file_source.py # Read from files
220
+ │ └── redis_source.py # Read from Redis queue
221
+ ├── sinks/
222
+ │ ├── json_sink.py # Write to JSON files
223
+ │ ├── stdout_sink.py # Print to terminal
224
+ │ └── qdrant_sink.py # Store in Qdrant
225
+ └── schemas/
226
+ ├── universal.yaml # 10 base fields
227
+ ├── support.yaml # +6 support fields
228
+ ├── sales.yaml # +6 sales fields
229
+ └── coaching.yaml # +8 coaching fields
230
+ ```
231
+
232
+ ## License
233
+
234
+ Apache 2.0 — see [LICENSE](LICENSE) for details.
235
+
236
+ ## Contributing
237
+
238
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
239
+
240
+ ---
241
+
242
+ Built by [Next AI Ecosystem](https://analyxa.ai)