Library-first tool for parsing AI conversation exports with search, filtering, and markdown export
Project description
Echomine
Library-first tool for parsing AI conversation exports with search, filtering, and markdown export
Overview
Echomine is a Python library and CLI tool for parsing, searching, and exporting AI conversation exports. Initially designed for ChatGPT exports, it uses a multi-provider adapter pattern to support future AI platforms (Claude, Gemini, etc.).
Key Features
- Memory Efficient: Stream-based parsing handles 1GB+ files with constant memory usage
- Full-Text Search: BM25 relevance ranking for keyword searches across conversations
- Type Safe: Strict typing with Pydantic v2 and mypy --strict compliance
- Library First: All CLI capabilities available as importable Python library
- Multi-Provider Ready: Adapter pattern supports multiple AI export formats
Design Principles
- Library-First Architecture: CLI built on top of library, not vice versa
- Strict Type Safety: mypy --strict, no
Anytypes in public API - Memory Efficiency: Stream-based parsing, never load entire file into memory
- Test-Driven Development: All features test-first validated
- YAGNI: Simple solutions, no speculative features
See Constitution for complete design principles.
Installation
From Source
# Clone repository
git clone https://github.com/echomine/echomine.git
cd echomine
# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks (optional)
pre-commit install
From PyPI (when published)
pip install echomine
Quick Start
Library API (Primary Interface)
from echomine import OpenAIAdapter, SearchQuery
from pathlib import Path
# Initialize adapter (stateless, reusable)
adapter = OpenAIAdapter()
export_file = Path("conversations.json")
# 1. List all conversations (discovery)
for conversation in adapter.stream_conversations(export_file):
print(f"[{conversation.created_at.date()}] {conversation.title}")
print(f" Messages: {len(conversation.messages)}")
# 2. Search with keywords (BM25 ranking)
query = SearchQuery(keywords=["algorithm", "design"], limit=10)
for result in adapter.search(export_file, query):
print(f"{result.conversation.title} (score: {result.score:.2f})")
# 3. Filter by date range
from datetime import date
query = SearchQuery(
keywords=["refactor"],
from_date=date(2024, 1, 1),
to_date=date(2024, 3, 31),
limit=5
)
results = list(adapter.search(export_file, query))
# 4. Get specific conversation by ID
conversation = adapter.get_conversation_by_id(export_file, "conv-abc123")
if conversation:
print(f"Found: {conversation.title}")
CLI Usage (Built on Library)
# List all conversations
echomine list export.json
# Search by keywords
echomine search export.json --keywords "algorithm,design" --limit 10
# Search by title (fast, metadata-only)
echomine search export.json --title "Project"
# Filter by date range
echomine search export.json --from-date "2024-01-01" --to-date "2024-03-31"
# Get conversation by ID
echomine get conversation export.json conv-abc123
# Get message by ID (with conversation hint for performance)
echomine get message export.json msg-def456 -c conv-abc123
# Export conversation to markdown (default)
echomine export export.json conv-abc123 --output algo.md
# Export as JSON
echomine export export.json conv-abc123 --format json --output algo.json
# JSON to stdout for piping
echomine export export.json conv-abc123 -f json | jq '.messages | length'
# JSON output for search results
echomine search export.json --keywords "python" --json | jq '.results[].title'
# Version info
echomine --version
See Quickstart Guide for detailed examples.
Development
Prerequisites
- Python 3.12 or higher
- Git
Setup Development Environment
# Clone repository
git clone https://github.com/echomine/echomine.git
cd echomine
# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=echomine --cov-report=html
# Run specific test categories
pytest -m unit # Unit tests only
pytest -m integration # Integration tests only
pytest -m contract # Contract tests only
pytest -m performance # Performance benchmarks
Code Quality
# Type checking (strict mode)
mypy src/
# Linting and formatting
ruff check .
ruff format .
# Run pre-commit hooks manually
pre-commit run --all-files
Project Structure
echomine/
├── src/echomine/ # Library source code
│ ├── models/ # Pydantic data models
│ ├── adapters/ # Provider adapters (OpenAI, etc.)
│ ├── parsers/ # Streaming JSON parsers
│ ├── search/ # Search and ranking logic
│ ├── exporters/ # Export formatters (markdown, JSON)
│ └── cli/ # CLI commands
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── contract/ # Protocol contract tests
│ └── performance/ # Performance benchmarks
└── specs/ # Design documents
└── 001-ai-chat-parser/ # Feature specification
Documentation
Full Documentation - Comprehensive guides, API reference, and examples
Quick Links
Spec Documents
Performance
Echomine is designed for memory efficiency and speed:
- Memory: O(1) memory usage regardless of file size (streaming-based)
- Search: <30 seconds for 1.6GB files (10K conversations, 50K messages)
- Listing: <5 seconds for 10K conversations
See Performance Requirements for benchmarks.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for:
- Development setup and prerequisites
- TDD workflow (RED-GREEN-REFACTOR cycle mandatory)
- Testing guidelines (pytest, mypy --strict, ruff)
- Code quality standards and conventions
- Commit message format (conventional commits)
- Pull request process
License
AGPL-3.0 License - See LICENSE file for details
Acknowledgments
Built with:
Project details
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 echomine-1.0.2.tar.gz.
File metadata
- Download URL: echomine-1.0.2.tar.gz
- Upload date:
- Size: 68.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6b05ae8565f81222fa5655123f189dc22ca874562f7910c0aa458c26c744318
|
|
| MD5 |
4520eecf357abb2541a4fa092cbd8311
|
|
| BLAKE2b-256 |
c48c1a541538b58423b38f1a269a4dbcfbb0c4caba206de7eb5f615df1e91b81
|
Provenance
The following attestation bundles were made for echomine-1.0.2.tar.gz:
Publisher:
release.yml on aucontraire/echomine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
echomine-1.0.2.tar.gz -
Subject digest:
f6b05ae8565f81222fa5655123f189dc22ca874562f7910c0aa458c26c744318 - Sigstore transparency entry: 738392454
- Sigstore integration time:
-
Permalink:
aucontraire/echomine@e599901d0a7c60ebcc9f8d53d497f30120c09d49 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/aucontraire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e599901d0a7c60ebcc9f8d53d497f30120c09d49 -
Trigger Event:
push
-
Statement type:
File details
Details for the file echomine-1.0.2-py3-none-any.whl.
File metadata
- Download URL: echomine-1.0.2-py3-none-any.whl
- Upload date:
- Size: 77.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15fe1ff8173ff583ac96a885fa7469e487b2a8dcf6856862e0ad05a990d90140
|
|
| MD5 |
d2564ce012c5c1214898b091cda24428
|
|
| BLAKE2b-256 |
9f1255f26e2834a2ee39c7c91e8937b9feda76e50b8bb1f86d7970387d9d651d
|
Provenance
The following attestation bundles were made for echomine-1.0.2-py3-none-any.whl:
Publisher:
release.yml on aucontraire/echomine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
echomine-1.0.2-py3-none-any.whl -
Subject digest:
15fe1ff8173ff583ac96a885fa7469e487b2a8dcf6856862e0ad05a990d90140 - Sigstore transparency entry: 738392504
- Sigstore integration time:
-
Permalink:
aucontraire/echomine@e599901d0a7c60ebcc9f8d53d497f30120c09d49 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/aucontraire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e599901d0a7c60ebcc9f8d53d497f30120c09d49 -
Trigger Event:
push
-
Statement type: