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
Metadata
Release files for local-chat-memory 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| local_chat_memory-0.1.2.tar.gz | 38.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| local_chat_memory-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.4 kB
Release files / local_chat_memory-0.1.2.tar.gz
| Download URL | local_chat_memory-0.1.2.tar.gz |
|---|---|
| Size | 38.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc6e9a1f3bcb26541aeff9bcac5d8454791156fee8dba940622e28d26724086e
|
|
BLAKE2b-256 checksum How to use checksums |
aea9c1d4ca9049718894469e4ac0fdbc3dcb7ab0984d6fc36168457308f2e136
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 15, 2026.
Transparency logRelease files / local_chat_memory-0.1.2-py3-none-any.whl
| Download URL | local_chat_memory-0.1.2-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d3dffd1f31b398f618b5af1b1dad05cc56caba0be553f5b50f789ada613a738
|
|
BLAKE2b-256 checksum How to use checksums |
976d4edebb09abcd637755c0d361b8248f7b86a7a07366b53c6f302e9c358cc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 15, 2026.
Transparency log