cortexdbai 0.2.5__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cortexdbai
3
- Version: 0.2.5
3
+ Version: 0.3.0
4
4
  Summary: The Long-Term Memory Layer for AI Systems
5
5
  Project-URL: Homepage, https://cortexdb.ai
6
6
  Project-URL: Documentation, https://docs.cortexdb.ai
@@ -0,0 +1,71 @@
1
+ """CortexDB Python SDK — the long-term memory layer for AI systems.
2
+
3
+ The SDK is a thin HTTP client over the v1 API surface that cortexdb
4
+ exposes by default on port 3141. The top-level :class:`Cortex` class
5
+ (alias :class:`V1Client`) is what you should reach for.
6
+
7
+ Quick start::
8
+
9
+ from cortexdb import Cortex
10
+
11
+ # Local docker run with no auth (CORTEX_API_KEY unset on the server):
12
+ with Cortex("http://localhost:3141") as c:
13
+ c.experience("ws:demo", text="Priya at Acme signed for 200 seats.")
14
+ pack = c.recall("ws:demo", query="How many seats did Acme sign for?")
15
+ print(pack)
16
+
17
+ # Hosted / multi-tenant deployment with PASETO bearer + actor header:
18
+ with Cortex(
19
+ "https://api.cortexdb.ai",
20
+ actor="user:alice",
21
+ bearer="eyJ...",
22
+ ) as c:
23
+ out = c.answer(
24
+ "org:initech/user:alice",
25
+ question="What did Alice say about coffee?",
26
+ )
27
+
28
+ Versions ≤ 0.2.x exposed a separate ``cortexdb.Cortex`` class targeting
29
+ the legacy ``/v1/remember`` endpoints. That surface was retired in 0.3.0
30
+ because the cortexdb binary's public port now only serves the v1 API;
31
+ the legacy endpoints survive only as an internal bench-compat helper.
32
+ If you need them, pin ``cortexdbai<0.3``.
33
+ """
34
+
35
+ from cortexdb.v1 import V1Client, AsyncV1Client
36
+ from cortexdb.v1.exceptions import (
37
+ V1APIError,
38
+ V1AuthError,
39
+ V1ConnectionError,
40
+ V1Error,
41
+ V1NotConfiguredError,
42
+ V1PolicyDeniedError,
43
+ V1RateLimitError,
44
+ V1TimeoutError,
45
+ )
46
+ from cortexdb import v1 # the explicit submodule namespace
47
+
48
+ # Ergonomic top-level aliases. New code can write either form.
49
+ Cortex = V1Client
50
+ AsyncCortex = AsyncV1Client
51
+
52
+ __version__ = "0.3.0"
53
+ __all__ = [
54
+ # Clients (preferred top-level names)
55
+ "Cortex",
56
+ "AsyncCortex",
57
+ # Explicit v1 names (identical classes, kept for code that pinned them)
58
+ "V1Client",
59
+ "AsyncV1Client",
60
+ # Submodule
61
+ "v1",
62
+ # Exceptions
63
+ "V1Error",
64
+ "V1APIError",
65
+ "V1AuthError",
66
+ "V1ConnectionError",
67
+ "V1TimeoutError",
68
+ "V1RateLimitError",
69
+ "V1NotConfiguredError",
70
+ "V1PolicyDeniedError",
71
+ ]
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cortexdbai"
7
- version = "0.2.5"
7
+ version = "0.3.0"
8
8
  description = "The Long-Term Memory Layer for AI Systems"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -1,116 +0,0 @@
1
- """CortexDB Python SDK — The Long-Term Memory Layer for AI Systems.
2
-
3
- Two API surfaces are available:
4
-
5
- * The top-level :class:`Cortex` / :class:`AsyncCortex` clients target the
6
- legacy v0 endpoints (``/v1/remember``, ``/v1/recall``, ``/v1/answer``
7
- with the v0 request shape) served on port 3141 by default. Used by
8
- existing integrations.
9
- * The :mod:`cortexdb.v1` submodule targets the new v1 surface
10
- (``/v1/experience``, stratified-pack recall, layered ``/v1/answer``,
11
- ``/v1/episodes``, ``/v1/beliefs``, ``/v1/understanding``,
12
- ``/v1/admin/layers/stats``, ``/v1/audit``, ``/v1/forget``) served on
13
- port 3142 in dual-port deployments, with PASETO/JWT bearer auth.
14
- New apps should use :class:`cortexdb.v1.V1Client`.
15
-
16
- Quick start (v1):
17
-
18
- .. code-block:: python
19
-
20
- from cortexdb.v1 import V1Client
21
-
22
- with V1Client("https://api.cortexdb.ai", actor="user:alice", bearer=token) as c:
23
- c.experience_bulk("org:initech/user:alice", [{"text": "hello"}])
24
- out = c.answer("org:initech/user:alice", "what did I say?",
25
- question_type="single-session-user")
26
- print(out["answer"])
27
- """
28
-
29
- from cortexdb.client import AsyncCortex, Cortex
30
- from cortexdb import v1 # re-export the v1 namespace
31
- from cortexdb.exceptions import (
32
- CortexAPIError,
33
- CortexAuthError,
34
- CortexConnectionError,
35
- CortexError,
36
- CortexRateLimitError,
37
- CortexTimeoutError,
38
- )
39
- from cortexdb.models import (
40
- Actor,
41
- ActorType,
42
- BlobRef,
43
- ContentType,
44
- EntityRef,
45
- EntityRelationship,
46
- EntityResponse,
47
- Episode,
48
- EpisodeBrief,
49
- EpisodeType,
50
- ForgetRequest,
51
- ForgetResponse,
52
- HealthResponse,
53
- IngestEpisodeRequest,
54
- IngestEpisodeResponse,
55
- LinkResponse,
56
- ListEpisodesResponse,
57
- MetricsResponse,
58
- ProcessingStatus,
59
- RecallMemory,
60
- RecallRequest,
61
- RecallResponse,
62
- RememberRequest,
63
- RememberResponse,
64
- SearchResponse,
65
- Source,
66
- Visibility,
67
- VisibilityLevel,
68
- )
69
-
70
- __version__ = "0.2.5"
71
- __all__ = [
72
- # v1 surface (recommended for new apps)
73
- "v1",
74
- # Legacy v0 clients
75
- "Cortex",
76
- "AsyncCortex",
77
- # Enums
78
- "EpisodeType",
79
- "ActorType",
80
- "VisibilityLevel",
81
- "ContentType",
82
- "ProcessingStatus",
83
- # Core models
84
- "Actor",
85
- "Source",
86
- "Visibility",
87
- "EntityRef",
88
- "Episode",
89
- "BlobRef",
90
- "RecallMemory",
91
- # Request models
92
- "IngestEpisodeRequest",
93
- "RememberRequest",
94
- "RecallRequest",
95
- "ForgetRequest",
96
- # Response models
97
- "IngestEpisodeResponse",
98
- "RememberResponse",
99
- "RecallResponse",
100
- "ForgetResponse",
101
- "ListEpisodesResponse",
102
- "HealthResponse",
103
- "MetricsResponse",
104
- "EntityResponse",
105
- "EntityRelationship",
106
- "EpisodeBrief",
107
- "LinkResponse",
108
- "SearchResponse",
109
- # Exceptions
110
- "CortexError",
111
- "CortexAPIError",
112
- "CortexConnectionError",
113
- "CortexTimeoutError",
114
- "CortexAuthError",
115
- "CortexRateLimitError",
116
- ]