ユーザーの提案に基づき、documents テーブルに MIME タイプを保持することで、将来的なファイル形式の拡張(PDF, 画像, 各種コード等)に対応しやすくするため。
documents テーブルに mime TEXT カラムを追加。mcp.rs 内で、path の拡張子から主要な MIME タイプ(markdown, rust, javascript 等)を自動判別するロジックを追加。add_item_text に mime 引数を追加。また、検索結果に mime 情報を返すように変更。03_database_specification.md)に新設カラムを反映。AIエージェントは以下の手順で作業を実施した。
src/backend/src/db.rs を修正し、テーブル作成 SQL に mime カラムを追加。src/backend/src/mcp.rs をリファクタリング。
add_item_text の引数処理と、拡張子ベースの MIME 推測ロジックを実装。search_text および get_item_by_id の SQL クエリとレスポンス JSON に mime カラムを追加。docs/specification/03_database_specification.md を更新。cargo check により、バックエンドの整合性とビルド可能性を確認。今回の変更により、TelosDB は単なるテキスト断片の集まりではなく、「型(MIME)を持ったドキュメントの集合」としての性質が強まりました。自動検知ロジックにより、ユーザーが意識せずとも適切なメタデータが蓄積されるようになり、将来的な UI 改善やマルチモーダル対応への強力な基盤となりました。
Based on the user's suggestion, adding MIME types to the documents table to facilitate future support for various file formats (PDF, images, various code types, etc.).
mime TEXT column to the documents table.mcp.rs to automatically determine common MIME types (markdown, rust, javascript, etc.) based on file extensions.mime argument to add_item_text and updated search results to include mime information.03_database_specification.md).The AI agent carried out the work in the following steps:
src/backend/src/db.rs to add the mime column to the table creation SQL.src/backend/src/mcp.rs:
add_item_text.mime column to SQL queries and JSON responses for search_text and get_item_by_id.docs/specification/03_database_specification.md.cargo check.With this change, TelosDB has evolved from a collection of text fragments into a "collection of typed (MIME) documents." The automatic detection logic ensures that appropriate metadata is accumulated without extra user effort, providing a strong foundation for future UI improvements and multimodal support.
graph LR
A[File Path] --> B{Extension?}
B -->|md| C[text/markdown]
B -->|rs| D[text/x-rust]
B -->|other| E[application/octet-stream]
C --> F[documents.mime]
D --> F
E --> F