hindsight-api 0.10.2__tar.gz → 0.10.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.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hindsight-api
3
- Version: 0.10.2
3
+ Version: 0.10.3
4
4
  Summary: Hindsight: Agent Memory That Learns
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.11
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
- Requires-Dist: hindsight-api-slim[all]==0.10.2
9
+ Requires-Dist: hindsight-api-slim[all]==0.10.3
10
10
  Dynamic: license-file
11
11
 
12
12
  # Hindsight API
@@ -41,34 +41,42 @@ The server starts at http://localhost:8888 with:
41
41
  ### Use the Python API
42
42
 
43
43
  ```python
44
- from hindsight_api import MemoryEngine
44
+ from hindsight_api.engine.memory_engine import MemoryEngine
45
+ from hindsight_api.models import RequestContext
45
46
 
46
47
  # Create and initialize the memory engine
47
48
  memory = MemoryEngine()
48
49
  await memory.initialize()
50
+ ctx = RequestContext()
49
51
 
50
52
  # Create a memory bank for your agent
51
- bank = await memory.create_memory_bank(
52
- name="my-assistant",
53
- background="A helpful coding assistant"
53
+ # (optional: banks are also auto-created on first retain)
54
+ await memory.ensure_bank_profile("my-assistant", request_context=ctx)
55
+ await memory.set_bank_mission(
56
+ "my-assistant",
57
+ "A helpful coding assistant",
58
+ request_context=ctx,
54
59
  )
55
60
 
56
61
  # Store a memory
57
- await memory.retain(
58
- memory_bank_id=bank.id,
59
- content="The user prefers Python for data science projects"
62
+ await memory.retain_async(
63
+ bank_id="my-assistant",
64
+ content="The user prefers Python for data science projects",
65
+ request_context=ctx,
60
66
  )
61
67
 
62
68
  # Recall memories
63
- results = await memory.recall(
64
- memory_bank_id=bank.id,
65
- query="What programming language does the user prefer?"
69
+ results = await memory.recall_async(
70
+ bank_id="my-assistant",
71
+ query="What programming language does the user prefer?",
72
+ request_context=ctx,
66
73
  )
67
74
 
68
75
  # Reflect with reasoning
69
- response = await memory.reflect(
70
- memory_bank_id=bank.id,
71
- query="Should I recommend Python or R for this ML project?"
76
+ answer = await memory.reflect_async(
77
+ bank_id="my-assistant",
78
+ query="Should I recommend Python or R for this ML project?",
79
+ request_context=ctx,
72
80
  )
73
81
  ```
74
82
 
@@ -145,4 +153,4 @@ Full documentation: [https://hindsight.vectorize.io](https://hindsight.vectorize
145
153
 
146
154
  ## License
147
155
 
148
- Apache 2.0
156
+ - Apache 2.0
@@ -1,14 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: hindsight-api
3
- Version: 0.10.2
4
- Summary: Hindsight: Agent Memory That Learns
5
- License-Expression: MIT
6
- Requires-Python: >=3.11
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: hindsight-api-slim[all]==0.10.2
10
- Dynamic: license-file
11
-
12
1
  # Hindsight API
13
2
 
14
3
  **Memory System for AI Agents** — Temporal + Semantic + Entity Memory Architecture using PostgreSQL with pgvector.
@@ -41,34 +30,42 @@ The server starts at http://localhost:8888 with:
41
30
  ### Use the Python API
42
31
 
43
32
  ```python
44
- from hindsight_api import MemoryEngine
33
+ from hindsight_api.engine.memory_engine import MemoryEngine
34
+ from hindsight_api.models import RequestContext
45
35
 
46
36
  # Create and initialize the memory engine
47
37
  memory = MemoryEngine()
48
38
  await memory.initialize()
39
+ ctx = RequestContext()
49
40
 
50
41
  # Create a memory bank for your agent
51
- bank = await memory.create_memory_bank(
52
- name="my-assistant",
53
- background="A helpful coding assistant"
42
+ # (optional: banks are also auto-created on first retain)
43
+ await memory.ensure_bank_profile("my-assistant", request_context=ctx)
44
+ await memory.set_bank_mission(
45
+ "my-assistant",
46
+ "A helpful coding assistant",
47
+ request_context=ctx,
54
48
  )
55
49
 
56
50
  # Store a memory
57
- await memory.retain(
58
- memory_bank_id=bank.id,
59
- content="The user prefers Python for data science projects"
51
+ await memory.retain_async(
52
+ bank_id="my-assistant",
53
+ content="The user prefers Python for data science projects",
54
+ request_context=ctx,
60
55
  )
61
56
 
62
57
  # Recall memories
63
- results = await memory.recall(
64
- memory_bank_id=bank.id,
65
- query="What programming language does the user prefer?"
58
+ results = await memory.recall_async(
59
+ bank_id="my-assistant",
60
+ query="What programming language does the user prefer?",
61
+ request_context=ctx,
66
62
  )
67
63
 
68
64
  # Reflect with reasoning
69
- response = await memory.reflect(
70
- memory_bank_id=bank.id,
71
- query="Should I recommend Python or R for this ML project?"
65
+ answer = await memory.reflect_async(
66
+ bank_id="my-assistant",
67
+ query="Should I recommend Python or R for this ML project?",
68
+ request_context=ctx,
72
69
  )
73
70
  ```
74
71
 
@@ -145,4 +142,4 @@ Full documentation: [https://hindsight.vectorize.io](https://hindsight.vectorize
145
142
 
146
143
  ## License
147
144
 
148
- Apache 2.0
145
+ - Apache 2.0
@@ -1,3 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: hindsight-api
3
+ Version: 0.10.3
4
+ Summary: Hindsight: Agent Memory That Learns
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: hindsight-api-slim[all]==0.10.3
10
+ Dynamic: license-file
11
+
1
12
  # Hindsight API
2
13
 
3
14
  **Memory System for AI Agents** — Temporal + Semantic + Entity Memory Architecture using PostgreSQL with pgvector.
@@ -30,34 +41,42 @@ The server starts at http://localhost:8888 with:
30
41
  ### Use the Python API
31
42
 
32
43
  ```python
33
- from hindsight_api import MemoryEngine
44
+ from hindsight_api.engine.memory_engine import MemoryEngine
45
+ from hindsight_api.models import RequestContext
34
46
 
35
47
  # Create and initialize the memory engine
36
48
  memory = MemoryEngine()
37
49
  await memory.initialize()
50
+ ctx = RequestContext()
38
51
 
39
52
  # Create a memory bank for your agent
40
- bank = await memory.create_memory_bank(
41
- name="my-assistant",
42
- background="A helpful coding assistant"
53
+ # (optional: banks are also auto-created on first retain)
54
+ await memory.ensure_bank_profile("my-assistant", request_context=ctx)
55
+ await memory.set_bank_mission(
56
+ "my-assistant",
57
+ "A helpful coding assistant",
58
+ request_context=ctx,
43
59
  )
44
60
 
45
61
  # Store a memory
46
- await memory.retain(
47
- memory_bank_id=bank.id,
48
- content="The user prefers Python for data science projects"
62
+ await memory.retain_async(
63
+ bank_id="my-assistant",
64
+ content="The user prefers Python for data science projects",
65
+ request_context=ctx,
49
66
  )
50
67
 
51
68
  # Recall memories
52
- results = await memory.recall(
53
- memory_bank_id=bank.id,
54
- query="What programming language does the user prefer?"
69
+ results = await memory.recall_async(
70
+ bank_id="my-assistant",
71
+ query="What programming language does the user prefer?",
72
+ request_context=ctx,
55
73
  )
56
74
 
57
75
  # Reflect with reasoning
58
- response = await memory.reflect(
59
- memory_bank_id=bank.id,
60
- query="Should I recommend Python or R for this ML project?"
76
+ answer = await memory.reflect_async(
77
+ bank_id="my-assistant",
78
+ query="Should I recommend Python or R for this ML project?",
79
+ request_context=ctx,
61
80
  )
62
81
  ```
63
82
 
@@ -134,4 +153,4 @@ Full documentation: [https://hindsight.vectorize.io](https://hindsight.vectorize
134
153
 
135
154
  ## License
136
155
 
137
- Apache 2.0
156
+ - Apache 2.0
@@ -0,0 +1 @@
1
+ hindsight-api-slim[all]==0.10.3
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hindsight-api"
7
- version = "0.10.2"
7
+ version = "0.10.3"
8
8
  description = "Hindsight: Agent Memory That Learns"
9
9
  license = "MIT"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.11"
12
12
  dependencies = [
13
- "hindsight-api-slim[all]==0.10.2",
13
+ "hindsight-api-slim[all]==0.10.3",
14
14
  ]
15
15
 
16
16
  [tool.uv.sources]
@@ -1 +0,0 @@
1
- hindsight-api-slim[all]==0.10.2
File without changes
File without changes