memro 0.2.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.
memro-0.2.0/LICENSE ADDED
@@ -0,0 +1,75 @@
1
+ Required Notice: Copyright 2026 Memro (https://memro.co)
2
+
3
+ # PolyForm Noncommercial License 1.0.0
4
+
5
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
6
+
7
+ ## Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
+
15
+ ## Distribution License
16
+
17
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
+
19
+ ## Notices
20
+
21
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
22
+
23
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
24
+
25
+ ## Changes and New Works License
26
+
27
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
28
+
29
+ ## Patent License
30
+
31
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
32
+
33
+ ## Noncommercial Purposes
34
+
35
+ Any noncommercial purpose is a permitted purpose.
36
+
37
+ ## Personal Uses
38
+
39
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
40
+
41
+ ## Noncommercial Organizations
42
+
43
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
44
+
45
+ ## Fair Use
46
+
47
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
48
+
49
+ ## No Other Rights
50
+
51
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
52
+
53
+ ## Patent Defense
54
+
55
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
56
+
57
+ ## Violations
58
+
59
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
60
+
61
+ ## No Liability
62
+
63
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
64
+
65
+ ## Definitions
66
+
67
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
68
+
69
+ **You** refers to the individual or entity agreeing to these terms.
70
+
71
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
+
73
+ **Your licenses** are all the licenses granted to you for the software under these terms.
74
+
75
+ **Use** means anything you do with the software requiring one of your licenses.
memro-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: memro
3
+ Version: 0.2.0
4
+ Summary: Memro — verified memory infrastructure for AI agents
5
+ Author-email: memro Team <sdk@memro.co>
6
+ License: LicenseRef-PolyForm-Noncommercial-1.0.0
7
+ Project-URL: Homepage, https://memro.co
8
+ Project-URL: Documentation, https://docs.memro.co/sdk/python
9
+ Project-URL: Repository, https://github.com/memrohq/memro
10
+ Project-URL: Issues, https://github.com/memrohq/memro/issues
11
+ Keywords: ai-agents,agent-memory,mcp,llm
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pynacl>=1.5.0
24
+ Requires-Dist: requests>=2.31.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Provides-Extra: langchain
27
+ Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
28
+ Provides-Extra: mcp
29
+ Requires-Dist: mcp<2,>=1.0.0; extra == "mcp"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
33
+ Requires-Dist: black>=23.0.0; extra == "dev"
34
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # Memro Python SDK
39
+
40
+ Verified memory infrastructure for AI agents.
41
+
42
+ ## Install
43
+
44
+ ```bash
45
+ # PyPI (once published via CI):
46
+ pip install memro
47
+
48
+ # Install from source:
49
+ pip install .
50
+ ```
51
+
52
+ ## Quick Example
53
+
54
+ ```python
55
+ from memro import Agent
56
+
57
+ agent = Agent.create() # Generates sovereign Ed25519 identity
58
+ mem = agent.remember("The billing service was rewritten in Go")
59
+ results = agent.recall("billing service language")
60
+ print(results[0].content)
61
+ ```
62
+
63
+ ## Connect
64
+
65
+ ```python
66
+ from memro import Agent
67
+
68
+ agent = Agent.from_env() # MEMRO_API_KEY (and optional MEMRO_BASE_URL)
69
+ agent = Agent.from_api_key("memro_sk_...") # explicit key, Memro Cloud
70
+ agent = Agent.connect("memro_sk_...", base_url="http://localhost:8081") # self-hosted
71
+ ```
72
+
73
+ Self-owned identity (the private key is generated here and never sent):
74
+
75
+ ```python
76
+ agent = Agent.create() # registers the public key
77
+ agent.save("identity.json") # keep secret; it can't be recovered
78
+ agent = Agent.from_file("identity.json")
79
+ ```
80
+
81
+ `Agent.from_env()` also accepts `MEMRO_AGENT_ID` + `MEMRO_PRIVATE_KEY`.
82
+
83
+ ## Memories
84
+
85
+ ```python
86
+ m = agent.remember(
87
+ "The billing service was rewritten in Go",
88
+ type="semantic", # episodic | semantic | procedural | profile | None (auto)
89
+ visibility="private",
90
+ event_date="2026-03-01T00:00:00Z", # optional
91
+ session_id=None, # optional UUID
92
+ metadata={"source": "standup"},
93
+ )
94
+ agent.get_recent(limit=20, type="profile") # list[Memory], newest first
95
+ agent.delete_memory(m.id) # True, or False if it didn't exist
96
+ agent.export() # ExportData(total, memories, ...)
97
+ ```
98
+
99
+ ## Search
100
+
101
+ ```python
102
+ for r in agent.recall("what language is billing in?", limit=5, mode="hybrid", min_score=0.3):
103
+ print(r.score, r.content) # SearchResult
104
+
105
+ agent.recall_temporal("deploy incidents", after_date="2026-09-01T00:00:00Z", temporal_weight=0.6)
106
+ ```
107
+
108
+ `mode` is `hybrid` (default), `semantic` or `keyword`.
109
+
110
+ ## Memory engine
111
+
112
+ ```python
113
+ ans = agent.reason("why did 500s spike after the billing release?")
114
+ print(ans.answer, ans.confidence, ans.based_on)
115
+
116
+ agent.evolve() # EvolutionResult
117
+ agent.resolve_conflict(a_id, b_id) # {"Resolved": id} or {"Ambiguous": [...]}
118
+ agent.memory_chain(m.id) # MemoryChain
119
+ agent.timeline(m.id) # MemoryTimeline
120
+ agent.stats() # TemporalStats
121
+ agent.usage() # dict
122
+ ```
123
+
124
+ ## Files and webhooks
125
+
126
+ ```python
127
+ up = agent.upload_file("notes.pdf") # stores the file and a memory of its text
128
+ up = agent.upload_file(("notes.txt", b"...", "text/plain"), remember=False)
129
+ agent.upload_image("whiteboard.png") # Memory with a description
130
+ agent.upload_document("handbook.docx") # PDF/Word/PowerPoint/Excel/text -> list[Memory]
131
+
132
+ agent.add_webhook("https://example.com/memro-hook")
133
+ agent.webhooks()
134
+ agent.remove_webhook("https://example.com/memro-hook")
135
+ ```
136
+
137
+ ## Errors and retries
138
+
139
+ ```python
140
+ from memro import MemroError, RateLimitError
141
+
142
+ try:
143
+ agent.remember("...")
144
+ except RateLimitError:
145
+ ... # 429 after the automatic retries
146
+ except MemroError as e:
147
+ print(e.status_code, e.message)
148
+ ```
149
+
150
+ `MemroClient(timeout=30, max_retries=2)`: rate-limited requests are retried
151
+ (honouring `Retry-After`); gateway errors are retried only for `GET` and
152
+ `DELETE`, so a memory is never stored twice.
153
+
154
+ ## LangChain
155
+
156
+ ```python
157
+ from memro.integrations.langchain import MemroMemory # pip install "memro[langchain]"
158
+ memory = MemroMemory(agent=agent)
159
+ ```
160
+
161
+ ## Low-level client
162
+
163
+ `agent.client` is a `MemroClient` with one method per endpoint
164
+ (`search`, `search_temporal`, `reason`, `upload_file`, …) and
165
+ `request(method, path, params=, json_body=, files=)` for anything else.
166
+ Requests are signed with [v2 signatures](https://github.com/memrohq/memro/blob/main/docs/authentication.md#signed-requests)
167
+ when there is no API key.
168
+
169
+ See the [API reference](https://github.com/memrohq/memro/blob/main/docs/api-reference.md) for response fields.
170
+
171
+ ---
172
+
173
+ Repository: [github.com/memrohq/memro](https://github.com/memrohq/memro) · Documentation: [https://memro.co](https://memro.co)
174
+ License: Source available under [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0). Free for non-commercial use; commercial use through Memro Cloud or a commercial license.
memro-0.2.0/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # Memro Python SDK
2
+
3
+ Verified memory infrastructure for AI agents.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # PyPI (once published via CI):
9
+ pip install memro
10
+
11
+ # Install from source:
12
+ pip install .
13
+ ```
14
+
15
+ ## Quick Example
16
+
17
+ ```python
18
+ from memro import Agent
19
+
20
+ agent = Agent.create() # Generates sovereign Ed25519 identity
21
+ mem = agent.remember("The billing service was rewritten in Go")
22
+ results = agent.recall("billing service language")
23
+ print(results[0].content)
24
+ ```
25
+
26
+ ## Connect
27
+
28
+ ```python
29
+ from memro import Agent
30
+
31
+ agent = Agent.from_env() # MEMRO_API_KEY (and optional MEMRO_BASE_URL)
32
+ agent = Agent.from_api_key("memro_sk_...") # explicit key, Memro Cloud
33
+ agent = Agent.connect("memro_sk_...", base_url="http://localhost:8081") # self-hosted
34
+ ```
35
+
36
+ Self-owned identity (the private key is generated here and never sent):
37
+
38
+ ```python
39
+ agent = Agent.create() # registers the public key
40
+ agent.save("identity.json") # keep secret; it can't be recovered
41
+ agent = Agent.from_file("identity.json")
42
+ ```
43
+
44
+ `Agent.from_env()` also accepts `MEMRO_AGENT_ID` + `MEMRO_PRIVATE_KEY`.
45
+
46
+ ## Memories
47
+
48
+ ```python
49
+ m = agent.remember(
50
+ "The billing service was rewritten in Go",
51
+ type="semantic", # episodic | semantic | procedural | profile | None (auto)
52
+ visibility="private",
53
+ event_date="2026-03-01T00:00:00Z", # optional
54
+ session_id=None, # optional UUID
55
+ metadata={"source": "standup"},
56
+ )
57
+ agent.get_recent(limit=20, type="profile") # list[Memory], newest first
58
+ agent.delete_memory(m.id) # True, or False if it didn't exist
59
+ agent.export() # ExportData(total, memories, ...)
60
+ ```
61
+
62
+ ## Search
63
+
64
+ ```python
65
+ for r in agent.recall("what language is billing in?", limit=5, mode="hybrid", min_score=0.3):
66
+ print(r.score, r.content) # SearchResult
67
+
68
+ agent.recall_temporal("deploy incidents", after_date="2026-09-01T00:00:00Z", temporal_weight=0.6)
69
+ ```
70
+
71
+ `mode` is `hybrid` (default), `semantic` or `keyword`.
72
+
73
+ ## Memory engine
74
+
75
+ ```python
76
+ ans = agent.reason("why did 500s spike after the billing release?")
77
+ print(ans.answer, ans.confidence, ans.based_on)
78
+
79
+ agent.evolve() # EvolutionResult
80
+ agent.resolve_conflict(a_id, b_id) # {"Resolved": id} or {"Ambiguous": [...]}
81
+ agent.memory_chain(m.id) # MemoryChain
82
+ agent.timeline(m.id) # MemoryTimeline
83
+ agent.stats() # TemporalStats
84
+ agent.usage() # dict
85
+ ```
86
+
87
+ ## Files and webhooks
88
+
89
+ ```python
90
+ up = agent.upload_file("notes.pdf") # stores the file and a memory of its text
91
+ up = agent.upload_file(("notes.txt", b"...", "text/plain"), remember=False)
92
+ agent.upload_image("whiteboard.png") # Memory with a description
93
+ agent.upload_document("handbook.docx") # PDF/Word/PowerPoint/Excel/text -> list[Memory]
94
+
95
+ agent.add_webhook("https://example.com/memro-hook")
96
+ agent.webhooks()
97
+ agent.remove_webhook("https://example.com/memro-hook")
98
+ ```
99
+
100
+ ## Errors and retries
101
+
102
+ ```python
103
+ from memro import MemroError, RateLimitError
104
+
105
+ try:
106
+ agent.remember("...")
107
+ except RateLimitError:
108
+ ... # 429 after the automatic retries
109
+ except MemroError as e:
110
+ print(e.status_code, e.message)
111
+ ```
112
+
113
+ `MemroClient(timeout=30, max_retries=2)`: rate-limited requests are retried
114
+ (honouring `Retry-After`); gateway errors are retried only for `GET` and
115
+ `DELETE`, so a memory is never stored twice.
116
+
117
+ ## LangChain
118
+
119
+ ```python
120
+ from memro.integrations.langchain import MemroMemory # pip install "memro[langchain]"
121
+ memory = MemroMemory(agent=agent)
122
+ ```
123
+
124
+ ## Low-level client
125
+
126
+ `agent.client` is a `MemroClient` with one method per endpoint
127
+ (`search`, `search_temporal`, `reason`, `upload_file`, …) and
128
+ `request(method, path, params=, json_body=, files=)` for anything else.
129
+ Requests are signed with [v2 signatures](https://github.com/memrohq/memro/blob/main/docs/authentication.md#signed-requests)
130
+ when there is no API key.
131
+
132
+ See the [API reference](https://github.com/memrohq/memro/blob/main/docs/api-reference.md) for response fields.
133
+
134
+ ---
135
+
136
+ Repository: [github.com/memrohq/memro](https://github.com/memrohq/memro) · Documentation: [https://memro.co](https://memro.co)
137
+ License: Source available under [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0). Free for non-commercial use; commercial use through Memro Cloud or a commercial license.
@@ -0,0 +1,75 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "memro"
7
+ version = "0.2.0"
8
+ description = "Memro — verified memory infrastructure for AI agents"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "LicenseRef-PolyForm-Noncommercial-1.0.0"}
12
+ authors = [
13
+ {name = "memro Team", email = "sdk@memro.co"}
14
+ ]
15
+ keywords = ["ai-agents", "agent-memory", "mcp", "llm"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.8",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ ]
26
+
27
+ dependencies = [
28
+ "pynacl>=1.5.0",
29
+ "requests>=2.31.0",
30
+ "pydantic>=2.0.0",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ langchain = [
35
+ "langchain-core>=0.1.0",
36
+ ]
37
+ mcp = [
38
+ "mcp>=1.0.0,<2",
39
+ ]
40
+ dev = [
41
+ "pytest>=7.0.0",
42
+ "pytest-cov>=4.0.0",
43
+ "black>=23.0.0",
44
+ "ruff>=0.1.0",
45
+ "mypy>=1.0.0",
46
+ ]
47
+
48
+ [project.urls]
49
+ Homepage = "https://memro.co"
50
+ Documentation = "https://docs.memro.co/sdk/python"
51
+ Repository = "https://github.com/memrohq/memro"
52
+ Issues = "https://github.com/memrohq/memro/issues"
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
56
+
57
+ [tool.black]
58
+ line-length = 100
59
+ target-version = ["py38", "py39", "py310", "py311"]
60
+
61
+ [tool.ruff]
62
+ line-length = 100
63
+ target-version = "py38"
64
+
65
+ [tool.mypy]
66
+ python_version = "3.8"
67
+ warn_return_any = true
68
+ warn_unused_configs = true
69
+ disallow_untyped_defs = true
70
+
71
+ [tool.pytest.ini_options]
72
+ testpaths = ["tests"]
73
+ python_files = ["test_*.py"]
74
+ python_classes = ["Test*"]
75
+ python_functions = ["test_*"]
memro-0.2.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,39 @@
1
+ """
2
+ memro — AI agent memory infrastructure SDK for Python.
3
+
4
+ Quickstart:
5
+ from memro import Agent
6
+
7
+ agent = Agent.from_env() # MEMRO_API_KEY=memro_sk_...
8
+ agent.remember("User prefers dark mode", type="profile")
9
+ results = agent.recall("user preferences")
10
+ """
11
+ from .agent import Agent
12
+ from .client import MemroClient, MemroError, RateLimitError
13
+ from .models import (
14
+ Memory, SearchResult, ExportData, HealthStatus, TemporalSearchResult,
15
+ ReasoningResult, EvolutionResult, MemoryTimeline, MemoryChain, TemporalStats, UploadedFile,
16
+ )
17
+ from .crypto import generate_keypair, sign_request
18
+
19
+ __all__ = [
20
+ "Agent",
21
+ "MemroClient",
22
+ "MemroError",
23
+ "RateLimitError",
24
+ "TemporalSearchResult",
25
+ "ReasoningResult",
26
+ "EvolutionResult",
27
+ "MemoryTimeline",
28
+ "MemoryChain",
29
+ "TemporalStats",
30
+ "UploadedFile",
31
+ "sign_request",
32
+ "Memory",
33
+ "SearchResult",
34
+ "ExportData",
35
+ "HealthStatus",
36
+ "generate_keypair",
37
+ ]
38
+
39
+ __version__ = "0.2.0"