hindsight-api 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl
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.
- hindsight_api-0.1.7.dist-info/METADATA +178 -0
- {hindsight_api-0.1.6.dist-info → hindsight_api-0.1.7.dist-info}/RECORD +4 -4
- hindsight_api-0.1.6.dist-info/METADATA +0 -42
- {hindsight_api-0.1.6.dist-info → hindsight_api-0.1.7.dist-info}/WHEEL +0 -0
- {hindsight_api-0.1.6.dist-info → hindsight_api-0.1.7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hindsight-api
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Hindsight: Agent Memory That Works Like Human Memory
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: alembic>=1.17.1
|
|
7
|
+
Requires-Dist: asyncpg>=0.29.0
|
|
8
|
+
Requires-Dist: dateparser>=1.2.2
|
|
9
|
+
Requires-Dist: fastapi[standard]>=0.120.3
|
|
10
|
+
Requires-Dist: fastmcp>=2.3.0
|
|
11
|
+
Requires-Dist: google-genai>=1.0.0
|
|
12
|
+
Requires-Dist: greenlet>=3.2.4
|
|
13
|
+
Requires-Dist: httpx>=0.27.0
|
|
14
|
+
Requires-Dist: langchain-text-splitters>=0.3.0
|
|
15
|
+
Requires-Dist: openai>=1.0.0
|
|
16
|
+
Requires-Dist: opentelemetry-api>=1.20.0
|
|
17
|
+
Requires-Dist: opentelemetry-exporter-prometheus>=0.41b0
|
|
18
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.41b0
|
|
19
|
+
Requires-Dist: opentelemetry-sdk>=1.20.0
|
|
20
|
+
Requires-Dist: pg0-embedded>=0.11.0
|
|
21
|
+
Requires-Dist: pgvector>=0.4.1
|
|
22
|
+
Requires-Dist: psycopg2-binary>=2.9.11
|
|
23
|
+
Requires-Dist: pydantic>=2.0.0
|
|
24
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
25
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
26
|
+
Requires-Dist: rich>=13.0.0
|
|
27
|
+
Requires-Dist: sentence-transformers<3.3.0,>=3.0.0
|
|
28
|
+
Requires-Dist: sqlalchemy>=2.0.44
|
|
29
|
+
Requires-Dist: tiktoken>=0.12.0
|
|
30
|
+
Requires-Dist: torch>=2.0.0
|
|
31
|
+
Requires-Dist: transformers<4.46.0,>=4.30.0
|
|
32
|
+
Requires-Dist: uvicorn>=0.38.0
|
|
33
|
+
Requires-Dist: wsproto>=1.0.0
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: filelock>=3.0.0; extra == 'test'
|
|
36
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
|
|
37
|
+
Requires-Dist: pytest-timeout>=2.4.0; extra == 'test'
|
|
38
|
+
Requires-Dist: pytest-xdist>=3.0.0; extra == 'test'
|
|
39
|
+
Requires-Dist: pytest>=7.0.0; extra == 'test'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# Hindsight API
|
|
43
|
+
|
|
44
|
+
**Memory System for AI Agents** — Temporal + Semantic + Entity Memory Architecture using PostgreSQL with pgvector.
|
|
45
|
+
|
|
46
|
+
Hindsight gives AI agents persistent memory that works like human memory: it stores facts, tracks entities and relationships, handles temporal reasoning ("what happened last spring?"), and forms opinions based on configurable disposition traits.
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install hindsight-api
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### Run the Server
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Set your LLM provider
|
|
60
|
+
export HINDSIGHT_API_LLM_PROVIDER=openai
|
|
61
|
+
export HINDSIGHT_API_LLM_API_KEY=sk-xxxxxxxxxxxx
|
|
62
|
+
|
|
63
|
+
# Start the server (uses embedded PostgreSQL by default)
|
|
64
|
+
hindsight-api
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The server starts at http://localhost:8888 with:
|
|
68
|
+
- REST API for memory operations
|
|
69
|
+
- MCP server at `/mcp` for tool-use integration
|
|
70
|
+
|
|
71
|
+
### Use the Python API
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from hindsight_api import MemoryEngine
|
|
75
|
+
|
|
76
|
+
# Create and initialize the memory engine
|
|
77
|
+
memory = MemoryEngine()
|
|
78
|
+
await memory.initialize()
|
|
79
|
+
|
|
80
|
+
# Create a memory bank for your agent
|
|
81
|
+
bank = await memory.create_memory_bank(
|
|
82
|
+
name="my-assistant",
|
|
83
|
+
background="A helpful coding assistant"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Store a memory
|
|
87
|
+
await memory.retain(
|
|
88
|
+
memory_bank_id=bank.id,
|
|
89
|
+
content="The user prefers Python for data science projects"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Recall memories
|
|
93
|
+
results = await memory.recall(
|
|
94
|
+
memory_bank_id=bank.id,
|
|
95
|
+
query="What programming language does the user prefer?"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
# Reflect with reasoning
|
|
99
|
+
response = await memory.reflect(
|
|
100
|
+
memory_bank_id=bank.id,
|
|
101
|
+
query="Should I recommend Python or R for this ML project?"
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## CLI Options
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
hindsight-api --help
|
|
109
|
+
|
|
110
|
+
# Common options
|
|
111
|
+
hindsight-api --port 9000 # Custom port (default: 8888)
|
|
112
|
+
hindsight-api --host 127.0.0.1 # Bind to localhost only
|
|
113
|
+
hindsight-api --workers 4 # Multiple worker processes
|
|
114
|
+
hindsight-api --log-level debug # Verbose logging
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
Configure via environment variables:
|
|
120
|
+
|
|
121
|
+
| Variable | Description | Default |
|
|
122
|
+
|----------|-------------|---------|
|
|
123
|
+
| `HINDSIGHT_API_DATABASE_URL` | PostgreSQL connection string | `pg0` (embedded) |
|
|
124
|
+
| `HINDSIGHT_API_LLM_PROVIDER` | `openai`, `groq`, `gemini`, `ollama` | `openai` |
|
|
125
|
+
| `HINDSIGHT_API_LLM_API_KEY` | API key for LLM provider | - |
|
|
126
|
+
| `HINDSIGHT_API_LLM_MODEL` | Model name | `gpt-4o-mini` |
|
|
127
|
+
| `HINDSIGHT_API_HOST` | Server bind address | `0.0.0.0` |
|
|
128
|
+
| `HINDSIGHT_API_PORT` | Server port | `8888` |
|
|
129
|
+
|
|
130
|
+
### Example with External PostgreSQL
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
export HINDSIGHT_API_DATABASE_URL=postgresql://user:pass@localhost:5432/hindsight
|
|
134
|
+
export HINDSIGHT_API_LLM_PROVIDER=groq
|
|
135
|
+
export HINDSIGHT_API_LLM_API_KEY=gsk_xxxxxxxxxxxx
|
|
136
|
+
|
|
137
|
+
hindsight-api
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Docker
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
docker run --rm -it -p 8888:8888 \
|
|
144
|
+
-e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
|
|
145
|
+
-v $HOME/.hindsight-docker:/home/hindsight/.pg0 \
|
|
146
|
+
ghcr.io/vectorize-io/hindsight:latest
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## MCP Server
|
|
150
|
+
|
|
151
|
+
For local MCP integration without running the full API server:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
hindsight-local-mcp
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This runs a stdio-based MCP server that can be used directly with MCP-compatible clients.
|
|
158
|
+
|
|
159
|
+
## Key Features
|
|
160
|
+
|
|
161
|
+
- **Multi-Strategy Retrieval (TEMPR)** — Semantic, keyword, graph, and temporal search combined with RRF fusion
|
|
162
|
+
- **Entity Graph** — Automatic entity extraction and relationship tracking
|
|
163
|
+
- **Temporal Reasoning** — Native support for time-based queries
|
|
164
|
+
- **Disposition Traits** — Configurable skepticism, literalism, and empathy influence opinion formation
|
|
165
|
+
- **Three Memory Types** — World facts, bank actions, and formed opinions with confidence scores
|
|
166
|
+
|
|
167
|
+
## Documentation
|
|
168
|
+
|
|
169
|
+
Full documentation: [https://hindsight.vectorize.io](https://hindsight.vectorize.io)
|
|
170
|
+
|
|
171
|
+
- [Installation Guide](https://hindsight.vectorize.io/developer/installation)
|
|
172
|
+
- [Configuration Reference](https://hindsight.vectorize.io/developer/configuration)
|
|
173
|
+
- [API Reference](https://hindsight.vectorize.io/api-reference)
|
|
174
|
+
- [Python SDK](https://hindsight.vectorize.io/sdks/python)
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
Apache 2.0
|
|
@@ -58,7 +58,7 @@ hindsight_api/engine/search/think_utils.py,sha256=rTRyoefRkZc65gcPQtffKiqHinpi7r
|
|
|
58
58
|
hindsight_api/engine/search/trace.py,sha256=UTCmNRfAvIvDFGm5ifkuUk6JOKYrLlA_rPA72Zz_DfI,11217
|
|
59
59
|
hindsight_api/engine/search/tracer.py,sha256=6OFlkRy_41gr2kgJZ1cmxnerUO069wPfnmiQrMvkOpg,15459
|
|
60
60
|
hindsight_api/engine/search/types.py,sha256=2cK-5oynPTWc7UxnA7TFnwzNkcujCfOUvVf5VCk_srM,5594
|
|
61
|
-
hindsight_api-0.1.
|
|
62
|
-
hindsight_api-0.1.
|
|
63
|
-
hindsight_api-0.1.
|
|
64
|
-
hindsight_api-0.1.
|
|
61
|
+
hindsight_api-0.1.7.dist-info/METADATA,sha256=c085oifvdxY8hwMLZ6vGZFRLWH9DmnvKR7KTWKU-dxk,5407
|
|
62
|
+
hindsight_api-0.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
63
|
+
hindsight_api-0.1.7.dist-info/entry_points.txt,sha256=vqZv5WLHbSx8vyec5RtMlUqtE_ul7DTgEVODSmou6Og,109
|
|
64
|
+
hindsight_api-0.1.7.dist-info/RECORD,,
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hindsight-api
|
|
3
|
-
Version: 0.1.6
|
|
4
|
-
Summary: Temporal + Semantic + Entity Memory System for AI agents using PostgreSQL
|
|
5
|
-
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: alembic>=1.17.1
|
|
7
|
-
Requires-Dist: asyncpg>=0.29.0
|
|
8
|
-
Requires-Dist: dateparser>=1.2.2
|
|
9
|
-
Requires-Dist: fastapi[standard]>=0.120.3
|
|
10
|
-
Requires-Dist: fastmcp>=2.3.0
|
|
11
|
-
Requires-Dist: google-genai>=1.0.0
|
|
12
|
-
Requires-Dist: greenlet>=3.2.4
|
|
13
|
-
Requires-Dist: httpx>=0.27.0
|
|
14
|
-
Requires-Dist: langchain-text-splitters>=0.3.0
|
|
15
|
-
Requires-Dist: openai>=1.0.0
|
|
16
|
-
Requires-Dist: opentelemetry-api>=1.20.0
|
|
17
|
-
Requires-Dist: opentelemetry-exporter-prometheus>=0.41b0
|
|
18
|
-
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.41b0
|
|
19
|
-
Requires-Dist: opentelemetry-sdk>=1.20.0
|
|
20
|
-
Requires-Dist: pg0-embedded>=0.11.0
|
|
21
|
-
Requires-Dist: pgvector>=0.4.1
|
|
22
|
-
Requires-Dist: psycopg2-binary>=2.9.11
|
|
23
|
-
Requires-Dist: pydantic>=2.0.0
|
|
24
|
-
Requires-Dist: python-dateutil>=2.8.0
|
|
25
|
-
Requires-Dist: python-dotenv>=1.0.0
|
|
26
|
-
Requires-Dist: rich>=13.0.0
|
|
27
|
-
Requires-Dist: sentence-transformers<3.3.0,>=3.0.0
|
|
28
|
-
Requires-Dist: sqlalchemy>=2.0.44
|
|
29
|
-
Requires-Dist: tiktoken>=0.12.0
|
|
30
|
-
Requires-Dist: torch<2.6.0,>=2.0.0
|
|
31
|
-
Requires-Dist: transformers<4.46.0,>=4.30.0
|
|
32
|
-
Requires-Dist: uvicorn>=0.38.0
|
|
33
|
-
Requires-Dist: wsproto>=1.0.0
|
|
34
|
-
Provides-Extra: test
|
|
35
|
-
Requires-Dist: filelock>=3.0.0; extra == 'test'
|
|
36
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
|
|
37
|
-
Requires-Dist: pytest-timeout>=2.4.0; extra == 'test'
|
|
38
|
-
Requires-Dist: pytest-xdist>=3.0.0; extra == 'test'
|
|
39
|
-
Requires-Dist: pytest>=7.0.0; extra == 'test'
|
|
40
|
-
Description-Content-Type: text/markdown
|
|
41
|
-
|
|
42
|
-
# Memory
|
|
File without changes
|
|
File without changes
|