clsplusplus 4.0.0__tar.gz → 4.0.2__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 (88) hide show
  1. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/PKG-INFO +82 -51
  2. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/README.md +69 -47
  3. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/pyproject.toml +18 -4
  4. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/PKG-INFO +82 -51
  5. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/LICENSE +0 -0
  6. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/setup.cfg +0 -0
  7. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/__init__.py +0 -0
  8. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/api.py +0 -0
  9. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/auth.py +0 -0
  10. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/cli.py +0 -0
  11. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/client.py +0 -0
  12. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/config.py +0 -0
  13. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/cost_model.py +0 -0
  14. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_llm.py +0 -0
  15. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_llm_calls.py +0 -0
  16. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_local.py +0 -0
  17. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/embeddings.py +0 -0
  18. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/idempotency.py +0 -0
  19. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/integration_service.py +0 -0
  20. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/jwt_utils.py +0 -0
  21. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/local_routes.py +0 -0
  22. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/main.py +0 -0
  23. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_cycle.py +0 -0
  24. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_phase.py +0 -0
  25. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_service.py +0 -0
  26. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/metrics.py +0 -0
  27. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/middleware.py +0 -0
  28. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/models.py +0 -0
  29. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/permissions.py +0 -0
  30. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/plasticity.py +0 -0
  31. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/rate_limit.py +0 -0
  32. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/rbac_service.py +0 -0
  33. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/reconsolidation.py +0 -0
  34. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/sleep_cycle.py +0 -0
  35. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/__init__.py +0 -0
  36. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/base.py +0 -0
  37. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/integration_store.py +0 -0
  38. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l0_working_buffer.py +0 -0
  39. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l1_indexing_store.py +0 -0
  40. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l2_schema_graph.py +0 -0
  41. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l3_deep_recess.py +0 -0
  42. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l3_postgres.py +0 -0
  43. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/rbac_store.py +0 -0
  44. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/user_store.py +0 -0
  45. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stripe_service.py +0 -0
  46. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/temporal.py +0 -0
  47. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/test_suite.py +0 -0
  48. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/tiers.py +0 -0
  49. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/tracer.py +0 -0
  50. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/usage.py +0 -0
  51. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/user_embeddings.py +0 -0
  52. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/user_service.py +0 -0
  53. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/webhook_dispatcher.py +0 -0
  54. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/SOURCES.txt +0 -0
  55. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/dependency_links.txt +0 -0
  56. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/entry_points.txt +0 -0
  57. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/requires.txt +0 -0
  58. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/top_level.txt +0 -0
  59. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_admin.py +0 -0
  60. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api.py +0 -0
  61. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api_comprehensive.py +0 -0
  62. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api_endpoints.py +0 -0
  63. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_auth.py +0 -0
  64. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_client_sdk.py +0 -0
  65. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_config.py +0 -0
  66. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_demo_llm.py +0 -0
  67. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_embeddings.py +0 -0
  68. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_idempotency.py +0 -0
  69. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_integration_service.py +0 -0
  70. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_cycle.py +0 -0
  71. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_phase.py +0 -0
  72. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_service.py +0 -0
  73. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_middleware.py +0 -0
  74. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_models.py +0 -0
  75. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_performance.py +0 -0
  76. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_plasticity.py +0 -0
  77. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_prototype_e2e.py +0 -0
  78. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_rate_limit.py +0 -0
  79. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_reconsolidation.py +0 -0
  80. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_regression.py +0 -0
  81. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_security.py +0 -0
  82. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_sleep_cycle.py +0 -0
  83. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_stores.py +0 -0
  84. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_tiers.py +0 -0
  85. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_usage.py +0 -0
  86. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_user_auth.py +0 -0
  87. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_user_embeddings.py +0 -0
  88. {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_webhook_dispatcher.py +0 -0
@@ -1,24 +1,33 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clsplusplus
3
- Version: 4.0.0
4
- Summary: Brain-inspired, model-agnostic persistent memory architecture for LLMs
3
+ Version: 4.0.2
4
+ Summary: Brain-inspired, model-agnostic persistent memory for LLMs. Learn, recall, forget — like a brain. Works with OpenAI, Claude, Gemini, Llama.
5
5
  Author-email: AlphaForge AI Labs <contact@alphaforge.ai>
6
+ Maintainer-email: Rajamohan Jabbala <contact@alphaforge.ai>
6
7
  License: Apache-2.0
7
8
  Project-URL: Homepage, https://github.com/rajamohan1950/CLSplusplus
8
9
  Project-URL: Documentation, https://github.com/rajamohan1950/CLSplusplus/wiki
9
10
  Project-URL: Repository, https://github.com/rajamohan1950/CLSplusplus
10
11
  Project-URL: Bug Tracker, https://github.com/rajamohan1950/CLSplusplus/issues
11
12
  Project-URL: Changelog, https://github.com/rajamohan1950/CLSplusplus/releases
12
- Keywords: llm,memory,ai,cls,continuous-learning,langchain,persistent-memory,model-agnostic
13
- Classifier: Development Status :: 3 - Alpha
13
+ Project-URL: API Reference, https://github.com/rajamohan1950/CLSplusplus/blob/main/docs/API_DOCUMENTATION.md
14
+ Project-URL: Source Code, https://github.com/rajamohan1950/CLSplusplus/tree/main/src
15
+ Project-URL: Download, https://github.com/rajamohan1950/CLSplusplus/releases
16
+ Keywords: llm,memory,ai,persistent-memory,model-agnostic,brain,openai,anthropic,claude,gemini,langchain,continuous-learning,semantic-search,vector-database,conversational-ai,rag,context-window
17
+ Classifier: Development Status :: 5 - Production/Stable
14
18
  Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Science/Research
15
20
  Classifier: License :: OSI Approved :: Apache Software License
21
+ Classifier: Operating System :: OS Independent
22
+ Classifier: Programming Language :: Python :: 3
16
23
  Classifier: Programming Language :: Python :: 3.9
17
24
  Classifier: Programming Language :: Python :: 3.10
18
25
  Classifier: Programming Language :: Python :: 3.11
19
26
  Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
20
28
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
29
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
+ Classifier: Typing :: Typed
22
31
  Requires-Python: >=3.9
23
32
  Description-Content-Type: text/markdown
24
33
  License-File: LICENSE
@@ -67,7 +76,9 @@ Dynamic: license-file
67
76
  </p>
68
77
 
69
78
  <p align="center">
70
- <a href="https://render.com/deploy?repo=https://github.com/rajamohan1950/CLSplusplus"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height="32" /></a>
79
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/v/clsplusplus?style=flat-square&label=PyPI&color=6366f1" alt="PyPI" /></a>
80
+ <a href="https://www.npmjs.com/package/clsplusplus"><img src="https://img.shields.io/npm/v/clsplusplus?style=flat-square&label=npm&color=cb3837" alt="npm" /></a>
81
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/pyversions/clsplusplus?style=flat-square" alt="Python" /></a>
71
82
  <a href="https://www.clsplusplus.com/docs"><img src="https://img.shields.io/badge/API-Live-22c55e?style=flat-square" alt="API" /></a>
72
83
  <a href="https://github.com/rajamohan1950/CLSplusplus/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square" alt="License" /></a>
73
84
  <a href="https://github.com/rajamohan1950/CLSplusplus"><img src="https://img.shields.io/badge/Patent-Oct%202025-blue?style=flat-square" alt="Patent" /></a>
@@ -95,73 +106,93 @@ Memory is **external** to the model. **Switch models anytime.** No reset.
95
106
 
96
107
  ## Quick Start
97
108
 
98
- ### Option A: SDK Client Only (talk to a running CLS++ server)
109
+ ### Install
99
110
 
100
111
  ```bash
101
- pip install clsplusplus # lightweight: only httpx + pydantic
112
+ pip install clsplusplus # Python (lightweight: only httpx + pydantic)
113
+ npm install clsplusplus # JavaScript / TypeScript (zero dependencies)
102
114
  ```
103
115
 
116
+ ### Python SDK
117
+
104
118
  ```python
105
- from clsplusplus import CLS
119
+ from clsplusplus import Brain
106
120
 
107
- client = CLS(base_url="http://localhost:8080", api_key="your_api_key")
108
- client.write("User prefers dark mode", namespace="user-123")
109
- results = client.read("user preferences", namespace="user-123")
110
- for item in results.items:
111
- print(item.text, item.confidence)
112
- ```
121
+ brain = Brain("alice")
113
122
 
114
- ### Option B: Run the Full Server Locally
123
+ # Teach it anything in natural language
124
+ brain.learn("I work at Google as a senior engineer")
125
+ brain.learn("I prefer Python over JavaScript")
115
126
 
116
- ```bash
117
- # Clone and install with server dependencies
118
- git clone https://github.com/rajamohan1950/CLSplusplus.git
119
- cd CLSplusplus
120
- pip install -e ".[server]"
127
+ # Ask it anything — semantic recall, not keyword matching
128
+ brain.ask("What's my job?") # ["I work at Google as a senior engineer"]
121
129
 
122
- # Start infrastructure (Redis + PostgreSQL)
123
- docker compose up -d redis postgres
130
+ # Get LLM-ready context for any prompt
131
+ brain.context("coding help")
132
+ # "Known facts about this user:\n- I work at Google..."
124
133
 
125
- # Start the API server
126
- uvicorn clsplusplus.api:app --host 0.0.0.0 --port 8080
134
+ # Forget (GDPR right to be forgotten)
135
+ brain.forget("I work at Google as a senior engineer")
127
136
  ```
128
137
 
129
- #### Create an API key
138
+ ### JavaScript / TypeScript SDK
130
139
 
131
- ```bash
132
- # Register an integration and get your API key
133
- curl -X POST http://localhost:8080/v1/integrations \
134
- -H "Content-Type: application/json" \
135
- -d '{"name": "my-app", "namespace": "default"}'
140
+ ```typescript
141
+ import { Brain } from "clsplusplus";
142
+
143
+ const brain = new Brain("alice");
136
144
 
137
- # Response includes your API key (shown only once):
138
- # {"id": "...", "keys": [{"key": "cls_live_xxxxxxxx", ...}], ...}
145
+ await brain.learn("I work at Google as a senior engineer");
146
+ const facts = await brain.ask("What's my job?");
147
+ const context = await brain.context("coding help");
148
+ await brain.forget("I work at Google as a senior engineer");
139
149
  ```
140
150
 
141
- #### Write and read memories
151
+ ### Use with OpenAI
142
152
 
143
- ```bash
144
- # Write a memory
145
- curl -X POST http://localhost:8080/v1/memory/write \
146
- -H "Content-Type: application/json" \
147
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
148
- -d '{"text": "User prefers dark mode", "namespace": "user-123"}'
149
-
150
- # Read memories
151
- curl -X POST http://localhost:8080/v1/memory/read \
152
- -H "Content-Type: application/json" \
153
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
154
- -d '{"query": "user preferences", "namespace": "user-123"}'
153
+ ```python
154
+ from clsplusplus import Brain
155
+
156
+ brain = Brain("alice")
157
+
158
+ # Wrap any LLM function — auto-injects memory, auto-learns
159
+ @brain.wrap
160
+ def chat(system_prompt, user_message):
161
+ return openai.chat(system=system_prompt, user=user_message)
162
+
163
+ response = chat("You are a helpful assistant", "Help me with Python")
164
+ # Brain auto-recalls relevant memory, injects into prompt,
165
+ # calls your LLM, learns from the exchange, returns response.
155
166
  ```
156
167
 
157
- #### Python SDK (3-line integration)
168
+ ### Full API
158
169
 
159
- ```python
160
- from clsplusplus import CLS
170
+ | Method | Description |
171
+ |--------|-------------|
172
+ | `brain.learn(fact)` | Teach a fact. Returns memory ID. |
173
+ | `brain.ask(question)` | Query for relevant facts. Returns list. |
174
+ | `brain.context(topic)` | Get LLM-ready context string. |
175
+ | `brain.forget(fact)` | Forget by text or ID. |
176
+ | `brain.absorb(text)` | Bulk-learn from document or conversation. |
177
+ | `brain.who()` | Auto-generated user profile. |
178
+ | `brain.correct(old, new)` | Update a belief. |
179
+ | `brain.chat(message, llm)` | Full conversation handler with memory. |
180
+ | `brain.teach(dict)` | Learn from structured data. |
181
+ | `brain.watch(messages)` | Learn from chat message history. |
182
+ | `brain.wrap(fn)` | Wrap any LLM function with auto-memory. |
183
+
184
+ ### Run the Full Server Locally
161
185
 
162
- client = CLS(base_url="http://localhost:8080", api_key="cls_live_xxxxxxxx")
163
- client.memories.encode(content="User prefers dark mode", agent_id="a1")
164
- results = client.memories.retrieve(query="user preferences", agent_id="a1")
186
+ ```bash
187
+ git clone https://github.com/rajamohan1950/CLSplusplus.git
188
+ cd CLSplusplus
189
+ pip install -e ".[server]"
190
+
191
+ # Start infrastructure (Redis + PostgreSQL)
192
+ docker compose up -d redis postgres
193
+
194
+ # Start the API server
195
+ uvicorn clsplusplus.api:create_app --factory --host 0.0.0.0 --port 8080
165
196
  ```
166
197
 
167
198
  ---
@@ -16,7 +16,9 @@
16
16
  </p>
17
17
 
18
18
  <p align="center">
19
- <a href="https://render.com/deploy?repo=https://github.com/rajamohan1950/CLSplusplus"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height="32" /></a>
19
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/v/clsplusplus?style=flat-square&label=PyPI&color=6366f1" alt="PyPI" /></a>
20
+ <a href="https://www.npmjs.com/package/clsplusplus"><img src="https://img.shields.io/npm/v/clsplusplus?style=flat-square&label=npm&color=cb3837" alt="npm" /></a>
21
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/pyversions/clsplusplus?style=flat-square" alt="Python" /></a>
20
22
  <a href="https://www.clsplusplus.com/docs"><img src="https://img.shields.io/badge/API-Live-22c55e?style=flat-square" alt="API" /></a>
21
23
  <a href="https://github.com/rajamohan1950/CLSplusplus/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square" alt="License" /></a>
22
24
  <a href="https://github.com/rajamohan1950/CLSplusplus"><img src="https://img.shields.io/badge/Patent-Oct%202025-blue?style=flat-square" alt="Patent" /></a>
@@ -44,73 +46,93 @@ Memory is **external** to the model. **Switch models anytime.** No reset.
44
46
 
45
47
  ## Quick Start
46
48
 
47
- ### Option A: SDK Client Only (talk to a running CLS++ server)
49
+ ### Install
48
50
 
49
51
  ```bash
50
- pip install clsplusplus # lightweight: only httpx + pydantic
52
+ pip install clsplusplus # Python (lightweight: only httpx + pydantic)
53
+ npm install clsplusplus # JavaScript / TypeScript (zero dependencies)
51
54
  ```
52
55
 
56
+ ### Python SDK
57
+
53
58
  ```python
54
- from clsplusplus import CLS
59
+ from clsplusplus import Brain
55
60
 
56
- client = CLS(base_url="http://localhost:8080", api_key="your_api_key")
57
- client.write("User prefers dark mode", namespace="user-123")
58
- results = client.read("user preferences", namespace="user-123")
59
- for item in results.items:
60
- print(item.text, item.confidence)
61
- ```
61
+ brain = Brain("alice")
62
62
 
63
- ### Option B: Run the Full Server Locally
63
+ # Teach it anything in natural language
64
+ brain.learn("I work at Google as a senior engineer")
65
+ brain.learn("I prefer Python over JavaScript")
64
66
 
65
- ```bash
66
- # Clone and install with server dependencies
67
- git clone https://github.com/rajamohan1950/CLSplusplus.git
68
- cd CLSplusplus
69
- pip install -e ".[server]"
67
+ # Ask it anything — semantic recall, not keyword matching
68
+ brain.ask("What's my job?") # ["I work at Google as a senior engineer"]
70
69
 
71
- # Start infrastructure (Redis + PostgreSQL)
72
- docker compose up -d redis postgres
70
+ # Get LLM-ready context for any prompt
71
+ brain.context("coding help")
72
+ # "Known facts about this user:\n- I work at Google..."
73
73
 
74
- # Start the API server
75
- uvicorn clsplusplus.api:app --host 0.0.0.0 --port 8080
74
+ # Forget (GDPR right to be forgotten)
75
+ brain.forget("I work at Google as a senior engineer")
76
76
  ```
77
77
 
78
- #### Create an API key
78
+ ### JavaScript / TypeScript SDK
79
79
 
80
- ```bash
81
- # Register an integration and get your API key
82
- curl -X POST http://localhost:8080/v1/integrations \
83
- -H "Content-Type: application/json" \
84
- -d '{"name": "my-app", "namespace": "default"}'
80
+ ```typescript
81
+ import { Brain } from "clsplusplus";
82
+
83
+ const brain = new Brain("alice");
85
84
 
86
- # Response includes your API key (shown only once):
87
- # {"id": "...", "keys": [{"key": "cls_live_xxxxxxxx", ...}], ...}
85
+ await brain.learn("I work at Google as a senior engineer");
86
+ const facts = await brain.ask("What's my job?");
87
+ const context = await brain.context("coding help");
88
+ await brain.forget("I work at Google as a senior engineer");
88
89
  ```
89
90
 
90
- #### Write and read memories
91
+ ### Use with OpenAI
91
92
 
92
- ```bash
93
- # Write a memory
94
- curl -X POST http://localhost:8080/v1/memory/write \
95
- -H "Content-Type: application/json" \
96
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
97
- -d '{"text": "User prefers dark mode", "namespace": "user-123"}'
98
-
99
- # Read memories
100
- curl -X POST http://localhost:8080/v1/memory/read \
101
- -H "Content-Type: application/json" \
102
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
103
- -d '{"query": "user preferences", "namespace": "user-123"}'
93
+ ```python
94
+ from clsplusplus import Brain
95
+
96
+ brain = Brain("alice")
97
+
98
+ # Wrap any LLM function — auto-injects memory, auto-learns
99
+ @brain.wrap
100
+ def chat(system_prompt, user_message):
101
+ return openai.chat(system=system_prompt, user=user_message)
102
+
103
+ response = chat("You are a helpful assistant", "Help me with Python")
104
+ # Brain auto-recalls relevant memory, injects into prompt,
105
+ # calls your LLM, learns from the exchange, returns response.
104
106
  ```
105
107
 
106
- #### Python SDK (3-line integration)
108
+ ### Full API
107
109
 
108
- ```python
109
- from clsplusplus import CLS
110
+ | Method | Description |
111
+ |--------|-------------|
112
+ | `brain.learn(fact)` | Teach a fact. Returns memory ID. |
113
+ | `brain.ask(question)` | Query for relevant facts. Returns list. |
114
+ | `brain.context(topic)` | Get LLM-ready context string. |
115
+ | `brain.forget(fact)` | Forget by text or ID. |
116
+ | `brain.absorb(text)` | Bulk-learn from document or conversation. |
117
+ | `brain.who()` | Auto-generated user profile. |
118
+ | `brain.correct(old, new)` | Update a belief. |
119
+ | `brain.chat(message, llm)` | Full conversation handler with memory. |
120
+ | `brain.teach(dict)` | Learn from structured data. |
121
+ | `brain.watch(messages)` | Learn from chat message history. |
122
+ | `brain.wrap(fn)` | Wrap any LLM function with auto-memory. |
123
+
124
+ ### Run the Full Server Locally
110
125
 
111
- client = CLS(base_url="http://localhost:8080", api_key="cls_live_xxxxxxxx")
112
- client.memories.encode(content="User prefers dark mode", agent_id="a1")
113
- results = client.memories.retrieve(query="user preferences", agent_id="a1")
126
+ ```bash
127
+ git clone https://github.com/rajamohan1950/CLSplusplus.git
128
+ cd CLSplusplus
129
+ pip install -e ".[server]"
130
+
131
+ # Start infrastructure (Redis + PostgreSQL)
132
+ docker compose up -d redis postgres
133
+
134
+ # Start the API server
135
+ uvicorn clsplusplus.api:create_app --factory --host 0.0.0.0 --port 8080
114
136
  ```
115
137
 
116
138
  ---
@@ -4,23 +4,34 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "clsplusplus"
7
- version = "4.0.0"
8
- description = "Brain-inspired, model-agnostic persistent memory architecture for LLMs"
7
+ version = "4.0.2"
8
+ description = "Brain-inspired, model-agnostic persistent memory for LLMs. Learn, recall, forget — like a brain. Works with OpenAI, Claude, Gemini, Llama."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  license = {text = "Apache-2.0"}
12
12
  authors = [{name = "AlphaForge AI Labs", email = "contact@alphaforge.ai"}]
13
- keywords = ["llm", "memory", "ai", "cls", "continuous-learning", "langchain", "persistent-memory", "model-agnostic"]
13
+ maintainers = [{name = "Rajamohan Jabbala", email = "contact@alphaforge.ai"}]
14
+ keywords = [
15
+ "llm", "memory", "ai", "persistent-memory", "model-agnostic",
16
+ "brain", "openai", "anthropic", "claude", "gemini", "langchain",
17
+ "continuous-learning", "semantic-search", "vector-database",
18
+ "conversational-ai", "rag", "context-window",
19
+ ]
14
20
  classifiers = [
15
- "Development Status :: 3 - Alpha",
21
+ "Development Status :: 5 - Production/Stable",
16
22
  "Intended Audience :: Developers",
23
+ "Intended Audience :: Science/Research",
17
24
  "License :: OSI Approved :: Apache Software License",
25
+ "Operating System :: OS Independent",
26
+ "Programming Language :: Python :: 3",
18
27
  "Programming Language :: Python :: 3.9",
19
28
  "Programming Language :: Python :: 3.10",
20
29
  "Programming Language :: Python :: 3.11",
21
30
  "Programming Language :: Python :: 3.12",
31
+ "Programming Language :: Python :: 3.13",
22
32
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
23
33
  "Topic :: Software Development :: Libraries :: Python Modules",
34
+ "Typing :: Typed",
24
35
  ]
25
36
 
26
37
  # SDK-only dependencies — lightweight client (~5 MB install)
@@ -67,6 +78,9 @@ Documentation = "https://github.com/rajamohan1950/CLSplusplus/wiki"
67
78
  Repository = "https://github.com/rajamohan1950/CLSplusplus"
68
79
  "Bug Tracker" = "https://github.com/rajamohan1950/CLSplusplus/issues"
69
80
  Changelog = "https://github.com/rajamohan1950/CLSplusplus/releases"
81
+ "API Reference" = "https://github.com/rajamohan1950/CLSplusplus/blob/main/docs/API_DOCUMENTATION.md"
82
+ "Source Code" = "https://github.com/rajamohan1950/CLSplusplus/tree/main/src"
83
+ "Download" = "https://github.com/rajamohan1950/CLSplusplus/releases"
70
84
 
71
85
  [tool.setuptools.packages.find]
72
86
  where = ["src"]
@@ -1,24 +1,33 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clsplusplus
3
- Version: 4.0.0
4
- Summary: Brain-inspired, model-agnostic persistent memory architecture for LLMs
3
+ Version: 4.0.2
4
+ Summary: Brain-inspired, model-agnostic persistent memory for LLMs. Learn, recall, forget — like a brain. Works with OpenAI, Claude, Gemini, Llama.
5
5
  Author-email: AlphaForge AI Labs <contact@alphaforge.ai>
6
+ Maintainer-email: Rajamohan Jabbala <contact@alphaforge.ai>
6
7
  License: Apache-2.0
7
8
  Project-URL: Homepage, https://github.com/rajamohan1950/CLSplusplus
8
9
  Project-URL: Documentation, https://github.com/rajamohan1950/CLSplusplus/wiki
9
10
  Project-URL: Repository, https://github.com/rajamohan1950/CLSplusplus
10
11
  Project-URL: Bug Tracker, https://github.com/rajamohan1950/CLSplusplus/issues
11
12
  Project-URL: Changelog, https://github.com/rajamohan1950/CLSplusplus/releases
12
- Keywords: llm,memory,ai,cls,continuous-learning,langchain,persistent-memory,model-agnostic
13
- Classifier: Development Status :: 3 - Alpha
13
+ Project-URL: API Reference, https://github.com/rajamohan1950/CLSplusplus/blob/main/docs/API_DOCUMENTATION.md
14
+ Project-URL: Source Code, https://github.com/rajamohan1950/CLSplusplus/tree/main/src
15
+ Project-URL: Download, https://github.com/rajamohan1950/CLSplusplus/releases
16
+ Keywords: llm,memory,ai,persistent-memory,model-agnostic,brain,openai,anthropic,claude,gemini,langchain,continuous-learning,semantic-search,vector-database,conversational-ai,rag,context-window
17
+ Classifier: Development Status :: 5 - Production/Stable
14
18
  Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Science/Research
15
20
  Classifier: License :: OSI Approved :: Apache Software License
21
+ Classifier: Operating System :: OS Independent
22
+ Classifier: Programming Language :: Python :: 3
16
23
  Classifier: Programming Language :: Python :: 3.9
17
24
  Classifier: Programming Language :: Python :: 3.10
18
25
  Classifier: Programming Language :: Python :: 3.11
19
26
  Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
20
28
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
29
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
+ Classifier: Typing :: Typed
22
31
  Requires-Python: >=3.9
23
32
  Description-Content-Type: text/markdown
24
33
  License-File: LICENSE
@@ -67,7 +76,9 @@ Dynamic: license-file
67
76
  </p>
68
77
 
69
78
  <p align="center">
70
- <a href="https://render.com/deploy?repo=https://github.com/rajamohan1950/CLSplusplus"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height="32" /></a>
79
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/v/clsplusplus?style=flat-square&label=PyPI&color=6366f1" alt="PyPI" /></a>
80
+ <a href="https://www.npmjs.com/package/clsplusplus"><img src="https://img.shields.io/npm/v/clsplusplus?style=flat-square&label=npm&color=cb3837" alt="npm" /></a>
81
+ <a href="https://pypi.org/project/clsplusplus/"><img src="https://img.shields.io/pypi/pyversions/clsplusplus?style=flat-square" alt="Python" /></a>
71
82
  <a href="https://www.clsplusplus.com/docs"><img src="https://img.shields.io/badge/API-Live-22c55e?style=flat-square" alt="API" /></a>
72
83
  <a href="https://github.com/rajamohan1950/CLSplusplus/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square" alt="License" /></a>
73
84
  <a href="https://github.com/rajamohan1950/CLSplusplus"><img src="https://img.shields.io/badge/Patent-Oct%202025-blue?style=flat-square" alt="Patent" /></a>
@@ -95,73 +106,93 @@ Memory is **external** to the model. **Switch models anytime.** No reset.
95
106
 
96
107
  ## Quick Start
97
108
 
98
- ### Option A: SDK Client Only (talk to a running CLS++ server)
109
+ ### Install
99
110
 
100
111
  ```bash
101
- pip install clsplusplus # lightweight: only httpx + pydantic
112
+ pip install clsplusplus # Python (lightweight: only httpx + pydantic)
113
+ npm install clsplusplus # JavaScript / TypeScript (zero dependencies)
102
114
  ```
103
115
 
116
+ ### Python SDK
117
+
104
118
  ```python
105
- from clsplusplus import CLS
119
+ from clsplusplus import Brain
106
120
 
107
- client = CLS(base_url="http://localhost:8080", api_key="your_api_key")
108
- client.write("User prefers dark mode", namespace="user-123")
109
- results = client.read("user preferences", namespace="user-123")
110
- for item in results.items:
111
- print(item.text, item.confidence)
112
- ```
121
+ brain = Brain("alice")
113
122
 
114
- ### Option B: Run the Full Server Locally
123
+ # Teach it anything in natural language
124
+ brain.learn("I work at Google as a senior engineer")
125
+ brain.learn("I prefer Python over JavaScript")
115
126
 
116
- ```bash
117
- # Clone and install with server dependencies
118
- git clone https://github.com/rajamohan1950/CLSplusplus.git
119
- cd CLSplusplus
120
- pip install -e ".[server]"
127
+ # Ask it anything — semantic recall, not keyword matching
128
+ brain.ask("What's my job?") # ["I work at Google as a senior engineer"]
121
129
 
122
- # Start infrastructure (Redis + PostgreSQL)
123
- docker compose up -d redis postgres
130
+ # Get LLM-ready context for any prompt
131
+ brain.context("coding help")
132
+ # "Known facts about this user:\n- I work at Google..."
124
133
 
125
- # Start the API server
126
- uvicorn clsplusplus.api:app --host 0.0.0.0 --port 8080
134
+ # Forget (GDPR right to be forgotten)
135
+ brain.forget("I work at Google as a senior engineer")
127
136
  ```
128
137
 
129
- #### Create an API key
138
+ ### JavaScript / TypeScript SDK
130
139
 
131
- ```bash
132
- # Register an integration and get your API key
133
- curl -X POST http://localhost:8080/v1/integrations \
134
- -H "Content-Type: application/json" \
135
- -d '{"name": "my-app", "namespace": "default"}'
140
+ ```typescript
141
+ import { Brain } from "clsplusplus";
142
+
143
+ const brain = new Brain("alice");
136
144
 
137
- # Response includes your API key (shown only once):
138
- # {"id": "...", "keys": [{"key": "cls_live_xxxxxxxx", ...}], ...}
145
+ await brain.learn("I work at Google as a senior engineer");
146
+ const facts = await brain.ask("What's my job?");
147
+ const context = await brain.context("coding help");
148
+ await brain.forget("I work at Google as a senior engineer");
139
149
  ```
140
150
 
141
- #### Write and read memories
151
+ ### Use with OpenAI
142
152
 
143
- ```bash
144
- # Write a memory
145
- curl -X POST http://localhost:8080/v1/memory/write \
146
- -H "Content-Type: application/json" \
147
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
148
- -d '{"text": "User prefers dark mode", "namespace": "user-123"}'
149
-
150
- # Read memories
151
- curl -X POST http://localhost:8080/v1/memory/read \
152
- -H "Content-Type: application/json" \
153
- -H "Authorization: Bearer cls_live_xxxxxxxx" \
154
- -d '{"query": "user preferences", "namespace": "user-123"}'
153
+ ```python
154
+ from clsplusplus import Brain
155
+
156
+ brain = Brain("alice")
157
+
158
+ # Wrap any LLM function — auto-injects memory, auto-learns
159
+ @brain.wrap
160
+ def chat(system_prompt, user_message):
161
+ return openai.chat(system=system_prompt, user=user_message)
162
+
163
+ response = chat("You are a helpful assistant", "Help me with Python")
164
+ # Brain auto-recalls relevant memory, injects into prompt,
165
+ # calls your LLM, learns from the exchange, returns response.
155
166
  ```
156
167
 
157
- #### Python SDK (3-line integration)
168
+ ### Full API
158
169
 
159
- ```python
160
- from clsplusplus import CLS
170
+ | Method | Description |
171
+ |--------|-------------|
172
+ | `brain.learn(fact)` | Teach a fact. Returns memory ID. |
173
+ | `brain.ask(question)` | Query for relevant facts. Returns list. |
174
+ | `brain.context(topic)` | Get LLM-ready context string. |
175
+ | `brain.forget(fact)` | Forget by text or ID. |
176
+ | `brain.absorb(text)` | Bulk-learn from document or conversation. |
177
+ | `brain.who()` | Auto-generated user profile. |
178
+ | `brain.correct(old, new)` | Update a belief. |
179
+ | `brain.chat(message, llm)` | Full conversation handler with memory. |
180
+ | `brain.teach(dict)` | Learn from structured data. |
181
+ | `brain.watch(messages)` | Learn from chat message history. |
182
+ | `brain.wrap(fn)` | Wrap any LLM function with auto-memory. |
183
+
184
+ ### Run the Full Server Locally
161
185
 
162
- client = CLS(base_url="http://localhost:8080", api_key="cls_live_xxxxxxxx")
163
- client.memories.encode(content="User prefers dark mode", agent_id="a1")
164
- results = client.memories.retrieve(query="user preferences", agent_id="a1")
186
+ ```bash
187
+ git clone https://github.com/rajamohan1950/CLSplusplus.git
188
+ cd CLSplusplus
189
+ pip install -e ".[server]"
190
+
191
+ # Start infrastructure (Redis + PostgreSQL)
192
+ docker compose up -d redis postgres
193
+
194
+ # Start the API server
195
+ uvicorn clsplusplus.api:create_app --factory --host 0.0.0.0 --port 8080
165
196
  ```
166
197
 
167
198
  ---
File without changes
File without changes