adaptive-intelligence 4.0.2__tar.gz → 4.0.4__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 (50) hide show
  1. adaptive_intelligence-4.0.4/PKG-INFO +401 -0
  2. adaptive_intelligence-4.0.4/README.md +331 -0
  3. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/__init__.py +1 -1
  4. adaptive_intelligence-4.0.4/adaptive_intelligence.egg-info/PKG-INFO +401 -0
  5. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/pyproject.toml +1 -1
  6. adaptive_intelligence-4.0.2/PKG-INFO +0 -311
  7. adaptive_intelligence-4.0.2/README.md +0 -241
  8. adaptive_intelligence-4.0.2/adaptive_intelligence.egg-info/PKG-INFO +0 -311
  9. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/LICENSE +0 -0
  10. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/agentic/__init__.py +0 -0
  11. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/context/__init__.py +0 -0
  12. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/core/__init__.py +0 -0
  13. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/core/config.py +0 -0
  14. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/core/engine.py +0 -0
  15. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/core/response.py +0 -0
  16. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/evaluation/__init__.py +0 -0
  17. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/graph/__init__.py +0 -0
  18. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/indexes/__init__.py +0 -0
  19. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/indexes/base.py +0 -0
  20. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/indexes/keyword_index.py +0 -0
  21. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/indexes/page_index.py +0 -0
  22. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/indexes/vector_index.py +0 -0
  23. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/ingestion/__init__.py +0 -0
  24. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/ingestion/chunker.py +0 -0
  25. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/ingestion/engine.py +0 -0
  26. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/ingestion/parser.py +0 -0
  27. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/llm/__init__.py +0 -0
  28. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/mcp/__init__.py +0 -0
  29. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/memory/__init__.py +0 -0
  30. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/memory/persistent.py +0 -0
  31. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/prompts/__init__.py +0 -0
  32. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/query/__init__.py +0 -0
  33. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/rl/__init__.py +0 -0
  34. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/rl/multi_query.py +0 -0
  35. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/rl/ppo.py +0 -0
  36. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/rl/pretrained.py +0 -0
  37. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/rl/reranker.py +0 -0
  38. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/security/__init__.py +0 -0
  39. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence/utils/__init__.py +0 -0
  40. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence.egg-info/SOURCES.txt +0 -0
  41. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence.egg-info/dependency_links.txt +0 -0
  42. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence.egg-info/requires.txt +0 -0
  43. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/adaptive_intelligence.egg-info/top_level.txt +0 -0
  44. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/setup.cfg +0 -0
  45. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_core.py +0 -0
  46. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_evaluation.py +0 -0
  47. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_graph.py +0 -0
  48. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_ingestion.py +0 -0
  49. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_query.py +0 -0
  50. {adaptive_intelligence-4.0.2 → adaptive_intelligence-4.0.4}/tests/test_rl.py +0 -0
@@ -0,0 +1,401 @@
1
+ Metadata-Version: 2.4
2
+ Name: adaptive-intelligence
3
+ Version: 4.0.4
4
+ Summary: Self-improving retrieval framework with RL routing, context engineering, MCP integration, agentic workflow, and persistent memory.
5
+ Author-email: Venkatkumar Rajan <venkatkumarr.vk99@gmail.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/VK-Ant/adaptive-intelligence
8
+ Project-URL: Documentation, https://github.com/VK-Ant/adaptive-intelligence#readme
9
+ Project-URL: Repository, https://github.com/VK-Ant/adaptive-intelligence
10
+ Project-URL: Issues, https://github.com/VK-Ant/adaptive-intelligence/issues
11
+ Project-URL: PyPI, https://pypi.org/project/adaptive-intelligence/
12
+ Project-URL: Paper, https://www.researchgate.net/publication/405076088
13
+ Project-URL: Portfolio, https://vk-ant.github.io/Venkatkumar/
14
+ Project-URL: Changelog, https://github.com/VK-Ant/adaptive-intelligence/blob/main/CHANGELOG.md
15
+ Keywords: rag,retrieval,reinforcement-learning,knowledge-graph,document-intelligence,adaptive,self-improving,llm,ai,nlp,evaluation,self-learning,context-engineering,mcp,agentic,memory,tool-use,multi-agent
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: License :: OSI Approved :: Apache Software License
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Provides-Extra: vector
31
+ Requires-Dist: chromadb>=0.4.0; extra == "vector"
32
+ Provides-Extra: openai
33
+ Requires-Dist: openai>=1.0.0; extra == "openai"
34
+ Provides-Extra: huggingface
35
+ Requires-Dist: transformers>=4.35.0; extra == "huggingface"
36
+ Requires-Dist: torch>=2.0.0; extra == "huggingface"
37
+ Provides-Extra: pdf
38
+ Requires-Dist: PyMuPDF>=1.23.0; extra == "pdf"
39
+ Provides-Extra: docx
40
+ Requires-Dist: python-docx>=1.0.0; extra == "docx"
41
+ Provides-Extra: xlsx
42
+ Requires-Dist: openpyxl>=3.1.0; extra == "xlsx"
43
+ Provides-Extra: pptx
44
+ Requires-Dist: python-pptx>=0.6.21; extra == "pptx"
45
+ Provides-Extra: sql
46
+ Requires-Dist: sqlalchemy>=2.0.0; extra == "sql"
47
+ Provides-Extra: rerank
48
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "rerank"
49
+ Provides-Extra: ocr
50
+ Requires-Dist: pytesseract>=0.3.10; extra == "ocr"
51
+ Requires-Dist: Pillow>=10.0; extra == "ocr"
52
+ Provides-Extra: all
53
+ Requires-Dist: chromadb>=0.4.0; extra == "all"
54
+ Requires-Dist: openai>=1.0.0; extra == "all"
55
+ Requires-Dist: transformers>=4.35.0; extra == "all"
56
+ Requires-Dist: torch>=2.0.0; extra == "all"
57
+ Requires-Dist: PyMuPDF>=1.23.0; extra == "all"
58
+ Requires-Dist: python-docx>=1.0.0; extra == "all"
59
+ Requires-Dist: openpyxl>=3.1.0; extra == "all"
60
+ Requires-Dist: python-pptx>=0.6.21; extra == "all"
61
+ Requires-Dist: pytesseract>=0.3.10; extra == "all"
62
+ Requires-Dist: Pillow>=10.0; extra == "all"
63
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
64
+ Provides-Extra: dev
65
+ Requires-Dist: pytest>=7.0; extra == "dev"
66
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
67
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
68
+ Requires-Dist: mypy>=1.5; extra == "dev"
69
+ Dynamic: license-file
70
+
71
+ <div align="center">
72
+
73
+ <img src="https://raw.githubusercontent.com/VK-Ant/adaptive-intelligence/main/docs/images/image_ai.png" alt="adaptive-intelligence" width="100%">
74
+
75
+ # adaptive-intelligence
76
+
77
+ **Self-improving retrieval framework that learns, remembers, and connects tools.**
78
+
79
+ [![PyPI](https://img.shields.io/pypi/v/adaptive-intelligence)](https://pypi.org/project/adaptive-intelligence/)
80
+ [![Python](https://img.shields.io/pypi/pyversions/adaptive-intelligence)](https://pypi.org/project/adaptive-intelligence/)
81
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
82
+ [![Paper](https://img.shields.io/badge/Paper-ResearchGate-00CCBB)](https://www.researchgate.net/publication/405076088)
83
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/adaptive-intelligence/blob/main/notebooks/adaptive_intelligence_v4_demo.ipynb)
84
+
85
+ [PyPI](https://pypi.org/project/adaptive-intelligence/) · [Paper](https://www.researchgate.net/publication/405076088) · [Portfolio](https://vk-ant.github.io/Venkatkumar/) · [llmevalkit](https://pypi.org/project/llmevalkit/)
86
+
87
+ </div>
88
+
89
+ ---
90
+
91
+ ## Why adaptive-intelligence?
92
+
93
+ Every RAG system uses the same retrieval strategy for every query. A revenue lookup gets vector search. A multi-document relationship chain gets the same vector search.
94
+
95
+ adaptive-intelligence fixes this. It uses reinforcement learning to select the best retrieval strategy per query type. The system evaluates every response, uses the score as a reward signal, and improves with every query answered.
96
+
97
+ ```python
98
+ from adaptive_intelligence import AdaptiveAI
99
+
100
+ engine = AdaptiveAI()
101
+ engine.ingest("./documents")
102
+ response = engine.ask("What are the key risks?")
103
+ ```
104
+
105
+ ## Install
106
+
107
+ ```bash
108
+ pip install adaptive-intelligence # Zero deps (Ollama, no-LLM mode)
109
+ pip install adaptive-intelligence[vector] # + ChromaDB vector search
110
+ pip install adaptive-intelligence[openai] # + Any OpenAI-compatible API
111
+ pip install adaptive-intelligence[huggingface] # + Local HuggingFace models
112
+ pip install adaptive-intelligence[all] # Everything
113
+ ```
114
+
115
+ ## Features
116
+
117
+ ### Context Engineering
118
+ Optimizes the entire context window — not just which chunks to retrieve, but what memory to include, how much history to keep, which tool results to add, and how to structure the prompt.
119
+
120
+ ```python
121
+ engine = AdaptiveAI(context_engineering=True)
122
+ ```
123
+
124
+ ### MCP Integration
125
+ Connect external tools. Register MCP servers, REST APIs, or Python functions. The RL policy learns which tools to call per query type.
126
+
127
+ ```python
128
+ engine.add_tool("financial", server="http://localhost:8081")
129
+ engine.add_tool("calculator", function=my_calc_function)
130
+ engine.add_tool("search", api_endpoint="https://api.example.com/search")
131
+
132
+ engine.list_tools()
133
+ engine.remove_tool("search")
134
+
135
+ # Serve your retrieval as an MCP server
136
+ engine.serve_mcp(port=8080)
137
+ ```
138
+
139
+ ### Agentic Workflow
140
+ Multi-round retrieval. The system retrieves, evaluates confidence, refines the query, calls tools, and retrieves again until the answer is sufficient.
141
+
142
+ ```python
143
+ response = engine.ask("Analyze supply chain risks and mitigation", mode="agentic")
144
+ ```
145
+
146
+ ### Persistent Memory
147
+ Remembers across sessions. Routing patterns, user preferences, and facts persist to disk.
148
+
149
+ ```python
150
+ engine.remember("focus_area", "supply chain risk")
151
+ engine.recall("focus_area")
152
+ engine.search_memory("supply chain")
153
+ ```
154
+
155
+ ### Incremental Learning
156
+ Add new documents anytime. The RL policy, knowledge graph, and memory continue from their current state — no restart needed.
157
+
158
+ ```python
159
+ engine.ingest("./initial_docs")
160
+ engine.ingest("./quarterly_update.pdf") # System continues, no restart
161
+ ```
162
+
163
+ ### RL-Based Retrieval Routing
164
+ Thompson Sampling or PPO learns which retrieval strategy works best per query type.
165
+
166
+ ```python
167
+ engine = AdaptiveAI(rl_algorithm="ppo")
168
+ engine = AdaptiveAI(pretrained_policy=True, domain="financial")
169
+ engine.export_policy("learned.json")
170
+ engine.import_policy("learned.json")
171
+ ```
172
+
173
+ ### Conditional Graph Activation
174
+ Knowledge graph auto-built during ingestion. A 5-signal gate activates graph traversal only when the query needs relational reasoning. Saves compute on 70% of queries.
175
+
176
+ ### Vectorless Mode
177
+ No ChromaDB, no embeddings, zero dependencies. Uses page-level BM25 with page citations.
178
+
179
+ ```python
180
+ engine = AdaptiveAI(vectorless=True)
181
+ ```
182
+
183
+ ### Structured Output
184
+
185
+ ```python
186
+ response = engine.ask("Extract metrics", output_format="json")
187
+ response = engine.ask("List items", output_format="csv")
188
+ response = engine.ask("Summarize", output_format="yaml")
189
+ ```
190
+
191
+ ### User Feedback
192
+
193
+ ```python
194
+ response = engine.ask("What are the risks?")
195
+ engine.feedback(response.query_id, "good") # +0.2 RL reward
196
+ engine.feedback(response.query_id, "bad") # -0.3 RL reward + prompt evolution
197
+ ```
198
+
199
+ ## LLM Providers
200
+
201
+ The library works with any LLM. Zero required dependencies for basic usage.
202
+
203
+ ### Free (no credit card needed)
204
+
205
+ ```python
206
+ # Ollama — local, no extras needed
207
+ engine = AdaptiveAI()
208
+
209
+ # NVIDIA NIM
210
+ engine = AdaptiveAI(api_key="nvapi-...", base_url="https://integrate.api.nvidia.com/v1",
211
+ llm_model="meta/llama-3.1-70b-instruct")
212
+
213
+ # Groq
214
+ engine = AdaptiveAI(api_key="gsk_...", base_url="https://api.groq.com/openai/v1",
215
+ llm_model="llama-3.3-70b-versatile")
216
+
217
+ # Google Gemini
218
+ engine = AdaptiveAI(api_key="...", base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
219
+ llm_model="gemini-2.0-flash")
220
+
221
+ # Together AI
222
+ engine = AdaptiveAI(api_key="...", base_url="https://api.together.xyz/v1",
223
+ llm_model="meta-llama/Llama-3-70b-chat-hf")
224
+
225
+ # Fireworks AI
226
+ engine = AdaptiveAI(api_key="...", base_url="https://api.fireworks.ai/inference/v1",
227
+ llm_model="accounts/fireworks/models/llama-v3p1-70b-instruct")
228
+
229
+ # HuggingFace local — needs [huggingface] extras
230
+ engine = AdaptiveAI(llm_backend="huggingface", llm_model="Qwen/Qwen2.5-1.5B-Instruct")
231
+
232
+ # No LLM — retrieval only
233
+ engine = AdaptiveAI(llm_backend="none")
234
+ ```
235
+
236
+ ### Paid
237
+
238
+ ```python
239
+ # OpenAI
240
+ engine = AdaptiveAI(api_key="sk-...", llm_model="gpt-4o")
241
+
242
+ # Grok (xAI)
243
+ engine = AdaptiveAI(api_key="xai-...", base_url="https://api.x.ai/v1")
244
+
245
+ # Azure OpenAI
246
+ engine = AdaptiveAI(azure_endpoint="https://your.openai.azure.com/", api_key="...")
247
+ ```
248
+
249
+ ### Self-hosted
250
+
251
+ ```python
252
+ # vLLM server
253
+ engine = AdaptiveAI(base_url="http://localhost:8000/v1")
254
+
255
+ # Any OpenAI-compatible server
256
+ engine = AdaptiveAI(base_url="http://your-server:8000/v1")
257
+ ```
258
+
259
+ ## How It Works
260
+
261
+ 1. **Understand** — Trigger interpreter classifies query type, complexity, domain, entities (no LLM call)
262
+ 2. **Decide** — RL policy selects retrieval route, depth, graph activation, tools to call
263
+ 3. **Retrieve** — Executes via vector, BM25, or page index with RRF fusion. Graph activates conditionally.
264
+ 4. **Generate** — Cross-encoder reranks chunks. Context engineer assembles full context window. LLM generates.
265
+ 5. **Learn** — 6 metrics evaluate response. Composite score = RL reward. Policy updates. Next query is better.
266
+
267
+ ## Demos
268
+
269
+ ### Colab (no setup needed)
270
+
271
+ Run on free T4 GPU with no API key: [`notebooks/adaptive_intelligence_v4_demo.ipynb`](notebooks/adaptive_intelligence_v4_demo.ipynb)
272
+
273
+ ### Local demos
274
+
275
+ ```bash
276
+ cd demo_mcp_agenticai
277
+ pip install -r requirements.txt
278
+ python demo_basic.py # Basic usage + incremental learning
279
+ python demo_tools.py # Tool registry + cost optimization
280
+ python demo_agentic.py # Agentic multi-round retrieval
281
+ python demo_mcp_server.py # Serve as MCP server (terminal 1)
282
+ python demo_mcp_client.py # Connect to MCP server (terminal 2)
283
+ ```
284
+
285
+ ## FAQ
286
+
287
+ **1. Does it work without an LLM?**
288
+
289
+ Yes. Set `llm_backend="none"` and the system returns relevant document excerpts. RL routing, graph activation, memory, and evaluation all work without an LLM.
290
+
291
+ **2. Does it work without a vector database?**
292
+
293
+ Yes. Set `vectorless=True` for page-level BM25 search with zero dependencies. Same RL routing, same graph, same learning.
294
+
295
+ **3. How many queries before it starts learning?**
296
+
297
+ Default warmup is 15 queries. During warmup, the system uses smart heuristic defaults while collecting RL statistics. After 15 queries, the learned policy takes over. Use `pretrained_policy=True` to skip warmup entirely.
298
+
299
+ **4. Which retrieval strategies does the RL choose from?**
300
+
301
+ Six routes: keyword only, vector only, hybrid (keyword + vector with RRF), table first, graph first, and graph hybrid. The RL also selects retrieval depth and whether to activate the knowledge graph.
302
+
303
+ **5. How is the knowledge graph built?**
304
+
305
+ Automatically during document ingestion from entity co-occurrences. No manual setup. A 5-signal gate decides per-query whether to activate graph traversal.
306
+
307
+ **6. What is context engineering?**
308
+
309
+ Instead of just stuffing retrieved chunks into a prompt, context engineering optimizes the entire context window — system prompt, memory entries, conversation history, tool results, and chunks — with token budget allocation per component.
310
+
311
+ **7. How does agentic mode work?**
312
+
313
+ The system retrieves, evaluates confidence, and if it's below threshold, refines the query and retrieves again. It can also call registered tools between rounds. Maximum 3 rounds by default.
314
+
315
+ **8. Can I add documents after initial ingestion?**
316
+
317
+ Yes. Call `engine.ingest()` again with new documents. The RL policy, knowledge graph, and memory all continue from their current state. No restart needed.
318
+
319
+ **9. What about latency?**
320
+
321
+ The system adds approximately 100-150ms overhead per query (classification, RL decision, evaluation, policy update). The LLM call typically takes 500-3000ms. Overhead is roughly 5-10% of total response time.
322
+
323
+ **10. How does it save cost?**
324
+
325
+ The RL learns optimal retrieval depth per query type. Factual queries get depth 2 (2 chunks), complex queries get depth 8. Fewer chunks = fewer tokens = lower LLM cost. The RL also learns which tools to skip, reducing unnecessary API calls.
326
+
327
+ **11. Is it production-ready?**
328
+
329
+ The library has 99 tests, crash recovery with auto-checkpoint, and graceful shutdown. BM25 is in-memory which works for hundreds of documents. For 50K+ documents, a disk-backed index is planned.
330
+
331
+ **12. How is this different from LangChain or LlamaIndex?**
332
+
333
+ Those are orchestration frameworks with static pipelines. You configure the retrieval strategy once. adaptive-intelligence learns the optimal strategy per query type through reinforcement learning. The system improves with every query answered.
334
+
335
+ ## Version History
336
+
337
+ | Version | Focus | Features |
338
+ |---------|-------|----------|
339
+ | v1 | Core Innovation | RL routing, conditional graph, 6-metric evaluation, 15 features |
340
+ | v2 | Production Ready | Vectorless mode, crash recovery, SQL connector, 10+ providers, 28 features |
341
+ | v3 | Intelligence | PPO, reranking, multi-query, pre-trained policies, transfer learning, 44 features |
342
+ | v4 | Context + Agentic | Context engineering, MCP, agentic workflow, persistent memory, incremental learning |
343
+
344
+ ## Project Structure
345
+
346
+ ```
347
+ adaptive_intelligence/
348
+ core/ # Engine, config, response objects
349
+ ingestion/ # Parser (10+ formats), chunker, ingestion engine
350
+ indexes/ # Vector (ChromaDB), keyword (BM25), page index
351
+ query/ # Trigger interpreter, query classification
352
+ rl/ # Thompson Sampling, PPO, reranker, multi-query, pretrained
353
+ graph/ # Knowledge graph, conditional activation
354
+ prompts/ # Adaptive prompt engine, template evolution
355
+ evaluation/ # 6-metric evaluation engine
356
+ llm/ # LLM providers (Ollama, OpenAI, HuggingFace)
357
+ memory/ # Learning memory, persistent memory
358
+ context/ # Context engineering, token budget
359
+ mcp/ # MCP server, tool registry
360
+ agentic/ # Agentic workflow, multi-round retrieval
361
+ security/ # Audit trail, PII scanning
362
+ utils/ # Logging, timing, ID generation
363
+ ```
364
+
365
+ ## Citation
366
+
367
+ If you use adaptive-intelligence in your research, please cite:
368
+
369
+ ```bibtex
370
+ @article{rajan2026adaptive,
371
+ title={Adaptive Retrieval Orchestration for Self-Learning Knowledge Systems},
372
+ author={Rajan, Venkatkumar},
373
+ year={2026},
374
+ publisher={ResearchGate},
375
+ url={https://www.researchgate.net/publication/405076088}
376
+ }
377
+ ```
378
+
379
+ ## Contributing
380
+
381
+ Contributions are welcome.
382
+
383
+ 1. Fork the repository
384
+ 2. Create a feature branch (`git checkout -b feature/your-feature`)
385
+ 3. Add tests for your changes
386
+ 4. Run tests (`pytest tests/ -v`)
387
+ 5. Submit a pull request
388
+
389
+ ## Also by me
390
+
391
+ [**llmevalkit**](https://pypi.org/project/llmevalkit/) — 78 metrics for LLM evaluation with HIPAA, GDPR, DPDP, and EU AI Act compliance modules.
392
+
393
+ adaptive-intelligence was born from llmevalkit. If you can measure LLM quality (llmevalkit), you can use those measurements as a reward signal to improve retrieval (adaptive-intelligence).
394
+
395
+ ## Author
396
+
397
+ **Venkatkumar Rajan** · [@VK_Venkatkumar](https://linkedin.com/in/venkatkumarvk) · [Portfolio](https://vk-ant.github.io/Venkatkumar/)
398
+
399
+ ## License
400
+
401
+ [Apache License 2.0](LICENSE)