add comprehensive documentation and improve logging in DocGPT - #6
Merged
Merged
Conversation
PR Change LogChanged Files SummaryOverall: 10 files changed, 1642 insertions(+), 42 deletions(-) Files Changed
Changes by Directory
WarningsLarge changes detected in:
Updated: 2026-02-11T18:57:11.776Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces an interaction logging system to DocGPT that automatically records every user interaction (question, retrieved context, answer, and source metadata) to CSV and JSONL files. It also refactors the assistant prompt interface to return richer results, enabling downstream consumers (API, CLI, Discord bot) to access and log context and source information. Minor improvements and bugfixes are included for consistency and robustness.
Interaction Logging System:
InteractionLoggerutility (src/core/interaction_logger.py) that logs each RAG interaction to timestamped CSV and JSONL files for crash-resilient persistence. The logger is initialized at startup and used in the API, CLI, and Discord bot to record every prompt and response, including retrieved context and source metadata..gitignoreto exclude the newlogs/directory where interaction logs are stored.Assistant Prompt Refactor:
PromptResultdataclass, which includes the answer, retrieved context, and source metadata, instead of just a string answer. This affects the assistant adapter, domain, and port definitions. [1] [2] [3] [4] [5]PromptResultstructure, enabling them to log detailed interaction data and display richer responses. [1] [2] [3] [4] [5]Integration and Initialization:
main.pyfor API runs, with log file locations configurable via theINTERACTION_LOG_DIRenvironment variable. Logging is now robust to errors, with failures reported to the application log. [1] [2]Consistency and Minor Improvements:
These changes collectively improve traceability, debugging, and analysis of user interactions with DocGPT, while preparing the codebase for future enhancements around context and provenance.