Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,699 changes: 1,058 additions & 641 deletions fern/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "supermemory"
version = "5.0.0"
version = "5.0.1"
description = "The official Python library for the Supermemory API"
readme = "README.md"
license = "Apache-2.0"
Expand Down
148 changes: 145 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ client.list(
<dl>
<dd>

**include:** `typing.Optional[ListRequestInclude]` — Optional extras, matching search's include
**include:** `typing.Optional[ListRequestInclude]` — Optional extras

</dd>
</dl>
Expand Down Expand Up @@ -1797,7 +1797,7 @@ client.memories.forget_matching(
<dl>
<dd>

Retrieve one memory by ID. Optionally include its version history and connected memories (each list walks outward up to relatedLimit, nearest first) and its source document.
Retrieve one memory by ID. Optionally include its versions (up to three steps away, nearest first), its direct extends and derives links, up to relatedLimit each, and its source document.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -1863,7 +1863,7 @@ client.memories.get(
<dl>
<dd>

**related_limit:** `typing.Optional[int]` — Maximum parents, children and siblings to return, applied to each list separately. Each list walks outward from the memory, nearest first, until it reaches this many.
**related_limit:** `typing.Optional[int]` — Maximum parents, children and siblings to return, applied to each list separately. Parents and children are earlier and later versions up to three steps away, nearest first; siblings are direct extends or derives links.

</dd>
</dl>
Expand Down Expand Up @@ -2973,3 +2973,145 @@ client.organization.update(
</dl>
</details>

## Feedback
<details><summary><code>client.feedback.<a href="src/supermemory/feedback/client.py">post_feedback</a>(...) -> PostFeedbackResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Report a bug, request a feature or flag a docs problem to the Supermemory team. Built for AI agents: send structured JSON and an engineer picks it up.

Authentication is optional for requests with a usable client IP. Cross-zone Cloudflare Worker requests and requests without a client IP must provide an API key. With an API key the limit is 3 submissions per organization per UTC day; without one it is 3 per IPv4 address or IPv6 /64, shared with everyone behind that address. Authenticated submissions have a separate 200/day pool; anonymous submissions share a 20/day pool. Pass your API key to get your own quota.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from supermemory import Supermemory
from supermemory.environment import SupermemoryEnvironment

client = Supermemory(
api_key="<token>",
environment=SupermemoryEnvironment.DEFAULT,
)

client.feedback.post_feedback(
type="bug",
title="Search returns no results for documents still in indexing",
description="Documents added less than a minute ago are missing from /v4/search results even though GET /v3/documents/{id} reports status done.",
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**type:** `PostFeedbackRequestType` — Kind of feedback

</dd>
</dl>

<dl>
<dd>

**title:** `str` — One-line summary

</dd>
</dl>

<dl>
<dd>

**description:** `str` — What happened, with enough detail for an engineer to act on it

</dd>
</dl>

<dl>
<dd>

**endpoint:** `typing.Optional[str]` — API operation the feedback is about

</dd>
</dl>

<dl>
<dd>

**request_id:** `typing.Optional[str]` — Request ID of a failing call, if there is one

</dd>
</dl>

<dl>
<dd>

**expected:** `typing.Optional[str]` — What you expected to happen

</dd>
</dl>

<dl>
<dd>

**actual:** `typing.Optional[str]` — What actually happened

</dd>
</dl>

<dl>
<dd>

**client:** `typing.Optional[str]` — Agent, tool or SDK sending the feedback

</dd>
</dl>

<dl>
<dd>

**contact_email:** `typing.Optional[str]` — Where to reach you about this feedback

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

17 changes: 16 additions & 1 deletion src/supermemory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@
WebCrawlerConfig,
)
from .errors import (
BadGatewayError,
ForbiddenError,
PaymentRequiredError,
ServiceUnavailableError,
TooManyRequestsError,
UnauthorizedError,
)
from . import connectors, documents, memories, namespaces, organization, profiles
from . import connectors, documents, feedback, memories, namespaces, organization, profiles
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
from .environment import SupermemoryEnvironment
from .feedback import PostFeedbackRequestType, PostFeedbackResponse, PostFeedbackResponseParams
from .requests import (
BadRequestErrorBodyParams,
BatchAddItemResultParams,
Expand Down Expand Up @@ -276,6 +279,7 @@
WebCrawlerConfigParams,
)
_dynamic_imports: typing.Dict[str, str] = {
"BadGatewayError": ".errors",
"BadRequestErrorBody": ".types",
"BadRequestErrorBodyParams": ".requests",
"BatchAddItemResult": ".types",
Expand Down Expand Up @@ -494,6 +498,9 @@
"Pagination": ".types",
"PaginationParams": ".requests",
"PaymentRequiredError": ".errors",
"PostFeedbackRequestType": ".feedback",
"PostFeedbackResponse": ".feedback",
"PostFeedbackResponseParams": ".feedback",
"Profile": ".types",
"ProfileBuckets": ".types",
"ProfileBucketsParams": ".requests",
Expand Down Expand Up @@ -530,6 +537,7 @@
"SortOrder": ".types",
"SupermemoryEnvironment": ".environment",
"TaskType": ".types",
"TooManyRequestsError": ".errors",
"UnauthorizedError": ".errors",
"ValidationErrorResponse": ".types",
"ValidationErrorResponseErrorItem": ".types",
Expand All @@ -541,6 +549,7 @@
"WebCrawlerConfigParams": ".requests",
"connectors": ".connectors",
"documents": ".documents",
"feedback": ".feedback",
"memories": ".memories",
"namespaces": ".namespaces",
"organization": ".organization",
Expand Down Expand Up @@ -571,6 +580,7 @@ def __dir__():

__all__ = [
"AsyncSupermemory",
"BadGatewayError",
"BadRequestError",
"BadRequestErrorBody",
"BadRequestErrorBodyParams",
Expand Down Expand Up @@ -793,6 +803,9 @@ def __dir__():
"Pagination",
"PaginationParams",
"PaymentRequiredError",
"PostFeedbackRequestType",
"PostFeedbackResponse",
"PostFeedbackResponseParams",
"Profile",
"ProfileBuckets",
"ProfileBucketsParams",
Expand Down Expand Up @@ -830,6 +843,7 @@ def __dir__():
"Supermemory",
"SupermemoryEnvironment",
"TaskType",
"TooManyRequestsError",
"UnauthorizedError",
"ValidationErrorResponse",
"ValidationErrorResponseErrorItem",
Expand All @@ -841,6 +855,7 @@ def __dir__():
"WebCrawlerConfigParams",
"connectors",
"documents",
"feedback",
"memories",
"namespaces",
"organization",
Expand Down
23 changes: 21 additions & 2 deletions src/supermemory/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
if typing.TYPE_CHECKING:
from .connectors.client import AsyncConnectorsClient, ConnectorsClient
from .documents.client import AsyncDocumentsClient, DocumentsClient
from .feedback.client import AsyncFeedbackClient, FeedbackClient
from .memories.client import AsyncMemoriesClient, MemoriesClient
from .namespaces.client import AsyncNamespacesClient, NamespacesClient
from .organization.client import AsyncOrganizationClient, OrganizationClient
Expand Down Expand Up @@ -136,6 +137,7 @@ def __init__(
self._connectors: typing.Optional[ConnectorsClient] = None
self._namespaces: typing.Optional[NamespacesClient] = None
self._organization: typing.Optional[OrganizationClient] = None
self._feedback: typing.Optional[FeedbackClient] = None

@property
def with_raw_response(self) -> RawSupermemory:
Expand Down Expand Up @@ -408,7 +410,7 @@ def list(
Type-safe metadata conditions applied before pagination

include : typing.Optional[ListRequestIncludeParams]
Optional extras, matching search's include
Optional extras

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -493,6 +495,14 @@ def organization(self):
self._organization = OrganizationClient(client_wrapper=self._client_wrapper)
return self._organization

@property
def feedback(self):
if self._feedback is None:
from .feedback.client import FeedbackClient # noqa: E402

self._feedback = FeedbackClient(client_wrapper=self._client_wrapper)
return self._feedback


def _make_default_async_client(
timeout: typing.Optional[float],
Expand Down Expand Up @@ -610,6 +620,7 @@ def __init__(
self._connectors: typing.Optional[AsyncConnectorsClient] = None
self._namespaces: typing.Optional[AsyncNamespacesClient] = None
self._organization: typing.Optional[AsyncOrganizationClient] = None
self._feedback: typing.Optional[AsyncFeedbackClient] = None

@property
def with_raw_response(self) -> AsyncRawSupermemory:
Expand Down Expand Up @@ -908,7 +919,7 @@ async def list(
Type-safe metadata conditions applied before pagination

include : typing.Optional[ListRequestIncludeParams]
Optional extras, matching search's include
Optional extras

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -1001,6 +1012,14 @@ def organization(self):
self._organization = AsyncOrganizationClient(client_wrapper=self._client_wrapper)
return self._organization

@property
def feedback(self):
if self._feedback is None:
from .feedback.client import AsyncFeedbackClient # noqa: E402

self._feedback = AsyncFeedbackClient(client_wrapper=self._client_wrapper)
return self._feedback


def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SupermemoryEnvironment) -> str:
if base_url is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/supermemory/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "supermemory/5.0.0",
"User-Agent": "supermemory/5.0.1",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
Expand Down
6 changes: 6 additions & 0 deletions src/supermemory/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@
from importlib import import_module

if typing.TYPE_CHECKING:
from .bad_gateway_error import BadGatewayError
from .bad_request_error import BadRequestError
from .conflict_error import ConflictError
from .forbidden_error import ForbiddenError
from .internal_server_error import InternalServerError
from .not_found_error import NotFoundError
from .payment_required_error import PaymentRequiredError
from .service_unavailable_error import ServiceUnavailableError
from .too_many_requests_error import TooManyRequestsError
from .unauthorized_error import UnauthorizedError
_dynamic_imports: typing.Dict[str, str] = {
"BadGatewayError": ".bad_gateway_error",
"BadRequestError": ".bad_request_error",
"ConflictError": ".conflict_error",
"ForbiddenError": ".forbidden_error",
"InternalServerError": ".internal_server_error",
"NotFoundError": ".not_found_error",
"PaymentRequiredError": ".payment_required_error",
"ServiceUnavailableError": ".service_unavailable_error",
"TooManyRequestsError": ".too_many_requests_error",
"UnauthorizedError": ".unauthorized_error",
}

Expand All @@ -48,12 +52,14 @@ def __dir__():


__all__ = [
"BadGatewayError",
"BadRequestError",
"ConflictError",
"ForbiddenError",
"InternalServerError",
"NotFoundError",
"PaymentRequiredError",
"ServiceUnavailableError",
"TooManyRequestsError",
"UnauthorizedError",
]
Loading
Loading