Metadata-Version: 2.4
Name: hindsight-daily
Version: 0.2.0
Summary: Syncs Obsidian daily notes to Hindsight so they can be recalled by AI agents.
Author: Sergey Storchay
Author-email: Sergey Storchay <r8@r8.com.ua>
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: click>=8.3.3
Requires-Dist: loguru>=0.7.0
Requires-Dist: confuse>=2.2.0
Requires-Dist: diskcache>=5.6.3
Requires-Dist: hindsight-client>=0.5.4
Requires-Dist: platformdirs>=4.9.6
Requires-Dist: python-frontmatter>=1.1.0
Requires-Dist: markdown-it-py>=3.0.0
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/r8/hindsight-daily
Project-URL: Issues, https://github.com/r8/hindsight-daily/issues
Description-Content-Type: text/markdown

# hindsight-daily

[![CI](https://github.com/r8/hindsight-daily/actions/workflows/ci.yml/badge.svg)](https://github.com/r8/hindsight-daily/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/hindsight-daily.svg)](https://pypi.org/project/hindsight-daily/)

Syncs Obsidian daily notes to [Hindsight](https://hindsight.vectorize.io) so they can be recalled by AI agents.

## How it works

Walks a configured vault directory, finds notes named `YYYY-MM-DD.md`, parses them into structured sections, and submits new or changed notes to Hindsight via its API. Unchanged notes are skipped. Deleted notes are removed from Hindsight.

Change detection uses a content hash (not mtime) because Obsidian plugins frequently touch mtime without changing content.

## Installation

```bash
uv tool install hindsight-daily
```

or with pip:

```bash
pip install hindsight-daily
```

## Config

Config lives in `~/.config/hindsight-daily/config.yaml` (XDG-compliant):

```yaml
bank_id: your-bank-id
api_key: your-api-key
api_url:                    # optional, for local Hindsight installations
daily_notes_path: /path/to/vault/journals
verbose: false
```

## Usage

```bash
hindsight-daily sync           # sync new and changed notes
hindsight-daily sync --limit 5 # sync at most 5 notes
hindsight-daily forget DATE    # remove a note from server and cache
hindsight-daily status         # show pending/up-to-date counts
hindsight-daily -v status      # show individual note dates
hindsight-daily -v sync        # sync with debug logging
```

## Content structure

Each section of a note is submitted as a separate Hindsight document (e.g. `journal:2024-01-07_001`, `journal:2024-01-07_002`). The `journal:` prefix namespaces documents to avoid collisions with other tools writing to the same bank. The shallowest heading level present in the note becomes the section boundary; deeper headings are merged into their parent section as text blocks. Bullet and ordered lists preserve their markers. Blockquotes and unlabeled code blocks are wrapped in `<quote>` tags so Hindsight distinguishes external content from the user's own writing. Language-tagged code blocks use `<code lang="...">`. Wikilinks in section titles are extracted as scoped entity declarations so Hindsight correctly associates facts with the right entities.
