sovant 1.0.0__tar.gz → 1.0.3__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.

Potentially problematic release.


This version of sovant might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Sovant AI
3
+ Copyright (c) 2025 Sovant
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
sovant-1.0.3/PKG-INFO ADDED
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: sovant
3
+ Version: 1.0.3
4
+ Summary: Sovant Memory-as-a-Service Python SDK
5
+ Author: Sovant
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: httpx>=0.27.0
11
+ Requires-Dist: pydantic>=2.8.2
12
+ Dynamic: license-file
13
+
14
+ # Sovant Python SDK
15
+
16
+ **AI Infrastructure: Memory-as-a-Service for AI systems.**
17
+ The official Python client for the Sovant Memory API.
18
+
19
+ [![PyPI version](https://img.shields.io/pypi/v/sovant)](https://pypi.org/project/sovant/)
20
+ [![Documentation](https://img.shields.io/badge/docs-sovant.ai-blue)](https://sovant.ai/docs)
21
+ [![GitHub](https://img.shields.io/badge/github-sovant-lightgrey)](https://github.com/sovant-ai/sovant)
22
+
23
+ ---
24
+
25
+ ## What is Sovant?
26
+
27
+ Sovant is an **AI infrastructure company** providing the **memory layer for AI systems**.
28
+ Our platform makes it simple to persist, search, and manage conversational/context data securely across sessions, channels, and applications.
29
+
30
+ - **Problem:** Most AI systems forget once a session ends → compliance risk, knowledge loss, poor UX.
31
+ - **Solution:** Sovant provides a **Memory-as-a-Service API** — store, retrieve, and search memories with audit-ready controls.
32
+ - **Built for:** Developers & enterprises building AI agents, copilots, or compliance-driven apps that need persistent context.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install sovant
40
+ ```
41
+
42
+ ## 60-Second Quickstart
43
+
44
+ ```python
45
+ from sovant import Sovant, MemoryCreate, SearchQuery
46
+
47
+ client = Sovant(api_key="YOUR_API_KEY")
48
+
49
+ # Create a memory
50
+ created = client.memory_create(MemoryCreate(
51
+ content="User prefers morning meetings",
52
+ type="preference",
53
+ tags=["customer:123"],
54
+ # metadata={"source": "crm"},
55
+ # thread_id="00000000-0000-0000-0000-000000000000",
56
+ ))
57
+ print(created)
58
+
59
+ # Search memories
60
+ results = client.memory_search(SearchQuery(
61
+ query="meeting preferences",
62
+ topK=3,
63
+ # tags=["customer:123"],
64
+ # thread_id="...",
65
+ ))
66
+ print(results)
67
+ ```
68
+
69
+ ## Features
70
+
71
+ - **Memory CRUD** — create, retrieve, update (PATCH/PUT), delete
72
+ - **Semantic Search** — full-text/semantic with topK and filters
73
+ - **Threads** — group related memories via thread_id (REST API)
74
+ - **Batch Operations (Beta)** — atomic multi-operation requests
75
+ - **Compliance-ready** — audit trails, PDPA/GDPR-friendly design
76
+ - **SDKs** — official Python & TypeScript clients + REST reference
77
+
78
+ ## SDKs & Documentation
79
+
80
+ - **Python** (this package) on PyPI: https://pypi.org/project/sovant/
81
+ - **TypeScript** on npm: https://www.npmjs.com/package/@sovant/sdk
82
+ - **REST API Reference**: https://sovant.ai/docs/api
83
+ - **Full Documentation**: https://sovant.ai/docs
84
+
85
+ ## API Overview
86
+
87
+ ### Endpoints Summary
88
+
89
+ - `POST /api/v1/memory` — Create memory
90
+ - `GET /api/v1/memory` — List memories
91
+ - `GET /api/v1/memories/{id}` — Get by ID
92
+ - `PATCH | PUT /api/v1/memories/{id}` — Update
93
+ - `DELETE /api/v1/memories/{id}` — Delete
94
+ - `GET /api/v1/memory/search` — Search
95
+ - `POST /api/v1/memory/batch` — Batch (Beta)
96
+
97
+ **Auth:** Bearer token in the `Authorization` header.
98
+
99
+ ## Field Mapping Note
100
+
101
+ - **API expects:** `content` (required), optional `type`, `tags`, `metadata`, `thread_id`.
102
+ - **SDK convenience:** Some client methods may accept `data` and map it to `content` internally.
103
+ - **Deprecated:** `subject` is ignored by the API. Use `thread_id`, `tags`, or `metadata` for grouping.
104
+
105
+ ## Status of Advanced Features
106
+
107
+ - **Batch API:** Available, marked Beta (contract may evolve).
108
+ - **Threads:** Fully supported via REST API.
109
+ - **Webhooks / Personalization / Multi-Channel Sync:** Coming soon.
110
+
111
+ ## Versioning & Changelog
112
+
113
+ - **Stable baseline:** 1.0.3
114
+ - See [CHANGELOG.md](https://github.com/sovant-ai/sovant) in the repo for details.
115
+
116
+ ## License
117
+
118
+ MIT © Sovant AI
sovant-1.0.3/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # Sovant Python SDK
2
+
3
+ **AI Infrastructure: Memory-as-a-Service for AI systems.**
4
+ The official Python client for the Sovant Memory API.
5
+
6
+ [![PyPI version](https://img.shields.io/pypi/v/sovant)](https://pypi.org/project/sovant/)
7
+ [![Documentation](https://img.shields.io/badge/docs-sovant.ai-blue)](https://sovant.ai/docs)
8
+ [![GitHub](https://img.shields.io/badge/github-sovant-lightgrey)](https://github.com/sovant-ai/sovant)
9
+
10
+ ---
11
+
12
+ ## What is Sovant?
13
+
14
+ Sovant is an **AI infrastructure company** providing the **memory layer for AI systems**.
15
+ Our platform makes it simple to persist, search, and manage conversational/context data securely across sessions, channels, and applications.
16
+
17
+ - **Problem:** Most AI systems forget once a session ends → compliance risk, knowledge loss, poor UX.
18
+ - **Solution:** Sovant provides a **Memory-as-a-Service API** — store, retrieve, and search memories with audit-ready controls.
19
+ - **Built for:** Developers & enterprises building AI agents, copilots, or compliance-driven apps that need persistent context.
20
+
21
+ ---
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ pip install sovant
27
+ ```
28
+
29
+ ## 60-Second Quickstart
30
+
31
+ ```python
32
+ from sovant import Sovant, MemoryCreate, SearchQuery
33
+
34
+ client = Sovant(api_key="YOUR_API_KEY")
35
+
36
+ # Create a memory
37
+ created = client.memory_create(MemoryCreate(
38
+ content="User prefers morning meetings",
39
+ type="preference",
40
+ tags=["customer:123"],
41
+ # metadata={"source": "crm"},
42
+ # thread_id="00000000-0000-0000-0000-000000000000",
43
+ ))
44
+ print(created)
45
+
46
+ # Search memories
47
+ results = client.memory_search(SearchQuery(
48
+ query="meeting preferences",
49
+ topK=3,
50
+ # tags=["customer:123"],
51
+ # thread_id="...",
52
+ ))
53
+ print(results)
54
+ ```
55
+
56
+ ## Features
57
+
58
+ - **Memory CRUD** — create, retrieve, update (PATCH/PUT), delete
59
+ - **Semantic Search** — full-text/semantic with topK and filters
60
+ - **Threads** — group related memories via thread_id (REST API)
61
+ - **Batch Operations (Beta)** — atomic multi-operation requests
62
+ - **Compliance-ready** — audit trails, PDPA/GDPR-friendly design
63
+ - **SDKs** — official Python & TypeScript clients + REST reference
64
+
65
+ ## SDKs & Documentation
66
+
67
+ - **Python** (this package) on PyPI: https://pypi.org/project/sovant/
68
+ - **TypeScript** on npm: https://www.npmjs.com/package/@sovant/sdk
69
+ - **REST API Reference**: https://sovant.ai/docs/api
70
+ - **Full Documentation**: https://sovant.ai/docs
71
+
72
+ ## API Overview
73
+
74
+ ### Endpoints Summary
75
+
76
+ - `POST /api/v1/memory` — Create memory
77
+ - `GET /api/v1/memory` — List memories
78
+ - `GET /api/v1/memories/{id}` — Get by ID
79
+ - `PATCH | PUT /api/v1/memories/{id}` — Update
80
+ - `DELETE /api/v1/memories/{id}` — Delete
81
+ - `GET /api/v1/memory/search` — Search
82
+ - `POST /api/v1/memory/batch` — Batch (Beta)
83
+
84
+ **Auth:** Bearer token in the `Authorization` header.
85
+
86
+ ## Field Mapping Note
87
+
88
+ - **API expects:** `content` (required), optional `type`, `tags`, `metadata`, `thread_id`.
89
+ - **SDK convenience:** Some client methods may accept `data` and map it to `content` internally.
90
+ - **Deprecated:** `subject` is ignored by the API. Use `thread_id`, `tags`, or `metadata` for grouping.
91
+
92
+ ## Status of Advanced Features
93
+
94
+ - **Batch API:** Available, marked Beta (contract may evolve).
95
+ - **Threads:** Fully supported via REST API.
96
+ - **Webhooks / Personalization / Multi-Channel Sync:** Coming soon.
97
+
98
+ ## Versioning & Changelog
99
+
100
+ - **Stable baseline:** 1.0.3
101
+ - See [CHANGELOG.md](https://github.com/sovant-ai/sovant) in the repo for details.
102
+
103
+ ## License
104
+
105
+ MIT © Sovant AI
@@ -0,0 +1,13 @@
1
+ [project]
2
+ name = "sovant"
3
+ version = "1.0.3"
4
+ description = "Sovant Memory-as-a-Service Python SDK"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ license = {text = "MIT"}
8
+ authors = [{name = "Sovant"}]
9
+ dependencies = ["httpx>=0.27.0","pydantic>=2.8.2"]
10
+
11
+ [build-system]
12
+ requires = ["setuptools>=68","wheel","build"]
13
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ from .client import Sovant, SovantError
2
+ from .models import MemoryCreate, MemoryResult, SearchQuery
3
+
4
+ __version__ = "0.1.0"
@@ -0,0 +1,90 @@
1
+ import os
2
+ import json
3
+ import httpx
4
+ from typing import Any, Dict
5
+ from .models import MemoryCreate, SearchQuery
6
+
7
+ class SovantError(Exception):
8
+ def __init__(self, message: str, code: str, status: int | None = None, details: Any | None = None):
9
+ super().__init__(message)
10
+ self.code = code
11
+ self.status = status
12
+ self.details = details
13
+
14
+ class Sovant:
15
+ def __init__(self, api_key: str | None = None, base_url: str | None = None, timeout: float = 30.0):
16
+ self.api_key = api_key or os.getenv("SOVANT_API_KEY")
17
+ if not self.api_key:
18
+ raise ValueError("Missing api_key")
19
+ self.base_url = (base_url or os.getenv("SOVANT_BASE_URL") or "https://api.sovant.ai").rstrip("/")
20
+ self.timeout = timeout
21
+ self._client = httpx.Client(
22
+ timeout=self.timeout,
23
+ headers={
24
+ "authorization": f"Bearer {self.api_key}",
25
+ "content-type": "application/json"
26
+ }
27
+ )
28
+
29
+ def _handle(self, r: httpx.Response):
30
+ if r.status_code >= 400:
31
+ try:
32
+ body = r.json()
33
+ except Exception:
34
+ body = {"message": r.text}
35
+ msg = body.get("message") or r.reason_phrase
36
+ code = body.get("code") or f"HTTP_{r.status_code}"
37
+ raise SovantError(msg, code, r.status_code, body)
38
+ if not r.text:
39
+ return None
40
+ try:
41
+ return r.json()
42
+ except Exception:
43
+ return r.text
44
+
45
+ def memory_create(self, create: MemoryCreate):
46
+ # Convert data field to content field for API
47
+ body = create.model_dump()
48
+ if 'data' in body:
49
+ body['content'] = json.dumps(body.pop('data')) if not isinstance(body.get('data'), str) else body.pop('data')
50
+
51
+ # Ensure type has a default
52
+ if 'type' not in body or body['type'] is None:
53
+ body['type'] = 'journal'
54
+
55
+ r = self._client.post(f"{self.base_url}/v1/memory", content=json.dumps(body))
56
+ return self._handle(r)
57
+
58
+ def memory_get(self, id: str):
59
+ r = self._client.get(f"{self.base_url}/v1/memories/{id}")
60
+ return self._handle(r)
61
+
62
+ def memory_search(self, q: SearchQuery):
63
+ params = {}
64
+ if q.query:
65
+ params['query'] = q.query
66
+ if q.type:
67
+ params['type'] = q.type
68
+ if q.tags:
69
+ params['tags'] = ','.join(q.tags)
70
+ if q.thread_id:
71
+ params['thread_id'] = q.thread_id
72
+ if q.limit:
73
+ params['limit'] = str(q.limit)
74
+ if q.from_date:
75
+ params['from_date'] = q.from_date
76
+ if q.to_date:
77
+ params['to_date'] = q.to_date
78
+ r = self._client.get(f"{self.base_url}/v1/memory/search", params=params)
79
+ return self._handle(r)
80
+
81
+ def memory_update(self, id: str, patch: Dict[str, Any]):
82
+ # Convert data field to content field if present
83
+ if 'data' in patch:
84
+ patch['content'] = json.dumps(patch.pop('data')) if not isinstance(patch.get('data'), str) else patch.pop('data')
85
+ r = self._client.patch(f"{self.base_url}/v1/memories/{id}", content=json.dumps(patch))
86
+ return self._handle(r)
87
+
88
+ def memory_delete(self, id: str):
89
+ r = self._client.delete(f"{self.base_url}/v1/memories/{id}")
90
+ return self._handle(r)
@@ -0,0 +1,30 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Any, Dict, List, Optional, Literal
3
+
4
+ class MemoryCreate(BaseModel):
5
+ data: Any
6
+ type: Optional[Literal['journal', 'insight', 'observation', 'task', 'preference']] = 'journal'
7
+ ttl: Optional[str] = None
8
+ tags: Optional[List[str]] = None
9
+ metadata: Optional[Dict[str, Any]] = None
10
+ thread_id: Optional[str] = None
11
+
12
+ class MemoryResult(BaseModel):
13
+ id: str
14
+ content: str
15
+ type: str
16
+ ttl: Optional[str] = None
17
+ tags: Optional[List[str]] = None
18
+ metadata: Optional[Dict[str, Any]] = None
19
+ thread_id: Optional[str] = None
20
+ created_at: Optional[str] = None
21
+ updated_at: Optional[str] = None
22
+
23
+ class SearchQuery(BaseModel):
24
+ query: Optional[str] = None
25
+ type: Optional[str] = None
26
+ tags: Optional[List[str]] = None
27
+ thread_id: Optional[str] = None
28
+ limit: Optional[int] = Field(default=10, ge=1, le=100)
29
+ from_date: Optional[str] = None
30
+ to_date: Optional[str] = None
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: sovant
3
+ Version: 1.0.3
4
+ Summary: Sovant Memory-as-a-Service Python SDK
5
+ Author: Sovant
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: httpx>=0.27.0
11
+ Requires-Dist: pydantic>=2.8.2
12
+ Dynamic: license-file
13
+
14
+ # Sovant Python SDK
15
+
16
+ **AI Infrastructure: Memory-as-a-Service for AI systems.**
17
+ The official Python client for the Sovant Memory API.
18
+
19
+ [![PyPI version](https://img.shields.io/pypi/v/sovant)](https://pypi.org/project/sovant/)
20
+ [![Documentation](https://img.shields.io/badge/docs-sovant.ai-blue)](https://sovant.ai/docs)
21
+ [![GitHub](https://img.shields.io/badge/github-sovant-lightgrey)](https://github.com/sovant-ai/sovant)
22
+
23
+ ---
24
+
25
+ ## What is Sovant?
26
+
27
+ Sovant is an **AI infrastructure company** providing the **memory layer for AI systems**.
28
+ Our platform makes it simple to persist, search, and manage conversational/context data securely across sessions, channels, and applications.
29
+
30
+ - **Problem:** Most AI systems forget once a session ends → compliance risk, knowledge loss, poor UX.
31
+ - **Solution:** Sovant provides a **Memory-as-a-Service API** — store, retrieve, and search memories with audit-ready controls.
32
+ - **Built for:** Developers & enterprises building AI agents, copilots, or compliance-driven apps that need persistent context.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install sovant
40
+ ```
41
+
42
+ ## 60-Second Quickstart
43
+
44
+ ```python
45
+ from sovant import Sovant, MemoryCreate, SearchQuery
46
+
47
+ client = Sovant(api_key="YOUR_API_KEY")
48
+
49
+ # Create a memory
50
+ created = client.memory_create(MemoryCreate(
51
+ content="User prefers morning meetings",
52
+ type="preference",
53
+ tags=["customer:123"],
54
+ # metadata={"source": "crm"},
55
+ # thread_id="00000000-0000-0000-0000-000000000000",
56
+ ))
57
+ print(created)
58
+
59
+ # Search memories
60
+ results = client.memory_search(SearchQuery(
61
+ query="meeting preferences",
62
+ topK=3,
63
+ # tags=["customer:123"],
64
+ # thread_id="...",
65
+ ))
66
+ print(results)
67
+ ```
68
+
69
+ ## Features
70
+
71
+ - **Memory CRUD** — create, retrieve, update (PATCH/PUT), delete
72
+ - **Semantic Search** — full-text/semantic with topK and filters
73
+ - **Threads** — group related memories via thread_id (REST API)
74
+ - **Batch Operations (Beta)** — atomic multi-operation requests
75
+ - **Compliance-ready** — audit trails, PDPA/GDPR-friendly design
76
+ - **SDKs** — official Python & TypeScript clients + REST reference
77
+
78
+ ## SDKs & Documentation
79
+
80
+ - **Python** (this package) on PyPI: https://pypi.org/project/sovant/
81
+ - **TypeScript** on npm: https://www.npmjs.com/package/@sovant/sdk
82
+ - **REST API Reference**: https://sovant.ai/docs/api
83
+ - **Full Documentation**: https://sovant.ai/docs
84
+
85
+ ## API Overview
86
+
87
+ ### Endpoints Summary
88
+
89
+ - `POST /api/v1/memory` — Create memory
90
+ - `GET /api/v1/memory` — List memories
91
+ - `GET /api/v1/memories/{id}` — Get by ID
92
+ - `PATCH | PUT /api/v1/memories/{id}` — Update
93
+ - `DELETE /api/v1/memories/{id}` — Delete
94
+ - `GET /api/v1/memory/search` — Search
95
+ - `POST /api/v1/memory/batch` — Batch (Beta)
96
+
97
+ **Auth:** Bearer token in the `Authorization` header.
98
+
99
+ ## Field Mapping Note
100
+
101
+ - **API expects:** `content` (required), optional `type`, `tags`, `metadata`, `thread_id`.
102
+ - **SDK convenience:** Some client methods may accept `data` and map it to `content` internally.
103
+ - **Deprecated:** `subject` is ignored by the API. Use `thread_id`, `tags`, or `metadata` for grouping.
104
+
105
+ ## Status of Advanced Features
106
+
107
+ - **Batch API:** Available, marked Beta (contract may evolve).
108
+ - **Threads:** Fully supported via REST API.
109
+ - **Webhooks / Personalization / Multi-Channel Sync:** Coming soon.
110
+
111
+ ## Versioning & Changelog
112
+
113
+ - **Stable baseline:** 1.0.3
114
+ - See [CHANGELOG.md](https://github.com/sovant-ai/sovant) in the repo for details.
115
+
116
+ ## License
117
+
118
+ MIT © Sovant AI
@@ -6,6 +6,7 @@ src/sovant/__init__.py
6
6
  src/sovant/base_client.py
7
7
  src/sovant/client.py
8
8
  src/sovant/exceptions.py
9
+ src/sovant/models.py
9
10
  src/sovant/types.py
10
11
  src/sovant.egg-info/PKG-INFO
11
12
  src/sovant.egg-info/SOURCES.txt
@@ -0,0 +1,2 @@
1
+ httpx>=0.27.0
2
+ pydantic>=2.8.2