DTLarchive — Reference Manual v2.2-5

Functional and technical reference for the local ChatGPT archive indexing, search, and knowledge-reuse engine.

versionv2.2-5dateJuly 14, 2026platformWindowsruntimePython 3.14languagesfr / enlicenseMIT

Preface

This manual describes the structure, formats, invariants, and internal interfaces of DTLarchive 2.2-5. It is an architecture and data reference. It deliberately contains no user journey, launch procedure, or step-by-step scenario.

DTLarchive transforms ChatGPT conversation exports into a locally indexed corpus. Its purpose is to make the knowledge contained in these archives searchable, contextual, and reusable by downstream processing, without any remote-service dependency.

Intended audience

This document is intended for developers, maintainers, data owners, and integrators who need to understand engine behavior, validate its outputs, or connect its results to other knowledge-management tools.

Design principles

Analytical scope: the report's leading titles come from conversation titles ordered by relevance. They are neither clustering nor semantic topic extraction.

Architecture

Overview

The architecture separates persistent import, full-text candidate selection, and exact analysis of candidate conversations. This avoids reading and recalculating the complete corpus for every search.

Components

ComponentResponsibility
DTLarchive.pyOrchestration, export parsing, lexical analysis, relevance scoring, output generation, and console interface.
dtlarchive_index.pySQLite schema, incremental import, deduplication, message storage, and FTS5 queries.
dtlarchive_search.pyCandidate-conversation selection facade and examined-corpus counting.
dtlarchive_i18n.pyFrench/English catalog, active language, interpolation, and plurals.
DTLarchive.specStandalone executable build description.

Processing pipeline

PhaseInputOutputInvariant
ResolutionFiles or directoriesUnique absolute pathsStable path ordering.
ImportChatGPT JSONSources, conversations, messages, FTSOne transaction per source.
SelectionTerms, roles, datesCandidate identifiersFTS reduces the corpus without producing final results.
AnalysisCandidate conversationsMiningResultExact validation of groups and exclusions.
PublicationSorted resultsJSON and HTMLArchived messages remain unchanged.

File organization

Sources

DTLarchive.pydtlarchive_index.pydtlarchive_search.pydtlarchive_i18n.py

Engine, index, selection, and language-catalog implementation.

Persistent data

DTLarchive-index.sqlite

Local database for fingerprints, provenance, conversations, messages, and the FTS5 index.

Outputs

DTLarchive-output/logs/

Structured results, main report, HTML conversation copies, and diagnostic log.

Data and index

ChatGPT source format

The reader accepts an array of conversations or a single conversation object. Each usable conversation contains a mapping dictionary. The active branch is reconstructed backwards from current_node through parent links, then reversed into chronological order.

Only non-empty user and assistant messages are retained. Text comes from content.parts or, as a fallback, content.text. If the active branch produces no messages, a fallback traversal sorts usable messages by date.

Internal models

TypeFieldsPurpose
Messageid, role, text, create_timeA message extracted from a conversation.
Conversationsource_file, id, title, create_time, update_time, messagesComplete analysis unit.
QueryTermtext, excluded, groupLexical term and alternative-group membership.
MiningResultsource, identifiers, date, keywords, counts, score, roles, contexts, URLSerializable and displayable result.
IndexUpdateimported_files, unchanged_files, imported_conversationsIndex synchronization summary.
SearchSelectionconversations, examined_count, candidate_countSelection result before exact analysis.

SQLite schema

ObjectKeyContents
metadatakeyIndex-schema version.
sourcesid / unique pathSize, modification time, SHA-256, and indexing time.
conversationsidTitle, dates, content timestamp, and message count.
messagesid / conversation + ordinalExternal identifier, role, date, and text in original order.
source_conversationssource + conversationMany-to-many provenance relationship.
search_ftsFTS5Identifier, role, and text indexed with unicode61 remove_diacritics 2.

Foreign keys are enabled and SQLite uses WAL journaling. Relational indexes cover message order and conversation dates.

Incremental import and deduplication

A source is unchanged when its size and modification timestamp match the stored state. If those metadata differ while the SHA-256 fingerprint remains identical, only metadata are refreshed. A genuinely modified source is parsed inside a transaction.

The ChatGPT identifier is the deduplication key. When absent, a deterministic SHA-256 is computed from path, title, and dates. Existing content is replaced when the incoming (content timestamp, message count) pair is greater than or equal to the stored pair. Provenance links allow one conversation to belong to several exports.

Lexical grammar

ConstructInternal semantics
comma, semicolon, OU, ORCreates alternative groups.
ET, ANDRequires every term in one group.
-termGlobally excludes a conversation.
"phrase"Removes external quotes while preserving the phrase.
prefix*Lexical extension by alphanumeric, hyphen, or underscore characters.

Duplicates are removed by normalized text, exclusion status, and group number.

Normalization and counting

Normalization applies Unicode NFKD, removes diacritics, lowercases text, replaces typographic apostrophes, and compacts whitespace. Searches are case- and accent-insensitive. Without a wildcard, simple forms accept an s or x plural suffix unless the term already ends in either character.

Indexed candidate selection

For each positive term, FTS5 produces an identifier set constrained by source, role, and date. Terms in one group are intersected; alternative groups are united. The title role is always added to the scope. This phase produces candidates, not final results.

Exact analysis

The title and in-scope messages are combined and normalized. Any excluded-term occurrence rejects the conversation. A positive group is valid only when all its terms occur. Counts, matching roles, and message positions are then calculated against exact text.

Relevance calculation

The score is capped at 100 and follows this deterministic formula:

15 + 35 when the title matches + min(user matching messages × 25, 35) + min(assistant matching messages × 15, 25) + min(occurrences × 5, 20) + min((distinct terms − 1) × 10, 20)
RangeLabel
80 to 100Highly relevant
45 to 79Relevant
0 to 44Secondary mention

Final ordering is descending by score and then conversation date. The score is not a probability and does not come from statistical learning.

Context windows

Each matching message generates a window of up to two messages before and two after. Adjacent or overlapping windows are merged. At most six windows are retained per conversation. Context-message text is compacted to 1,200 characters.

Structured outputs

mining_results.json

The root document contains metadata and results. Metadata describe the application, version, logical schema, UTC time, sources, index, dates, query, and scope. Each result is a complete serialization of MiningResult.

FamilyMain fields
Identificationsource_file, conversation_id, conversation_title, conversation_url
Measuresoccurrence_count, message_count, relevance_score, relevance_label
Matchesmatched_keywords, matched_roles, contexts
Processing contextsource_files, index_path, period, search terms, role_scope
Knowledge reuse: this structured output can act as a first stage for knowledge extraction, comparison, or knowledge-base enrichment tools.

HTML reports

DTLarchive-report.html presents metrics, term distribution, the first ranked unique conversation titles, the result table, and context windows. Displayed titles are not a semantic summary. Each conversation-<fingerprint>.html page reproduces the complete branch and places an anchor on the first matching message.

The documents contain their own CSS, use UTF-8, and follow the active interface language. Conversation content remains in its original language.

HTML diagnostic log

The daily logs/DTLarchive_YYYYMMDD.html log receives timestamped information, action, and error entries. It records major phases, summarized parameters, import counters, and exceptions. Log write failures do not interrupt the engine.

Internal reference

Project modules

ModuleMain dependenciesHeld state
DTLarchiveargparse, pathlib, sqlite3, tkinter, webbrowserProcess language, arguments, selected corpus, and results.
dtlarchive_indexsqlite3, hashlibSQLite connection and persistent schema.
dtlarchive_searchArchiveIndexSources authorized for a selection.
dtlarchive_i18nos.environCatalog and DTLARCHIVE_LANG variable.

Function groups

GroupRepresentative functionsContract
Textnormalize, compact, unique, keyword_pattern, count_termDeterministic lexical normalization and measurement.
Parsingtext_from_content, current_branch_messages, iter_conversationsTolerant conversion from ChatGPT JSON to internal models.
Timeparse_french_date, period_overlaps_archive, archive_period_labelInclusive bounds and overlap validation.
Analysismine_conversation, build_contexts, relevance_labelProduces an exact result or None.
Publicationwrite_json, write_html_report, write_conversation_pageUTF-8 structured and navigable output.

Internationalization

The TRANSLATIONS catalog maps each key to fr and en values. current_language() reads DTLARCHIVE_LANG and falls back to French for unsupported values. t() selects and interpolates a template; plural_key() selects singular and plural variants.

Language coverage includes the console, dialogs, help, errors, reports, and log. It does not translate source conversation content.

Errors, transactions, and integrity

Appendices

Known limitations

Versions and schemas

IdentifierValueScope
Applicationv2.2-5Distributed features and interface.
Logical schema2.1Value published in result metadata.
Index schema1Persistent SQLite database compatibility.

Glossary

TermDefinition
CorpusAll conversations linked to selected archives.
CandidateA conversation selected by FTS5 before exact lexical validation.
ContextA message window surrounding a match.
ProvenanceThe relation between a deduplicated conversation and its source files.
FTS5SQLite's integrated full-text search engine.
WALSQLite journal mode supporting robust writes and concurrent reads.