hindsight-embed 0.4.2__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.
- hindsight_embed-0.4.2/.gitignore +56 -0
- hindsight_embed-0.4.2/PKG-INFO +175 -0
- hindsight_embed-0.4.2/README.md +167 -0
- hindsight_embed-0.4.2/hindsight_embed/__init__.py +3 -0
- hindsight_embed-0.4.2/hindsight_embed/cli.py +554 -0
- hindsight_embed-0.4.2/hindsight_embed/daemon_client.py +312 -0
- hindsight_embed-0.4.2/pyproject.toml +61 -0
- hindsight_embed-0.4.2/test.sh +236 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
.mcp.json
|
|
9
|
+
.osgrep
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv
|
|
12
|
+
|
|
13
|
+
# Node
|
|
14
|
+
node_modules/
|
|
15
|
+
|
|
16
|
+
# Environment variables and local config
|
|
17
|
+
.env
|
|
18
|
+
docker-compose.yml
|
|
19
|
+
docker-compose.override.yml
|
|
20
|
+
|
|
21
|
+
# IDE
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
*.swp
|
|
25
|
+
*.swo
|
|
26
|
+
|
|
27
|
+
# NLTK data (will be downloaded automatically)
|
|
28
|
+
nltk_data/
|
|
29
|
+
|
|
30
|
+
# Monitoring stack (Prometheus/Grafana binaries and data)
|
|
31
|
+
.monitoring/
|
|
32
|
+
.pgbouncer/
|
|
33
|
+
|
|
34
|
+
# Large benchmark datasets (will be downloaded automatically)
|
|
35
|
+
**/longmemeval_s_cleaned.json
|
|
36
|
+
|
|
37
|
+
# Debug logs
|
|
38
|
+
logs/
|
|
39
|
+
|
|
40
|
+
.DS_Store
|
|
41
|
+
|
|
42
|
+
# Generated docs files
|
|
43
|
+
hindsight-docs/static/llms-full.txt
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
hindsight-dev/benchmarks/locomo/results/
|
|
47
|
+
hindsight-dev/benchmarks/longmemeval/results/
|
|
48
|
+
hindsight-dev/benchmarks/consolidation/results/
|
|
49
|
+
benchmarks/results/
|
|
50
|
+
hindsight-cli/target
|
|
51
|
+
hindsight-clients/rust/target
|
|
52
|
+
.claude
|
|
53
|
+
whats-next.md
|
|
54
|
+
TASK.md
|
|
55
|
+
# Changelog is now tracked in hindsight-docs/src/pages/changelog.md
|
|
56
|
+
# CHANGELOG.md
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hindsight-embed
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: Hindsight embedded CLI - local memory operations without a server
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: httpx>=0.27.0
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# hindsight-embed
|
|
10
|
+
|
|
11
|
+
Hindsight embedded CLI - local memory operations with automatic daemon management.
|
|
12
|
+
|
|
13
|
+
This package provides a simple CLI for storing and recalling memories using Hindsight's memory engine. It automatically manages a background daemon for fast operations - no manual server setup required.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
`hindsight-embed` uses a background daemon architecture for optimal performance:
|
|
18
|
+
|
|
19
|
+
1. **First command**: Automatically starts a local daemon (first run downloads dependencies and loads ML models - can take 1-3 minutes)
|
|
20
|
+
2. **Subsequent commands**: Near-instant responses (~1-2s) since daemon is already running
|
|
21
|
+
3. **Auto-shutdown**: Daemon automatically exits after 5 minutes of inactivity
|
|
22
|
+
|
|
23
|
+
The daemon runs on `localhost:8889` and uses an embedded PostgreSQL database (pg0) - everything stays local on your machine.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install hindsight-embed
|
|
29
|
+
# or with uvx (no install needed)
|
|
30
|
+
uvx hindsight-embed --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Interactive setup (recommended)
|
|
37
|
+
hindsight-embed configure
|
|
38
|
+
|
|
39
|
+
# Or set your LLM API key manually
|
|
40
|
+
export OPENAI_API_KEY=sk-...
|
|
41
|
+
|
|
42
|
+
# Store a memory (bank_id = "default")
|
|
43
|
+
hindsight-embed memory retain default "User prefers dark mode"
|
|
44
|
+
|
|
45
|
+
# Recall memories
|
|
46
|
+
hindsight-embed memory recall default "What are user preferences?"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
### configure
|
|
52
|
+
|
|
53
|
+
Interactive setup wizard:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
hindsight-embed configure
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This will:
|
|
60
|
+
- Let you choose an LLM provider (OpenAI, Groq, Google, Ollama)
|
|
61
|
+
- Configure your API key
|
|
62
|
+
- Set the model and memory bank ID
|
|
63
|
+
- Start the daemon with your configuration
|
|
64
|
+
|
|
65
|
+
### memory retain
|
|
66
|
+
|
|
67
|
+
Store a memory:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
hindsight-embed memory retain default "User prefers dark mode"
|
|
71
|
+
hindsight-embed memory retain default "Meeting on Monday" --context work
|
|
72
|
+
hindsight-embed memory retain myproject "API uses JWT authentication"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### memory recall
|
|
76
|
+
|
|
77
|
+
Search memories:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
hindsight-embed memory recall default "user preferences"
|
|
81
|
+
hindsight-embed memory recall default "upcoming events"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Use `-o json` for JSON output:
|
|
85
|
+
```bash
|
|
86
|
+
hindsight-embed memory recall default "user preferences" -o json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### memory reflect
|
|
90
|
+
|
|
91
|
+
Get contextual answers that synthesize multiple memories:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
hindsight-embed memory reflect default "How should I set up the dev environment?"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### bank list
|
|
98
|
+
|
|
99
|
+
List all memory banks:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
hindsight-embed bank list
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### daemon
|
|
106
|
+
|
|
107
|
+
Manage the background daemon:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
hindsight-embed daemon status # Check if daemon is running
|
|
111
|
+
hindsight-embed daemon start # Start the daemon
|
|
112
|
+
hindsight-embed daemon stop # Stop the daemon
|
|
113
|
+
hindsight-embed daemon logs # View last 50 lines of logs
|
|
114
|
+
hindsight-embed daemon logs -f # Follow logs in real-time
|
|
115
|
+
hindsight-embed daemon logs -n 100 # View last 100 lines
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Configuration
|
|
119
|
+
|
|
120
|
+
### Interactive Setup
|
|
121
|
+
|
|
122
|
+
Run `hindsight-embed configure` for a guided setup that saves to `~/.hindsight/embed`.
|
|
123
|
+
|
|
124
|
+
### Environment Variables
|
|
125
|
+
|
|
126
|
+
| Variable | Description | Default |
|
|
127
|
+
|----------|-------------|---------|
|
|
128
|
+
| `HINDSIGHT_EMBED_LLM_API_KEY` | LLM API key (or use `OPENAI_API_KEY`) | Required |
|
|
129
|
+
| `HINDSIGHT_EMBED_LLM_PROVIDER` | LLM provider (`openai`, `groq`, `google`, `ollama`) | `openai` |
|
|
130
|
+
| `HINDSIGHT_EMBED_LLM_MODEL` | LLM model | `gpt-4o-mini` |
|
|
131
|
+
| `HINDSIGHT_EMBED_BANK_ID` | Memory bank ID | `default` |
|
|
132
|
+
|
|
133
|
+
### Files
|
|
134
|
+
|
|
135
|
+
| Path | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `~/.hindsight/embed` | Configuration file |
|
|
138
|
+
| `~/.hindsight/config.env` | Alternative config file location |
|
|
139
|
+
| `~/.hindsight/daemon.log` | Daemon logs |
|
|
140
|
+
| `~/.hindsight/daemon.lock` | Daemon lock file (PID) |
|
|
141
|
+
|
|
142
|
+
## Use with AI Coding Assistants
|
|
143
|
+
|
|
144
|
+
This CLI is designed to work with AI coding assistants like Claude Code, Cursor, and Windsurf. Install the Hindsight skill:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
curl -fsSL https://hindsight.vectorize.io/get-skill | bash
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
This will configure the LLM provider and install the skill to your assistant's skills directory.
|
|
151
|
+
|
|
152
|
+
## Troubleshooting
|
|
153
|
+
|
|
154
|
+
**Daemon won't start:**
|
|
155
|
+
```bash
|
|
156
|
+
# Check logs for errors
|
|
157
|
+
hindsight-embed daemon logs
|
|
158
|
+
|
|
159
|
+
# Stop any stuck daemon and restart
|
|
160
|
+
hindsight-embed daemon stop
|
|
161
|
+
hindsight-embed daemon start
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Slow first command:**
|
|
165
|
+
This is expected - the first command needs to download dependencies, start the daemon, and load ML models. First run can take 1-3 minutes depending on network speed. Subsequent commands will be fast (~1-2s).
|
|
166
|
+
|
|
167
|
+
**Change configuration:**
|
|
168
|
+
```bash
|
|
169
|
+
# Re-run configure (automatically restarts daemon)
|
|
170
|
+
hindsight-embed configure
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
Apache 2.0
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# hindsight-embed
|
|
2
|
+
|
|
3
|
+
Hindsight embedded CLI - local memory operations with automatic daemon management.
|
|
4
|
+
|
|
5
|
+
This package provides a simple CLI for storing and recalling memories using Hindsight's memory engine. It automatically manages a background daemon for fast operations - no manual server setup required.
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
`hindsight-embed` uses a background daemon architecture for optimal performance:
|
|
10
|
+
|
|
11
|
+
1. **First command**: Automatically starts a local daemon (first run downloads dependencies and loads ML models - can take 1-3 minutes)
|
|
12
|
+
2. **Subsequent commands**: Near-instant responses (~1-2s) since daemon is already running
|
|
13
|
+
3. **Auto-shutdown**: Daemon automatically exits after 5 minutes of inactivity
|
|
14
|
+
|
|
15
|
+
The daemon runs on `localhost:8889` and uses an embedded PostgreSQL database (pg0) - everything stays local on your machine.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install hindsight-embed
|
|
21
|
+
# or with uvx (no install needed)
|
|
22
|
+
uvx hindsight-embed --help
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Interactive setup (recommended)
|
|
29
|
+
hindsight-embed configure
|
|
30
|
+
|
|
31
|
+
# Or set your LLM API key manually
|
|
32
|
+
export OPENAI_API_KEY=sk-...
|
|
33
|
+
|
|
34
|
+
# Store a memory (bank_id = "default")
|
|
35
|
+
hindsight-embed memory retain default "User prefers dark mode"
|
|
36
|
+
|
|
37
|
+
# Recall memories
|
|
38
|
+
hindsight-embed memory recall default "What are user preferences?"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
### configure
|
|
44
|
+
|
|
45
|
+
Interactive setup wizard:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
hindsight-embed configure
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This will:
|
|
52
|
+
- Let you choose an LLM provider (OpenAI, Groq, Google, Ollama)
|
|
53
|
+
- Configure your API key
|
|
54
|
+
- Set the model and memory bank ID
|
|
55
|
+
- Start the daemon with your configuration
|
|
56
|
+
|
|
57
|
+
### memory retain
|
|
58
|
+
|
|
59
|
+
Store a memory:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
hindsight-embed memory retain default "User prefers dark mode"
|
|
63
|
+
hindsight-embed memory retain default "Meeting on Monday" --context work
|
|
64
|
+
hindsight-embed memory retain myproject "API uses JWT authentication"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### memory recall
|
|
68
|
+
|
|
69
|
+
Search memories:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
hindsight-embed memory recall default "user preferences"
|
|
73
|
+
hindsight-embed memory recall default "upcoming events"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use `-o json` for JSON output:
|
|
77
|
+
```bash
|
|
78
|
+
hindsight-embed memory recall default "user preferences" -o json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### memory reflect
|
|
82
|
+
|
|
83
|
+
Get contextual answers that synthesize multiple memories:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
hindsight-embed memory reflect default "How should I set up the dev environment?"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### bank list
|
|
90
|
+
|
|
91
|
+
List all memory banks:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
hindsight-embed bank list
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### daemon
|
|
98
|
+
|
|
99
|
+
Manage the background daemon:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
hindsight-embed daemon status # Check if daemon is running
|
|
103
|
+
hindsight-embed daemon start # Start the daemon
|
|
104
|
+
hindsight-embed daemon stop # Stop the daemon
|
|
105
|
+
hindsight-embed daemon logs # View last 50 lines of logs
|
|
106
|
+
hindsight-embed daemon logs -f # Follow logs in real-time
|
|
107
|
+
hindsight-embed daemon logs -n 100 # View last 100 lines
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Configuration
|
|
111
|
+
|
|
112
|
+
### Interactive Setup
|
|
113
|
+
|
|
114
|
+
Run `hindsight-embed configure` for a guided setup that saves to `~/.hindsight/embed`.
|
|
115
|
+
|
|
116
|
+
### Environment Variables
|
|
117
|
+
|
|
118
|
+
| Variable | Description | Default |
|
|
119
|
+
|----------|-------------|---------|
|
|
120
|
+
| `HINDSIGHT_EMBED_LLM_API_KEY` | LLM API key (or use `OPENAI_API_KEY`) | Required |
|
|
121
|
+
| `HINDSIGHT_EMBED_LLM_PROVIDER` | LLM provider (`openai`, `groq`, `google`, `ollama`) | `openai` |
|
|
122
|
+
| `HINDSIGHT_EMBED_LLM_MODEL` | LLM model | `gpt-4o-mini` |
|
|
123
|
+
| `HINDSIGHT_EMBED_BANK_ID` | Memory bank ID | `default` |
|
|
124
|
+
|
|
125
|
+
### Files
|
|
126
|
+
|
|
127
|
+
| Path | Description |
|
|
128
|
+
|------|-------------|
|
|
129
|
+
| `~/.hindsight/embed` | Configuration file |
|
|
130
|
+
| `~/.hindsight/config.env` | Alternative config file location |
|
|
131
|
+
| `~/.hindsight/daemon.log` | Daemon logs |
|
|
132
|
+
| `~/.hindsight/daemon.lock` | Daemon lock file (PID) |
|
|
133
|
+
|
|
134
|
+
## Use with AI Coding Assistants
|
|
135
|
+
|
|
136
|
+
This CLI is designed to work with AI coding assistants like Claude Code, Cursor, and Windsurf. Install the Hindsight skill:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
curl -fsSL https://hindsight.vectorize.io/get-skill | bash
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
This will configure the LLM provider and install the skill to your assistant's skills directory.
|
|
143
|
+
|
|
144
|
+
## Troubleshooting
|
|
145
|
+
|
|
146
|
+
**Daemon won't start:**
|
|
147
|
+
```bash
|
|
148
|
+
# Check logs for errors
|
|
149
|
+
hindsight-embed daemon logs
|
|
150
|
+
|
|
151
|
+
# Stop any stuck daemon and restart
|
|
152
|
+
hindsight-embed daemon stop
|
|
153
|
+
hindsight-embed daemon start
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Slow first command:**
|
|
157
|
+
This is expected - the first command needs to download dependencies, start the daemon, and load ML models. First run can take 1-3 minutes depending on network speed. Subsequent commands will be fast (~1-2s).
|
|
158
|
+
|
|
159
|
+
**Change configuration:**
|
|
160
|
+
```bash
|
|
161
|
+
# Re-run configure (automatically restarts daemon)
|
|
162
|
+
hindsight-embed configure
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
Apache 2.0
|