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.
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/PKG-INFO +82 -51
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/README.md +69 -47
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/pyproject.toml +18 -4
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/PKG-INFO +82 -51
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/LICENSE +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/setup.cfg +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/__init__.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/api.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/auth.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/cli.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/client.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/config.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/cost_model.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_llm.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_llm_calls.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/demo_local.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/embeddings.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/idempotency.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/integration_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/jwt_utils.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/local_routes.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/main.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_cycle.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_phase.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/memory_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/metrics.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/middleware.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/models.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/permissions.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/plasticity.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/rate_limit.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/rbac_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/reconsolidation.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/sleep_cycle.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/__init__.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/base.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/integration_store.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l0_working_buffer.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l1_indexing_store.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l2_schema_graph.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l3_deep_recess.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/l3_postgres.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/rbac_store.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stores/user_store.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/stripe_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/temporal.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/test_suite.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/tiers.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/tracer.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/usage.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/user_embeddings.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/user_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus/webhook_dispatcher.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/SOURCES.txt +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/dependency_links.txt +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/entry_points.txt +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/requires.txt +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/src/clsplusplus.egg-info/top_level.txt +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_admin.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api_comprehensive.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_api_endpoints.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_auth.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_client_sdk.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_config.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_demo_llm.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_embeddings.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_idempotency.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_integration_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_cycle.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_phase.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_memory_service.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_middleware.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_models.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_performance.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_plasticity.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_prototype_e2e.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_rate_limit.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_reconsolidation.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_regression.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_security.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_sleep_cycle.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_stores.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_tiers.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_usage.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_user_auth.py +0 -0
- {clsplusplus-4.0.0 → clsplusplus-4.0.2}/tests/test_user_embeddings.py +0 -0
- {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.
|
|
4
|
-
Summary: Brain-inspired, model-agnostic persistent memory
|
|
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
|
-
|
|
13
|
-
|
|
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://
|
|
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
|
-
###
|
|
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
|
|
119
|
+
from clsplusplus import Brain
|
|
106
120
|
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
117
|
-
#
|
|
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
|
-
#
|
|
123
|
-
|
|
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
|
-
#
|
|
126
|
-
|
|
134
|
+
# Forget (GDPR right to be forgotten)
|
|
135
|
+
brain.forget("I work at Google as a senior engineer")
|
|
127
136
|
```
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
### JavaScript / TypeScript SDK
|
|
130
139
|
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-d '{"name": "my-app", "namespace": "default"}'
|
|
140
|
+
```typescript
|
|
141
|
+
import { Brain } from "clsplusplus";
|
|
142
|
+
|
|
143
|
+
const brain = new Brain("alice");
|
|
136
144
|
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
151
|
+
### Use with OpenAI
|
|
142
152
|
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
168
|
+
### Full API
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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://
|
|
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
|
-
###
|
|
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
|
|
59
|
+
from clsplusplus import Brain
|
|
55
60
|
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
66
|
-
#
|
|
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
|
-
#
|
|
72
|
-
|
|
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
|
-
#
|
|
75
|
-
|
|
74
|
+
# Forget (GDPR right to be forgotten)
|
|
75
|
+
brain.forget("I work at Google as a senior engineer")
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
### JavaScript / TypeScript SDK
|
|
79
79
|
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-d '{"name": "my-app", "namespace": "default"}'
|
|
80
|
+
```typescript
|
|
81
|
+
import { Brain } from "clsplusplus";
|
|
82
|
+
|
|
83
|
+
const brain = new Brain("alice");
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
91
|
+
### Use with OpenAI
|
|
91
92
|
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
108
|
+
### Full API
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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.
|
|
8
|
-
description = "Brain-inspired, model-agnostic persistent memory
|
|
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
|
-
|
|
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 ::
|
|
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.
|
|
4
|
-
Summary: Brain-inspired, model-agnostic persistent memory
|
|
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
|
-
|
|
13
|
-
|
|
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://
|
|
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
|
-
###
|
|
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
|
|
119
|
+
from clsplusplus import Brain
|
|
106
120
|
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
117
|
-
#
|
|
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
|
-
#
|
|
123
|
-
|
|
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
|
-
#
|
|
126
|
-
|
|
134
|
+
# Forget (GDPR right to be forgotten)
|
|
135
|
+
brain.forget("I work at Google as a senior engineer")
|
|
127
136
|
```
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
### JavaScript / TypeScript SDK
|
|
130
139
|
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-d '{"name": "my-app", "namespace": "default"}'
|
|
140
|
+
```typescript
|
|
141
|
+
import { Brain } from "clsplusplus";
|
|
142
|
+
|
|
143
|
+
const brain = new Brain("alice");
|
|
136
144
|
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
151
|
+
### Use with OpenAI
|
|
142
152
|
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
168
|
+
### Full API
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|