Local-first chat export importer for SQLite-backed AI memory workflows.
Project description
Local Chat Memory
Local Chat Memory imports exported chat text files into SQLite so private conversation history can support local AI and knowledge workflows without uploading raw transcripts.
The first supported format is LINE desktop text exports, but the core model is generic:
- import text exports into a local SQLite database
- deduplicate overlapping exports with stable fingerprints
- link people across direct and group chats
- classify noisy/system/attachment-like messages without deleting records
- search locally when context is needed
- produce redacted health reports and review checklists
No credentials, private app database parsing, screenshots, or external AI API calls are required.
Alpha Safety Notice
This is an early local-first tool. Use it at your own risk, keep backups of source exports and SQLite databases, and review any promoted facts before using them in another system or sharing them with other people.
Synthetic parser fixtures currently cover:
- LINE-style date sections with tab-separated messages
- bracketed timestamps
- ISO date/time tab-separated rows
YYYY-MM-DD HH:MM - sender: bodyrows- WhatsApp-style
M/D/YY, h:mm PM - sender: bodyrows
PyPI publishing is not enabled yet. See docs/PUBLISHING.md for the pre-publish build, metadata, and distribution audit checklist. See docs/TESTPYPI.md for the TestPyPI-first upload runbook.
Quick Start
python3 line_history_poc.py init
python3 line_history_poc.py import --chat "Sample Chat" --file fixtures/sample_line_export_ja.txt
python3 line_history_poc.py health-report
Or install the local CLI entrypoint in a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .
local-chat-memory init
local-chat-memory import --chat "Sample Chat" --file fixtures/sample_line_export_ja.txt
local-chat-memory health-report
Default DB path:
./data/local-chat-memory.db
For an installed local-chat-memory command, ./data means the directory
where you run the command, not the Python package installation directory.
Override it with:
LOCAL_CHAT_MEMORY_DB=/path/to/chat-memory.db python3 line_history_poc.py status
Setup
python3 line_history_poc.py init-config --output config.local.json
python3 line_history_poc.py validate-config --config config.local.json
python3 line_history_poc.py doctor --config config.local.json
Then import downloaded exports:
python3 line_history_poc.py scan-downloads --config config.local.json
Discovery-first local use:
python3 line_history_poc.py scan-downloads --config config.local.json --auto-discover
Common Commands
local-chat-memory status
local-chat-memory search "invoice" --limit 20
local-chat-memory people
local-chat-memory person-context "Client A"
local-chat-memory alias-candidates
local-chat-memory wiki-candidates --min-messages 20
local-chat-memory promote-candidates --redact
local-chat-memory export-promote-review --redact --output exports/promote-review.md
local-chat-memory apply-promote-review --input exports/promote-review.md --dry-run
local-chat-memory promoted
The original script form remains supported:
python3 line_history_poc.py status
python3 line_history_poc.py search "invoice" --limit 20
python3 line_history_poc.py people
python3 line_history_poc.py person-context "Client A"
python3 line_history_poc.py alias-candidates
python3 line_history_poc.py wiki-candidates --min-messages 20
python3 line_history_poc.py promote-candidates --redact
python3 line_history_poc.py export-promote-review --redact --output exports/promote-review.md
python3 line_history_poc.py apply-promote-review --input exports/promote-review.md --dry-run
python3 line_history_poc.py promoted
Promote Reviewed Facts
Candidate extraction is local and deterministic. The safer workflow is:
local-chat-memory export-promote-review --redact --output exports/promote-review.md
# Edit the checklist locally: check reviewed items and fill distilled_fact/promote_to.
local-chat-memory apply-promote-review --input exports/promote-review.md --dry-run
local-chat-memory apply-promote-review --input exports/promote-review.md
local-chat-memory promoted
See docs/PROMOTE_WORKFLOW.md and examples/promote-review-reviewed.md for TODO, decision, question, person note, and project note examples.
Desktop Export Helper
The macOS LINE helper is optional and intentionally cautious:
scripts/export-current-line-chat.py --scan-after --auto-discover
For DB-backed staged queues:
scripts/export-current-line-chat.py \
--from-db \
--chat-kind personal \
--skip-success-within-hours 20 \
--limit 3 \
--open-first-result \
--timeout 90
It verifies search focus before pasting, verifies save names before saving, stops on mismatched filenames, and records export attempts.
Privacy
Raw message bodies stay local. Do not publish:
- real chat exports
- SQLite databases
config.local.json- export backups
- logs or screenshots containing message bodies
Use redacted reports for support:
python3 line_history_poc.py health-report --format json
python3 line_history_poc.py export-pending --redact --output exports/pending-redacted.md
python3 line_history_poc.py export-promote-review --redact --output exports/promote-review.md
Development
python3 -m unittest discover tests
python3 -m py_compile line_history_poc.py local_chat_memory/*.py scripts/export-current-line-chat.py
python3 -m local_chat_memory doctor --config config.example.json
Release Notes
CHANGELOG.md#v011---2026-06-15CHANGELOG.mdRELEASE_AUDIT_2026-06-15_v0.1.0.mdRELEASE_AUDIT_2026-06-15_v0.1.1.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file local_chat_memory-0.1.2.tar.gz.
File metadata
- Download URL: local_chat_memory-0.1.2.tar.gz
- Upload date:
- Size: 38.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc6e9a1f3bcb26541aeff9bcac5d8454791156fee8dba940622e28d26724086e
|
|
| MD5 |
a95e56cd5631031e8843365b27bcf774
|
|
| BLAKE2b-256 |
aea9c1d4ca9049718894469e4ac0fdbc3dcb7ab0984d6fc36168457308f2e136
|
Provenance
The following attestation bundles were made for local_chat_memory-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on cyakkunnlove/local-chat-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_chat_memory-0.1.2.tar.gz -
Subject digest:
fc6e9a1f3bcb26541aeff9bcac5d8454791156fee8dba940622e28d26724086e - Sigstore transparency entry: 1825141584
- Sigstore integration time:
-
Permalink:
cyakkunnlove/local-chat-memory@fd31307e5ca7c0c79a9ca3ea476735fe9cc6b68c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cyakkunnlove
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fd31307e5ca7c0c79a9ca3ea476735fe9cc6b68c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file local_chat_memory-0.1.2-py3-none-any.whl.
File metadata
- Download URL: local_chat_memory-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d3dffd1f31b398f618b5af1b1dad05cc56caba0be553f5b50f789ada613a738
|
|
| MD5 |
7e04b36f92cea1585b851285a4c2f6d2
|
|
| BLAKE2b-256 |
976d4edebb09abcd637755c0d361b8248f7b86a7a07366b53c6f302e9c358cc6
|
Provenance
The following attestation bundles were made for local_chat_memory-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on cyakkunnlove/local-chat-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_chat_memory-0.1.2-py3-none-any.whl -
Subject digest:
3d3dffd1f31b398f618b5af1b1dad05cc56caba0be553f5b50f789ada613a738 - Sigstore transparency entry: 1825141629
- Sigstore integration time:
-
Permalink:
cyakkunnlove/local-chat-memory@fd31307e5ca7c0c79a9ca3ea476735fe9cc6b68c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cyakkunnlove
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fd31307e5ca7c0c79a9ca3ea476735fe9cc6b68c -
Trigger Event:
workflow_dispatch
-
Statement type: