warm-integrations 0.1.0__py3-none-any.whl

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 (57) hide show
  1. warm_integrations-0.1.0.dist-info/METADATA +130 -0
  2. warm_integrations-0.1.0.dist-info/RECORD +57 -0
  3. warm_integrations-0.1.0.dist-info/WHEEL +4 -0
  4. warm_integrations-0.1.0.dist-info/licenses/LICENSE +201 -0
  5. writerslogic_warm_integrations/__init__.py +9 -0
  6. writerslogic_warm_integrations/ag2/__init__.py +8 -0
  7. writerslogic_warm_integrations/ag2/toolkit.py +80 -0
  8. writerslogic_warm_integrations/autogen/__init__.py +8 -0
  9. writerslogic_warm_integrations/autogen/memory.py +184 -0
  10. writerslogic_warm_integrations/core/__init__.py +12 -0
  11. writerslogic_warm_integrations/core/backend.py +565 -0
  12. writerslogic_warm_integrations/core/embedders.py +126 -0
  13. writerslogic_warm_integrations/core/filters.py +203 -0
  14. writerslogic_warm_integrations/core/models.py +50 -0
  15. writerslogic_warm_integrations/core/paged.py +252 -0
  16. writerslogic_warm_integrations/crewai/__init__.py +10 -0
  17. writerslogic_warm_integrations/crewai/knowledge.py +99 -0
  18. writerslogic_warm_integrations/crewai/storage.py +313 -0
  19. writerslogic_warm_integrations/dspy/__init__.py +6 -0
  20. writerslogic_warm_integrations/dspy/retriever.py +210 -0
  21. writerslogic_warm_integrations/haystack/__init__.py +13 -0
  22. writerslogic_warm_integrations/haystack/_filters.py +97 -0
  23. writerslogic_warm_integrations/haystack/document_store.py +485 -0
  24. writerslogic_warm_integrations/haystack/retrievers.py +163 -0
  25. writerslogic_warm_integrations/langchain/__init__.py +15 -0
  26. writerslogic_warm_integrations/langchain/chat_history.py +167 -0
  27. writerslogic_warm_integrations/langchain/embeddings.py +43 -0
  28. writerslogic_warm_integrations/langchain/retrievers.py +67 -0
  29. writerslogic_warm_integrations/langchain/vectorstores.py +276 -0
  30. writerslogic_warm_integrations/langgraph/__init__.py +7 -0
  31. writerslogic_warm_integrations/langgraph/checkpoint.py +506 -0
  32. writerslogic_warm_integrations/langgraph/store.py +345 -0
  33. writerslogic_warm_integrations/letta/__init__.py +9 -0
  34. writerslogic_warm_integrations/letta/archival.py +273 -0
  35. writerslogic_warm_integrations/letta/tools.py +113 -0
  36. writerslogic_warm_integrations/litellm/__init__.py +6 -0
  37. writerslogic_warm_integrations/litellm/tools.py +289 -0
  38. writerslogic_warm_integrations/llamaindex/__init__.py +17 -0
  39. writerslogic_warm_integrations/llamaindex/_filters.py +85 -0
  40. writerslogic_warm_integrations/llamaindex/chat_store.py +286 -0
  41. writerslogic_warm_integrations/llamaindex/memory.py +88 -0
  42. writerslogic_warm_integrations/llamaindex/storage.py +163 -0
  43. writerslogic_warm_integrations/llamaindex/vector_store.py +234 -0
  44. writerslogic_warm_integrations/mem0/__init__.py +9 -0
  45. writerslogic_warm_integrations/mem0/_support.py +527 -0
  46. writerslogic_warm_integrations/mem0/memory.py +440 -0
  47. writerslogic_warm_integrations/openai_agents/__init__.py +7 -0
  48. writerslogic_warm_integrations/openai_agents/session.py +77 -0
  49. writerslogic_warm_integrations/openai_agents/tools.py +92 -0
  50. writerslogic_warm_integrations/py.typed +0 -0
  51. writerslogic_warm_integrations/pydantic_ai/__init__.py +7 -0
  52. writerslogic_warm_integrations/pydantic_ai/history.py +121 -0
  53. writerslogic_warm_integrations/pydantic_ai/toolset.py +93 -0
  54. writerslogic_warm_integrations/semantic_kernel/__init__.py +8 -0
  55. writerslogic_warm_integrations/semantic_kernel/collection.py +391 -0
  56. writerslogic_warm_integrations/smolagents/__init__.py +6 -0
  57. writerslogic_warm_integrations/smolagents/tools.py +86 -0
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.5
2
+ Name: warm-integrations
3
+ Version: 0.1.0
4
+ Summary: Agent and RAG framework adapters for WARM
5
+ Project-URL: Homepage, https://github.com/writerslogic/warm/blob/main/docs/integrations/index.md
6
+ Project-URL: Repository, https://github.com/writerslogic/warm
7
+ Project-URL: Issues, https://github.com/writerslogic/warm/issues
8
+ Author-email: "WritersLogic, Inc." <david@writerslogic.com>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agent-memory,langchain,llamaindex,rag,vector-store,warm,writerslogic
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: httpx>=0.27
21
+ Requires-Dist: warm-sdk>=0.1.3
22
+ Provides-Extra: ag2
23
+ Requires-Dist: ag2>=1.1.2; extra == 'ag2'
24
+ Provides-Extra: autogen
25
+ Requires-Dist: autogen-agentchat>=0.7.5; extra == 'autogen'
26
+ Requires-Dist: autogen-core>=0.7.5; extra == 'autogen'
27
+ Requires-Dist: autogen-ext>=0.7.5; extra == 'autogen'
28
+ Provides-Extra: crewai
29
+ Requires-Dist: crewai>=1.15.28; extra == 'crewai'
30
+ Provides-Extra: dspy
31
+ Requires-Dist: dspy>=3.4.1; extra == 'dspy'
32
+ Requires-Dist: filelock>=4.2.6; extra == 'dspy'
33
+ Requires-Dist: numpy; extra == 'dspy'
34
+ Provides-Extra: haystack
35
+ Requires-Dist: haystack-ai>=3.4.0; extra == 'haystack'
36
+ Provides-Extra: langchain
37
+ Requires-Dist: langchain-core>=1.6.12; extra == 'langchain'
38
+ Requires-Dist: numpy; extra == 'langchain'
39
+ Provides-Extra: langgraph
40
+ Requires-Dist: langgraph-checkpoint>=4.3.0; extra == 'langgraph'
41
+ Requires-Dist: langgraph>=1.2.16; extra == 'langgraph'
42
+ Provides-Extra: letta
43
+ Requires-Dist: letta-client>=1.12.1; extra == 'letta'
44
+ Provides-Extra: litellm
45
+ Requires-Dist: filelock>=4.2.6; extra == 'litellm'
46
+ Requires-Dist: litellm>=1.103.10; extra == 'litellm'
47
+ Requires-Dist: mcp>=2.3.0; extra == 'litellm'
48
+ Provides-Extra: llamaindex
49
+ Requires-Dist: llama-index-core>=0.14.25; extra == 'llamaindex'
50
+ Provides-Extra: mem0
51
+ Requires-Dist: mem0ai>=2.2.1; extra == 'mem0'
52
+ Provides-Extra: openai-agents
53
+ Requires-Dist: openai-agents>=0.24.0; extra == 'openai-agents'
54
+ Provides-Extra: pydantic-ai
55
+ Requires-Dist: pydantic-ai-slim>=2.58.0; extra == 'pydantic-ai'
56
+ Provides-Extra: semantic-kernel
57
+ Requires-Dist: semantic-kernel>=1.45.0; extra == 'semantic-kernel'
58
+ Requires-Dist: werkzeug>=3.1.9; extra == 'semantic-kernel'
59
+ Provides-Extra: smolagents
60
+ Requires-Dist: smolagents>=1.26.0; extra == 'smolagents'
61
+ Description-Content-Type: text/markdown
62
+
63
+ # warm-integrations
64
+
65
+ Adapters that put WARM behind the memory, vector-store and retriever interfaces of Python agent and RAG frameworks, over the `warm-server` HTTP service.
66
+
67
+ ## Install
68
+
69
+ Framework dependency trees conflict: install exactly one extra per environment.
70
+
71
+ ```sh
72
+ pip install "warm-integrations[langchain]" # or another extra from the table
73
+ warm-server --input-dim 384 # the vector length your embeddings produce
74
+ ```
75
+
76
+ ## Quickstart
77
+
78
+ <!-- quickstart-check: python langchain -->
79
+ ```python
80
+ from langchain_core.documents import Document
81
+ from writerslogic_warm_integrations.core import HashingEmbedder
82
+ from writerslogic_warm_integrations.langchain import EmbedderAsLangChain, WarmVectorStore
83
+
84
+ store = WarmVectorStore(EmbedderAsLangChain(HashingEmbedder(384)), url="http://127.0.0.1:8080", api_key="dev", tenant_id="acme", collection="docs")
85
+ store.add_documents([Document(page_content="Rust has ownership and borrowing.", metadata={"topic": "code"})], ids=["rust"])
86
+ print(store.similarity_search("borrowing", k=4, filter={"topic": "code"}))
87
+ ```
88
+
89
+ Run `warm-server --no-auth --input-dim 384` (or set `WARM_API_KEY=dev` and pass `api_key="dev"`) first. `HashingEmbedder` is lexical and offline; pass a real embedding model for semantic search. One runnable offline example per adapter is in `examples/`.
90
+
91
+ ## Options
92
+
93
+ Every adapter accepts the same WARM settings as keyword arguments or `config=WarmConfig(...)`:
94
+
95
+ | Name | Type | Default | Meaning |
96
+ |---|---|---|---|
97
+ | `url`, `api_key`, `timeout`, `transport` | str, str, float, httpx transport | local server | Connection to `warm-server` |
98
+ | `tenant_id` | str | default tenant | Separate store per tenant |
99
+ | `collection` | str | none | Namespace inside a tenant |
100
+ | `embedder` / the framework's embeddings | `Embedder` | `HashingEmbedder(input_dim or 384)` | Encoder; `text_queries=True` lets a model-enabled server embed text |
101
+ | `max_fetch` | int | 100 | Result ceiling; match the server's `--max-top-k` |
102
+ | `overfetch` | int | 5 | Accepted for compatibility |
103
+
104
+ ## Adapters
105
+
106
+ | Extra | Host (tested version) | Page |
107
+ |---|---|---|
108
+ | `langchain` | langchain-core 1.6.12 | [LangChain](../../docs/integrations/frameworks/langchain.md) |
109
+ | `langgraph` | langgraph 1.2.16 | [LangGraph](../../docs/integrations/frameworks/langgraph.md) |
110
+ | `llamaindex` | llama-index-core 0.14.25 | [LlamaIndex](../../docs/integrations/frameworks/llamaindex.md) |
111
+ | `haystack` | haystack-ai 3.4.0 | [Haystack](../../docs/integrations/frameworks/haystack.md) |
112
+ | `dspy` | dspy 3.4.1, 3.5.0 | [DSPy](../../docs/integrations/frameworks/dspy.md) |
113
+ | `openai-agents` | openai-agents 0.24.0 | [OpenAI Agents](../../docs/integrations/frameworks/openai-agents.md) |
114
+ | `pydantic-ai` | pydantic-ai-slim 2.58.0 | [Pydantic AI](../../docs/integrations/frameworks/pydantic-ai.md) |
115
+ | `smolagents` | smolagents 1.26.0 | [smolagents](../../docs/integrations/frameworks/smolagents.md) |
116
+ | `litellm` | litellm 1.103.10 | [LiteLLM](../../docs/integrations/frameworks/litellm.md) |
117
+ | `crewai` | crewai 1.15.28 | [CrewAI](../../docs/integrations/frameworks/crewai.md) |
118
+ | `autogen` | autogen 0.7.5 | [AutoGen](../../docs/integrations/frameworks/autogen.md) |
119
+ | `ag2` | ag2 1.1.2 | [AutoGen and AG2](../../docs/integrations/frameworks/autogen.md) |
120
+ | `semantic-kernel` | semantic-kernel 1.45.0 | [Semantic Kernel](../../docs/integrations/frameworks/semantic-kernel.md) |
121
+ | `mem0` | mem0ai 2.2.1 | [mem0](../../docs/integrations/frameworks/mem0.md) |
122
+ | `letta` | letta-client 1.12.1 | [Letta](../../docs/integrations/frameworks/letta.md) |
123
+
124
+ ## Compatibility
125
+
126
+ Python 3.11+ (tested 3.12), `warm-sdk` >= 0.1.3, `warm-server` of the same WARM release. Tests: `WARM_SERVER_BIN=/path/to/warm-server ./run-matrix.sh [extra ...]` (one isolated environment per extra).
127
+
128
+ ## Reference
129
+
130
+ [Integrations overview](../../docs/integrations/index.md), [verification matrix and shared limits](../../docs/integrations/frameworks/MATRIX.md).
@@ -0,0 +1,57 @@
1
+ writerslogic_warm_integrations/__init__.py,sha256=Gttvtos1vyNKwVelNTujj99poH6h5qgFKPsMU5C50ZI,278
2
+ writerslogic_warm_integrations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ writerslogic_warm_integrations/ag2/__init__.py,sha256=TYMzXpPhHYdijUq4QNkJ67mS8_KSZ5QGYZ_sBURuiTo,224
4
+ writerslogic_warm_integrations/ag2/toolkit.py,sha256=cHd0EO-TTXQLfsBYnmHHPQQVgSQCbOeh3I1y-akVct8,3097
5
+ writerslogic_warm_integrations/autogen/__init__.py,sha256=6_khPNt-EY8eS_w5I2SMvgIOSkUMt9PY7GXF8MGVAYI,260
6
+ writerslogic_warm_integrations/autogen/memory.py,sha256=z_bK7WTe35ebYc6V9hi5jhKdz3481zSXns3G964M3aE,7422
7
+ writerslogic_warm_integrations/core/__init__.py,sha256=B40vmX9yH74_-CFtXUuSNudtRD77vfbLoEraFjQw_Ps,560
8
+ writerslogic_warm_integrations/core/backend.py,sha256=vJ3ZyJR2eUXG7BQ-cgIHz1A9KbH34SnneAt3a2iZ-Sg,25752
9
+ writerslogic_warm_integrations/core/embedders.py,sha256=kY8hxtoKiPJ3NTtFPqXUEa2nw85B8DLnS2uZw7k3ahw,4570
10
+ writerslogic_warm_integrations/core/filters.py,sha256=G4XaImAnbuw0QMsVbBpyVmdpM6ap28OGI1nrcHqeWvw,6912
11
+ writerslogic_warm_integrations/core/models.py,sha256=3UhBSRwFVVtGPYPnzT9OGlVbZfxGDEnYpfVqIbdcrxw,1301
12
+ writerslogic_warm_integrations/core/paged.py,sha256=7TJLXr1CygNxZukAkjnxeUj-hATQe3jKdELF8YWUkfQ,9917
13
+ writerslogic_warm_integrations/crewai/__init__.py,sha256=T-hBY_uOirQH_d958EfFLsMDAS59bbACuEHFGs0shK0,398
14
+ writerslogic_warm_integrations/crewai/knowledge.py,sha256=YcRuZXU-pcZyi1N5ZCNr1GvoF6jFemRDRQteB0ngSt4,4125
15
+ writerslogic_warm_integrations/crewai/storage.py,sha256=IdyBFIProMDXxVQ9yDCzBt6cAAjlgLXFcHNDJQLxLZA,12339
16
+ writerslogic_warm_integrations/dspy/__init__.py,sha256=lH_pFBTuiSEDiwdCmRhTc2Dx2tBaAxQfcVwBleYs3JA,171
17
+ writerslogic_warm_integrations/dspy/retriever.py,sha256=89iwZF_kHreSEzwxIl5DhN8C_GdKzreBsPHN6qMqlkk,9252
18
+ writerslogic_warm_integrations/haystack/__init__.py,sha256=cstMvXr-X0fO3-esMGWRQm6-1HGa0gy-3haIEiUmczc,571
19
+ writerslogic_warm_integrations/haystack/_filters.py,sha256=GRkDfNKfXGw8PttICahThM1xSsQTKxbs7QvmiIKi8K0,4204
20
+ writerslogic_warm_integrations/haystack/document_store.py,sha256=eEzlw-z27vI0AISG5gY4D9EPI5zVJoeRjHS8ChVTlLQ,22231
21
+ writerslogic_warm_integrations/haystack/retrievers.py,sha256=enmeMjVwmmzERZpVg-6-8o4CVmZ-ROc_XYj4RPhLQc0,6494
22
+ writerslogic_warm_integrations/langchain/__init__.py,sha256=dHnyjEHXWxssZqOgeqU5QMRotRiTN665ow9BZU7OFes,420
23
+ writerslogic_warm_integrations/langchain/chat_history.py,sha256=1P41o0dySTtel5LeLepw8JcRpKZ-R-aNCFggtImwdwY,6183
24
+ writerslogic_warm_integrations/langchain/embeddings.py,sha256=thA10suW2iZSJLiO25BDJU8ujZ0Tab9Xzhzy43TmwLI,1564
25
+ writerslogic_warm_integrations/langchain/retrievers.py,sha256=EJ2X7xYjSZZxtPhgA6YMcMEPg-3HblLVDV-8KKBKwck,3328
26
+ writerslogic_warm_integrations/langchain/vectorstores.py,sha256=O3gosjiP6ETxhNmNRpbVnu6KUdPmFW9scZfSa_ViVrA,13105
27
+ writerslogic_warm_integrations/langgraph/__init__.py,sha256=WZ3fjkU_VP0CWlz5gF-4a7GecFWB43b3jJbUA7SWHlk,188
28
+ writerslogic_warm_integrations/langgraph/checkpoint.py,sha256=3hTMVP6rksag4KXqyGDDBgyEcUdAfcHf_JLwq_NSRUc,24442
29
+ writerslogic_warm_integrations/langgraph/store.py,sha256=l_kYbVUMDuL-aRLF46KBCUSCnopFrHbyTTgJJHKjWk8,15254
30
+ writerslogic_warm_integrations/letta/__init__.py,sha256=k4WyRze8NHhT5d4uM0ABiPEfIfUTli89RJV2aedzMmg,377
31
+ writerslogic_warm_integrations/letta/archival.py,sha256=gza95A1G9ZlL_WDAOemlT-ZYyJn_pdVxrVPAxeTwF80,13827
32
+ writerslogic_warm_integrations/letta/tools.py,sha256=NikVPlFRjFigvwjDoCSPOxOT9F6IfatkTdhBRTBT8h0,5075
33
+ writerslogic_warm_integrations/litellm/__init__.py,sha256=Oo9wHsGx7eitVg-y02KFE6hg5ISzpAIc_CgjtCsrPfQ,145
34
+ writerslogic_warm_integrations/litellm/tools.py,sha256=L1mmT49hieTwkavyLQmTOuvVR9g-KgQydJp66yAoSBw,11713
35
+ writerslogic_warm_integrations/llamaindex/__init__.py,sha256=xZ0yvpoEJY67RWcJsmnPFqLFxbsZ9gTI0KpnRlroX_U,465
36
+ writerslogic_warm_integrations/llamaindex/_filters.py,sha256=zrHE8apTdosaiWAsoPHa4Pf7ibWDDS0GXNp3IZtuWfU,3090
37
+ writerslogic_warm_integrations/llamaindex/chat_store.py,sha256=UiQuXtREfJCvdqUmT9udObqeEh7sRg7R22_o9opFjJ0,12165
38
+ writerslogic_warm_integrations/llamaindex/memory.py,sha256=uWahRaQvSC-VEPBxjH_r_KoS_GMrL_bX5PiW5_oL-HU,3758
39
+ writerslogic_warm_integrations/llamaindex/storage.py,sha256=o0IRkG9_0setAaNyOAzh42n0jr6BxDrNI5cN8OR5uDM,6933
40
+ writerslogic_warm_integrations/llamaindex/vector_store.py,sha256=qEQ3DFXn4tFp4OKr-cBSsgOo3dN8oCFDWU8o6wmWIFs,9903
41
+ writerslogic_warm_integrations/mem0/__init__.py,sha256=XJZlwG8Ua-ShhERqXTlMWC_clAXjnKRi1VRJg5pKQfY,304
42
+ writerslogic_warm_integrations/mem0/_support.py,sha256=JjgVB7r34WsQsZidn4wkpzvHokxjT6599E28TMFH7xM,22163
43
+ writerslogic_warm_integrations/mem0/memory.py,sha256=iWgMued1ArYF8-uQRohc0cN6MtE2Hh6Qs-iTuWjNFrw,19376
44
+ writerslogic_warm_integrations/openai_agents/__init__.py,sha256=G4ASpRAREGkhC5Ohs_VG-DhLnOByuDU1L15io24tquM,195
45
+ writerslogic_warm_integrations/openai_agents/session.py,sha256=VCnNHYfFGBm8T4Ee64Ft_uQ-H8M7HsXnh2RFwyUz6ik,3069
46
+ writerslogic_warm_integrations/openai_agents/tools.py,sha256=eGXNCL_0VDC6lD-CFA4FsEjWEjif445esg2WGVblGec,3357
47
+ writerslogic_warm_integrations/pydantic_ai/__init__.py,sha256=k9gNAcBPifFrpkAYb0g-2QgE8YrK57gZbrWkLacCCb4,243
48
+ writerslogic_warm_integrations/pydantic_ai/history.py,sha256=J97SYxVUAvuTKQkePSIg4qZriStKhM1chXqM7EDPJCA,4823
49
+ writerslogic_warm_integrations/pydantic_ai/toolset.py,sha256=scS7hqBP7ZFM3sf1d0CAffFJuN4h4hlILqgip9oV8nU,3529
50
+ writerslogic_warm_integrations/semantic_kernel/__init__.py,sha256=Gy0LJ8dvxCmXnPO1rznVgelZSO7CsMsYew8-MaGc5tQ,245
51
+ writerslogic_warm_integrations/semantic_kernel/collection.py,sha256=hMur-Paxhp1Vu8OxqRj-LkOmqGCNNUkD0q1EMA7x-5Y,17808
52
+ writerslogic_warm_integrations/smolagents/__init__.py,sha256=Dh90XhoZmP8MrtfDbzg1pkx_C7U9fcUKKHqroNMUGZI,229
53
+ writerslogic_warm_integrations/smolagents/tools.py,sha256=syNNf4G9G4yYbvpmxH_gKGD_qsLHnwL4MY0-FfBdRZQ,3100
54
+ warm_integrations-0.1.0.dist-info/METADATA,sha256=UIMbqT7BqT1FrdLAS2VbmgooIOAOq9txME6efT6B1XI,6599
55
+ warm_integrations-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
56
+ warm_integrations-0.1.0.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
57
+ warm_integrations-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,9 @@
1
+ # Copyright 2024-2026 WritersLogic Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Framework adapters for WARM. Each lives in its own subpackage and imports its framework lazily."""
5
+
6
+ from .core import * # noqa: F401,F403
7
+ from .core import __all__
8
+
9
+ __version__ = "0.1.0"
@@ -0,0 +1,8 @@
1
+ # Copyright 2024-2026 WritersLogic Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """AG2 (the `ag2` 1.x package) memory tools. Requires `ag2`."""
5
+
6
+ from .toolkit import WarmMemoryToolkit
7
+
8
+ __all__ = ["WarmMemoryToolkit"]
@@ -0,0 +1,80 @@
1
+ # Copyright 2024-2026 WritersLogic Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Semantic memory tools for AG2 (the `ag2` 1.x package)."""
5
+
6
+ from __future__ import annotations
7
+
8
+ import os
9
+ import uuid
10
+ from typing import Any, Dict, List, Optional, Union
11
+
12
+ from ag2.tools import Toolkit, tool
13
+
14
+ from writerslogic_warm_integrations.core import AsyncWarmBackend, WarmConfig, Record
15
+
16
+ Scalar = Union[str, int, float, bool]
17
+
18
+
19
+ class WarmMemoryToolkit(Toolkit):
20
+ """`remember`, `recall` and `forget` tools backed by WARM.
21
+
22
+ Pass it in `Agent(tools=[WarmMemoryToolkit(...)])`. Tool results are plain
23
+ JSON-serializable values. `recall` filters on the metadata given to `remember` (equality
24
+ is evaluated by the service; see docs for the other operators). Set `allow_forget=False`
25
+ to leave out the destructive tool.
26
+
27
+ This is a tool-level adapter, not an `ag2.knowledge.KnowledgeStore`: that protocol is a
28
+ path-addressed file store with atomic `append` and unbounded byte-range reads, which a
29
+ 64 KiB-per-document vector service cannot honor. See docs/integrations/frameworks/autogen.md.
30
+ """
31
+
32
+ def __init__(
33
+ self,
34
+ warm: Optional[WarmConfig] = None,
35
+ *,
36
+ k: int = 5,
37
+ allow_forget: bool = True,
38
+ name: str = "writerslogic_warm",
39
+ ) -> None:
40
+ if warm is None:
41
+ warm = WarmConfig(api_key=os.environ.get("WARM_API_KEY"))
42
+ if warm.collection is None:
43
+ warm.collection = name
44
+ self.backend = AsyncWarmBackend(warm)
45
+ default_k = k
46
+ backend = self.backend
47
+
48
+ @tool(name="remember", description="Store a fact or note in long-term memory. Returns its id.")
49
+ async def remember(text: str, metadata: Optional[Dict[str, Scalar]] = None) -> str:
50
+ rid = str(uuid.uuid4())
51
+ await backend.remember([Record(rid, text, dict(metadata or {}))])
52
+ return rid
53
+
54
+ @tool(
55
+ name="recall",
56
+ description="Search long-term memory. Returns the best matches as {id, text, metadata, score}.",
57
+ )
58
+ async def recall(
59
+ query: str, k: Optional[int] = None, filter: Optional[Dict[str, Scalar]] = None
60
+ ) -> List[Dict[str, Any]]:
61
+ hits = await backend.recall(query, k=k or default_k, filter=filter)
62
+ return [{"id": h.id, "text": h.text, "metadata": h.metadata, "score": h.score} for h in hits]
63
+
64
+ tools = [remember, recall]
65
+ if allow_forget:
66
+
67
+ @tool(name="forget", description="Delete a memory by id. Returns whether it existed.")
68
+ async def forget(id: str) -> bool:
69
+ return bool(await backend.forget([id]))
70
+
71
+ tools.append(forget)
72
+ super().__init__(*tools, name=name)
73
+
74
+ def __deepcopy__(self, memo: Dict[int, Any]) -> "WarmMemoryToolkit":
75
+ # AG2 deep-copies tools when an agent adopts them; the toolkit owns a live HTTP
76
+ # client that cannot be copied, and its tools hold no mutable per-agent state.
77
+ return self
78
+
79
+ async def aclose(self) -> None:
80
+ await self.backend.aclose()
@@ -0,0 +1,8 @@
1
+ # Copyright 2024-2026 WritersLogic Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """AutoGen (autogen-agentchat 0.4+) memory. Requires `autogen-agentchat`."""
5
+
6
+ from .memory import WarmMemory, WarmMemoryConfig
7
+
8
+ __all__ = ["WarmMemory", "WarmMemoryConfig"]