Skip to content

Commit 3e72984

Browse files
committed
chunks
1 parent 18a7dc4 commit 3e72984

83 files changed

Lines changed: 1020629 additions & 1712052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,15 @@
1-
# =============================================================================
2-
# HINDSIGHT ENVIRONMENT CONFIGURATION
3-
# =============================================================================
4-
# Copy this file to .env and update with your values
5-
# Both services (API and Control Plane) read from this single file
1+
# Hindsight Environment Variables
2+
# Copy this file to .env and fill in your values
63

7-
# =============================================================================
8-
# API SERVICE (HINDSIGHT_API_*)
9-
# =============================================================================
4+
# LLM Configuration (Required)
5+
HINDSIGHT_API_LLM_API_KEY=your-api-key-here
6+
HINDSIGHT_API_LLM_MODEL=gpt-4o-mini
7+
HINDSIGHT_API_LLM_BASE_URL=https://api.openai.com/v1
108

11-
# Database
12-
# Use "pg0" to start an embedded PostgreSQL instance via pg0
13-
# Or provide a full connection URL for external PostgreSQL
14-
#HINDSIGHT_API_DATABASE_URL=postgresql://hindsight:hindsight_dev@localhost:5432/hindsight
15-
HINDSIGHT_API_DATABASE_URL=pg0
9+
# API Configuration (Optional)
10+
HINDSIGHT_API_HOST=0.0.0.0
11+
HINDSIGHT_API_PORT=8888
12+
HINDSIGHT_API_LOG_LEVEL=info
1613

17-
# pg0 data directory (only used when HINDSIGHT_API_DATABASE_URL=pg0)
18-
# HINDSIGHT_API_PG0_DATA_DIR=/path/to/pg_data
19-
20-
# LLM Provider: "openai", "groq", or "ollama"
21-
HINDSIGHT_API_LLM_PROVIDER=groq
22-
23-
# LLM Model (provider-specific)
24-
HINDSIGHT_API_LLM_MODEL=openai/gpt-oss-20b
25-
26-
# API Key (not needed for ollama)
27-
HINDSIGHT_API_LLM_API_KEY=your_api_key_here
28-
29-
# Optional: Custom base URL (for ollama or custom endpoints)
30-
# HINDSIGHT_API_LLM_BASE_URL=http://localhost:11434/v1
31-
32-
# API Server Configuration (optional)
33-
# HINDSIGHT_API_HOST=0.0.0.0
34-
# HINDSIGHT_API_PORT=8888
35-
36-
HINDSIGHT_API_MCP_ENABLED=true
37-
38-
# =============================================================================
39-
# CONTROL PLANE SERVICE (HINDSIGHT_CP_*)
40-
# =============================================================================
41-
42-
# Dataplane API URL (where the control plane connects to)
43-
HINDSIGHT_CP_DATAPLANE_API_URL=http://localhost:8888
44-
45-
# Control Plane Server Configuration (optional)
46-
# HINDSIGHT_CP_PORT=3000
47-
# HINDSIGHT_CP_HOSTNAME=0.0.0.0
14+
# Database (Optional - uses embedded pg0 by default)
15+
# HINDSIGHT_API_DATABASE_URL=postgresql://user:pass@host:5432/db

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Docs to GitHub Pages
22

33
on:
44
push:
5-
branches: [main, renaming-pre-launch]
5+
branches: [main]
66
paths:
77
- 'hindsight-docs/**'
88
- '.github/workflows/deploy-docs.yml'

HINDSIGHT_PAPER.md

Lines changed: 965 additions & 0 deletions
Large diffs are not rendered by default.

PAPER_PERSONALITY.md

Lines changed: 0 additions & 696 deletions
This file was deleted.

PAPER_RETRIEVAL.md

Lines changed: 0 additions & 875 deletions
This file was deleted.

docker/README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Hindsight Docker
2+
3+
Run Hindsight with Docker in standalone or distributed mode.
4+
5+
## Quick Start (Standalone)
6+
7+
```bash
8+
cd docker
9+
./start.sh
10+
```
11+
12+
**Force rebuild after code changes:**
13+
```bash
14+
./start.sh --build # Quick: rebuild and start
15+
# or
16+
./rebuild.sh # Complete: rebuild from scratch (no cache)
17+
```
18+
19+
Access:
20+
- **Control Plane**: http://localhost:3000
21+
- **API**: http://localhost:8888
22+
23+
Press `Ctrl+C` to stop.
24+
25+
## What You Get
26+
27+
**Standalone** (default, simple):
28+
- One container with API + Control Plane + embedded database
29+
- Perfect for local development and simple deployments
30+
31+
**Distributed** (advanced):
32+
- Separate containers for API and Control Plane
33+
- Better for production, scaling, or custom configurations
34+
35+
## Deployment Modes
36+
37+
### 1. Standalone (Recommended)
38+
39+
All-in-one container with embedded pg0 database.
40+
41+
```bash
42+
./start.sh
43+
# or
44+
cd standalone
45+
docker-compose up
46+
```
47+
48+
**Data storage:** `/app/data` volume
49+
50+
### 2. Distributed (Advanced)
51+
52+
Separate API and Control Plane containers.
53+
54+
```bash
55+
cd services
56+
docker-compose up
57+
```
58+
59+
**Data storage:** `api_data` volume
60+
61+
See `services/README.md` for details.
62+
63+
## Data Management
64+
65+
**Reset data:**
66+
```bash
67+
# Standalone
68+
cd standalone && docker-compose down -v
69+
70+
# Distributed
71+
cd services && docker-compose down -v
72+
```
73+
74+
## Building Images
75+
76+
```bash
77+
# Standalone
78+
cd standalone
79+
docker build -f Dockerfile -t hindsight:latest ../..
80+
81+
# Services
82+
cd services
83+
./build-all.sh
84+
```
85+
86+
## Using External Database
87+
88+
Both modes use embedded pg0 by default. To use external PostgreSQL:
89+
90+
```bash
91+
export HINDSIGHT_API_DATABASE_URL=postgresql://user:pass@host:5432/db
92+
```
93+
94+
## Directory Structure
95+
96+
```
97+
docker/
98+
├── start.sh # Quick start (standalone)
99+
├── README.md # This file
100+
├── standalone/ # All-in-one deployment
101+
│ ├── Dockerfile
102+
│ ├── docker-compose.yml
103+
│ └── start-all.sh
104+
└── services/ # Distributed deployment
105+
├── docker-compose.yml
106+
├── api.Dockerfile
107+
├── control-plane.Dockerfile
108+
├── build-all.sh
109+
└── README.md
110+
```
111+
112+
## Advanced Usage
113+
114+
**Background mode:**
115+
```bash
116+
cd standalone
117+
docker-compose up -d
118+
docker-compose logs -f
119+
docker-compose down
120+
```
121+
122+
**Custom configuration:**
123+
Edit `standalone/docker-compose.yml` or `services/docker-compose.yml`
124+
125+
## Environment Variables
126+
127+
Hindsight requires configuration through environment variables (all prefixed with `HINDSIGHT_`).
128+
129+
### Required:
130+
- `HINDSIGHT_API_LLM_API_KEY` - Your LLM API key (OpenAI, Anthropic, etc.)
131+
132+
### Optional:
133+
- `HINDSIGHT_API_LLM_MODEL` - Model name (default: gpt-4o-mini)
134+
- `HINDSIGHT_API_LLM_BASE_URL` - API base URL (default: https://api.openai.com/v1)
135+
- `HINDSIGHT_API_LOG_LEVEL` - Logging level: debug, info, warning, error
136+
- `HINDSIGHT_API_DATABASE_URL` - External PostgreSQL connection (uses embedded pg0 by default)
137+
138+
### Setup Options:
139+
140+
**Option 1: .env file (recommended)**
141+
```bash
142+
# Copy example file
143+
cp .env.example .env
144+
145+
# Edit .env and add your API key
146+
HINDSIGHT_API_LLM_API_KEY=sk-...
147+
```
148+
149+
**Option 2: Export in shell**
150+
```bash
151+
export HINDSIGHT_API_LLM_API_KEY=sk-...
152+
export HINDSIGHT_API_LLM_MODEL=gpt-4o-mini
153+
```
154+
155+
The `start.sh` script automatically loads `.env` if it exists and validates the API key is set.

docker/api.Dockerfile

Lines changed: 0 additions & 51 deletions
This file was deleted.

docker/clean.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

docker/control-plane.Dockerfile

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)