Commit Graph

28 Commits

Author SHA1 Message Date
4de645145a Ajout pipeline Word (.docx) pour ingestion RAG
Nouveaux modules (3 fichiers, ~850 lignes):
- word_processor.py: Extraction contenu Word (texte, headings, images, métadonnées)
- word_toc_extractor.py: Construction TOC hiérarchique depuis styles Heading
- word_pipeline.py: Orchestrateur complet réutilisant modules LLM existants

Fonctionnalités:
- Extraction native Word (pas d'OCR, économie ~0.003€/page)
- Support Heading 1-9 pour TOC hiérarchique
- Section paths compatibles Weaviate (1, 1.1, 1.2, etc.)
- Métadonnées depuis propriétés Word + extraction paragraphes
- Markdown compatible avec pipeline existant
- Extraction images inline
- Réutilise 100% des modules LLM (metadata, classifier, chunker, cleaner, validator)

Pipeline testé:
- Fichier exemple: "On the origin - 10 pages.docx"
- 48 paragraphes, 2 headings extraits
- 37 chunks créés
- Output: markdown + JSON chunks

Architecture:
1. Extraction Word → 2. Markdown → 3. TOC → 4-9. Modules LLM réutilisés → 10. Weaviate

Prochaine étape: Intégration Flask (route upload Word)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 21:58:43 +01:00
fd66917f03 Génération TTS asynchrone pour éviter le blocage Flask
Backend:
- Nouveau dictionnaire global tts_jobs pour tracker les jobs TTS
- Fonction _generate_audio_background() pour génération en thread
- POST /chat/generate-audio: lance génération et retourne job_id
- GET /chat/audio-status/<job_id>: polling du statut
- GET /chat/download-audio/<job_id>: télécharge l'audio terminé
- États: pending → processing → completed/failed

Frontend:
- Fonction exportToAudio() asynchrone avec polling (1s)
- Spinner animé pendant génération ("Génération...")
- Téléchargement automatique quand prêt
- Restauration bouton en cas d'erreur
- Animation CSS @keyframes spin pour le spinner

Avantages:
- Flask reste responsive pendant génération TTS
- Navigation possible pendant génération audio
- Expérience utilisateur améliorée avec feedback visuel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 19:45:29 +01:00
f2303569b5 Ajout nettoyage markdown pour TTS audio
- Nouvelle fonction _clean_markdown() pour supprimer le formatage markdown
- Supprime headers (#), bold (**), italic (*), code blocks (```)
- Supprime liens [text](url), citations (>), marqueurs de listes (-)
- Nettoie les espaces multiples pour un texte propre
- Évite la lecture à voix haute des caractères markdown
- Tests validés: tous les patterns markdown correctement nettoyés

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 19:35:01 +01:00
127658aefd Amélioration UI: header fixe et ajustement layout chat
- Header fixe positionné à côté du menu hamburger (80px de gauche)
- Suppression du sous-titre "Visualiseur de base Weaviate"
- Fix variable CSS: var(--color-bg-primary) → var(--color-bg-main)
- Ajustement hauteur chat: fenêtres RAG descendent jusqu'en bas
- Barres de conversation touchent le bas de l'écran

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 19:12:19 +01:00
d91abd3566 Ajout de la fonctionnalité TTS (Text-to-Speech) avec XTTS v2
- Ajout de TTS>=0.22.0 aux dépendances
- Création du module utils/tts_generator.py avec Coqui XTTS v2
  * Support GPU avec mixed precision (FP16)
  * Lazy loading avec singleton pattern
  * Chunking automatique pour textes longs
  * Support multilingue (fr, en, es, de, etc.)
- Ajout de la route /chat/export-audio dans flask_app.py
- Ajout du bouton Audio dans chat.html (côté Word/PDF)
- Génération audio WAV téléchargeable depuis les réponses

Optimisé pour GPU 4070 (8GB VRAM) : utilise 4-6GB, génération rapide
Qualité : voix naturelle française avec prosodie expressive

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 14:31:30 +01:00
b835cd13ea Ajout des fonctionnalités d'export Word et PDF pour le chat RAG
- Ajout de python-docx et reportlab aux dépendances
- Création du module utils/word_exporter.py pour l'export Word
- Création du module utils/pdf_exporter.py pour l'export PDF
- Ajout des routes /chat/export-word et /chat/export-pdf dans flask_app.py
- Ajout des boutons d'export (Word et PDF) dans chat.html
- Les boutons apparaissent après chaque réponse de l'assistant
- Support des questions reformulées avec question originale

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 14:02:11 +01:00
ef8cd32711 Remove obsolete documentation and backup files
- Remove REMOTE_WEAVIATE_ARCHITECTURE.md (moved to library_rag)
- Remove navette.txt (obsolete notes)
- Remove backup and obsolete app spec files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 11:57:21 +01:00
d2f7165120 Add Library RAG project and cleanup root directory
- Add complete Library RAG application (Flask + MCP server)
  - PDF processing pipeline with OCR and LLM extraction
  - Weaviate vector database integration (BGE-M3 embeddings)
  - Flask web interface with search and document management
  - MCP server for Claude Desktop integration
  - Comprehensive test suite (134 tests)

- Clean up root directory
  - Remove obsolete documentation files
  - Remove backup and temporary files
  - Update autonomous agent configuration

- Update prompts
  - Enhance initializer bis prompt with better instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 11:57:12 +01:00
48470236da Amélioration majeure du système RAG avec diversification par auteur
## Nouvelles fonctionnalités

### 1. Recherche RAG avec diversification par auteur (flask_app.py)
- Fonction `diverse_author_search()` : agrégation intelligente par auteur
- Résout le problème de biais corpus (auteurs prolifiques vs peu représentés)
- Allocation adaptative :
  * 1 auteur → jusqu'à 25 chunks pour contexte riche
  * 2-3 auteurs → distribution équitable (12 chunks/auteur)
  * 4+ auteurs → limitation à 3 chunks/auteur pour diversité
- Pool initial de 200 chunks pour identifier tous les auteurs pertinents

### 2. Re-ranking LLM amélioré (flask_app.py)
- Prompt ultra-strict : force réponse sans markdown ni explications
- Parsing robuste : nettoie markdown (**texte**, __texte__)
- Fallback intelligent : garde tous les chunks si re-ranking trop strict (<50%)
- Logs détaillés des chunks exclus pour debugging

### 3. Interface utilisateur améliorée (chat.html)
- **Accordéon pour chunks RAG** : expansion/collapse avec chevron
- **Reformulation avec choix utilisateur** :
  * Endpoint `/chat/reformulate` séparé
  * Affichage côte-à-côte (originale vs reformulée)
  * Boutons de sélection avant lancement RAG
  * Badge "✓ Utilisée" sur version choisie
- **Layout full-width** : 60% conversation / 40% contexte RAG
- **Sidebar navigation** : menu hamburger avec overlay

### 4. Logs et debugging
- Logs détaillés à chaque étape du pipeline
- Affichage des auteurs trouvés et scores moyens
- Liste des chunks exclus par re-ranking avec extraits

## Améliorations techniques
- Reformulation expansive 4-6 lignes (concepts, filiations, contextes)
- Re-ranking avec minimum 8 chunks garantis
- Gestion des modèles GPT-5.x et o1 (max_completion_tokens)
- Prompts optimisés pour réponses longues (500-800 mots)

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 22:46:39 +01:00
422a0f102c Merge branch 'main' of https://github.com/davidblanc347/linear-coding-agent 2025-12-29 13:03:11 +01:00
3101201b06 Add remote Weaviate architecture documentation
Added comprehensive guide for accessing Weaviate on remote servers
(Synology NAS or VPS) from LLM applications.

Covers 4 deployment options:
1. API REST Custom (recommended for VPS/production)
2. VPN + Direct Access (recommended for Synology)
3. SSH Tunnel (dev/temporary)
4. MCP HTTP (not recommended)

Includes comparisons, code examples, and deployment recommendations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 13:02:30 +01:00
6c25383f1b Add assistant behavior guidelines to CLAUDE.md
Added explicit rules requiring the assistant to always ask for confirmation
before creating/modifying files, executing commands, or making changes.

Changes:
- Added "Comportement de l'assistant" section at the top
- Defined required workflow: Analyze → Explain → Wait → Implement
- Listed exceptions for read-only operations
- Emphasizes "ask first" approach to prevent unwanted modifications

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 12:59:19 +01:00
ad2c29a777 Fix Library RAG MCP connection issue and add setup documentation
Problem:
- Library RAG MCP server was failing to connect with timeout error
- Backend status showed "connected: false" with "MCP error -32001: Request timed out"
- Documents uploaded via upload_document tool were never processed

Root Cause:
- MISTRAL_API_KEY was commented out in .env file
- MCP server requires this key for OCR and LLM processing
- Without the key, the Python subprocess fails to start
- This caused connection timeout in the Node.js backend

Solution:
- Uncommented MISTRAL_API_KEY in .env (not committed, in .gitignore)
- Added LIBRARY_RAG_SETUP.md with complete setup guide
- Updated .claude/settings.local.json with bash permissions

Changes:
- Added LIBRARY_RAG_SETUP.md (setup documentation)
- Updated .claude/settings.local.json (auto-approved bash commands)

Verified:
- MCP server now connects successfully
- Status endpoint shows "connected: true"
- All 7 Library RAG tools available (upload_document, search_library, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 19:22:00 +01:00
a7f8141118 Rename my_project to ikario_body across all project files
Updated all references from 'my_project' to 'ikario_body':
- Renamed dockerize_my_project.py → dockerize_ikario_body.py
- Renamed docker-compose.my_project.yml → docker-compose.ikario_body.yml
- Updated Docker service names (ikario_body_frontend, ikario_body_server)
- Updated paths in .claude/settings.local.json
- Updated paths in README.md, navette.txt, patch_stats.py, project_progress.md
- Updated all volume mounts and working directories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:53:45 +01:00
705cd1bfa9 Add time/date access for Ikario and Tavily MCP specification
Major changes:
- Added current date/time to system prompt so Ikario always knows when it is
- Created comprehensive Tavily MCP integration spec (10 features)
- Updated .gitignore to exclude node_modules

Time Access Feature:
- Modified buildSystemPrompt in server/routes/messages.js
- Modified buildSystemPrompt in server/routes/claude.js
- Ikario now receives: date, time, ISO timestamp, timezone
- Added debug logging to verify system prompt

Tavily MCP Spec (app_spec_tavily_mcp.txt):
- Internet access via Tavily search API
- 10 detailed features with implementation steps
- Compatible with existing ikario-memory MCP
- Provides real-time web search and news search

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:52:52 +01:00
51983a5240 Add backup system documentation and utility scripts
Documentation:
- MODIFICATIONS_BACKUP_SYSTEM.md: Complete documentation of the new backup system
  - Problem analysis (old system truncated to 200 chars)
  - New architecture using append_to_conversation
  - ChromaDB structure (1 principal + N individual message docs)
  - Coverage comparison (1.2% → 100% for long conversations)
  - Migration guide and test procedures

Utility Scripts:
- test_backup_python.py: Direct Python test of backup system
  - Bypasses Node.js MCP layer
  - Tests append_to_conversation with complete messages
  - Displays embedding coverage statistics
- fix_stats.mjs: JavaScript patch for getMemoryStats()
- patch_stats.py: Python patch for getMemoryStats() function

Key Documentation Sections:
- Old vs New system comparison table
- ChromaDB document structure explanation
- Step-by-step migration instructions
- Test procedures with expected outputs
- Troubleshooting guide

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:44:24 +01:00
9af5da620f Update UI spec for append_to_conversation and thinking support
Updated app_spec_ikario_rag_UI.txt to document new 8th MCP tool and thinking feature:

CHANGES:
- Updated from 7 to 8 MCP tools (added append_to_conversation)
- Added route: POST /api/memory/conversations/append
- Documented thinking field support for LLM reasoning capture
- Added appendToConversation() function in Memory Service Layer
- Updated Chat Integration with thinking examples
- Added tests for append_to_conversation with thinking
- Updated success criteria and constraints (8 tools)

KEY ADDITIONS:
- Format message with thinking documented
- Auto-create behavior explained
- Extended Thinking integration guidelines
- Distinction: add_conversation (complete) vs append_to_conversation (incremental)

8 sections modified with complete documentation.
Spec ready for issue creation.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:44:24 +01:00
283eee687c Fix Extended Thinking critical bug and optimize default parameters
CRITICAL BUG FIXED:
- max_tokens vs thinking_budget_tokens API constraint violation resolved
- Changed max_tokens from 4096 to 8192 (App.jsx:4747)
- Changed thinking_budget_tokens from 10000 to 6144 (App.jsx:4749)
- Updated database default from 10000 to 6144 (server/db/index.js:243)
- Result: 8192 > 6144  API constraint satisfied

FRONTEND FIX:
- Fixed SSE data mapping for thinking content (App.jsx:5565-5566)
- Changed from data.thinking_signature to data.thinking.signature
- Changed from fullThinking to data.thinking.content with fallback
- ThinkingBlock now displays and persists correctly after streaming

CONFIGURATION:
- Extended Thinking disabled by default (was true for testing)
- Optimal defaults: max_tokens=8192, thinking_budget=6144 (6K)
- User-tested configuration validates 6K thinking budget ideal

DATABASE UPDATES:
- Updated 10+ existing conversations to thinking_budget_tokens=4096
- New conversations default to 6144 tokens
- Thinking content now saves and persists correctly

TESTING:
-  Manual test with Whitehead philosophy question successful
-  ThinkingBlock displays with blue UI and brain icon
-  Expand/collapse functionality works
-  Signature verification indicator shows
-  Content persists after streaming and page reload

ISSUES COMPLETED:
- TEAMPHI-194: ThinkingBlock Component (validated)
- TEAMPHI-195: ThinkingBlock Integration (fully functional)
- TEAMPHI-199: Streaming Handler (data mapping fixed)

Progress: 60% → 80% complete

Files modified:
- generations/my_project/src/App.jsx (lines 4747-4749, 5565-5566)
- generations/my_project/server/db/index.js (line 243)
- project_progress.md (comprehensive update)
- fix_thinking_budget.py (database migration script)
- check_thinking_budget.py (verification script)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:44:24 +01:00
dbba327e59 Add Extended Thinking specification for Claude API integration
Created comprehensive spec for integrating Claude's Extended Thinking feature into
the my_project application. This spec follows the standard XML .txt format used
by the project's initializer agents.

Key features (15 total):
- Backend thinking parameter support in API routes
- SSE streaming for thinking_delta events
- Database storage for thinking_content and thinking_signature
- Conversation-level thinking settings (enable/disable + budget)
- Frontend ThinkingBlock component for collapsible display
- Settings panel integration (toggle + budget slider)
- Thinking badge in conversation list
- Token tracking and usage stats for thinking
- Tool use compatibility (thinking preservation)
- Error handling for thinking timeouts
- Complete user documentation

Technologies:
- Claude API thinking parameter: { type: "enabled", budget_tokens: 1024-200000 }
- Server-Sent Events (SSE) for streaming thinking deltas
- SQLite database extensions (2 new columns per table)
- React components with blue color scheme for thinking blocks
- @anthropic-ai/sdk already installed

Database changes:
- conversations: enable_thinking, thinking_budget_tokens
- messages: thinking_content, thinking_signature

Model support: Claude 4+ (Sonnet 4.5, Haiku 4.5, Opus 4.5/4.1/4, Sonnet 4)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:44:24 +01:00
8f4c0884cc Add Extended Thinking feature specification
Created comprehensive spec for integrating Claude's Extended Thinking capability
into the Claude.ai Clone project. This feature enables enhanced reasoning for
complex tasks by exposing Claude's step-by-step thought process.

Specification includes:
- Complete architecture (backend + frontend)
- 6-phase implementation plan (12-16h estimated)
- Full code examples for all components
- Streaming thinking deltas handling
- ThinkingBlock React component design
- Settings UI for thinking toggle and budget control
- Database schema modifications for thinking storage
- Token management and pricing considerations
- Tool use compatibility (thinking block preservation)
- Testing checklist and best practices
- User documentation

Key features:
- Collapsible thinking blocks with real-time streaming
- Per-conversation thinking toggle
- Adjustable thinking budget (1K-32K tokens)
- Visual indicators (badges, animations)
- Full compatibility with existing memory tools
- Proper handling of summarized thinking (Claude 4+)
- Support for redacted thinking blocks

Implementation phases:
1. Backend Core (2-3h)
2. Frontend UI (3-4h)
3. Streaming & Real-time (2-3h)
4. Tools Integration (2h)
5. Polish & Optimization (2h)
6. Testing & Deployment (1-2h)

Models supported:
- Claude Sonnet 4.5, 4 (summarized thinking)
- Claude Opus 4.5, 4.1, 4 (summarized + preserved blocks)
- Claude Haiku 4.5 (summarized thinking)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 19:44:24 +01:00
0b370b74ba Merge branch 'main' of https://github.com/davidblanc347/linear-coding-agent 2025-12-25 12:53:32 +01:00
2e33637dae Update framework configuration and clean up obsolete specs
Configuration updates:
- Added .env.example template for environment variables
- Updated README.md with better setup instructions (.env usage)
- Enhanced .claude/settings.local.json with additional Bash permissions
- Added .claude/CLAUDE.md framework documentation

Spec cleanup:
- Removed obsolete spec files (language_selection, mistral_extensible, template, theme_customization)
- Consolidated app_spec.txt (Claude Clone example)
- Added app_spec_model.txt as reference template
- Added app_spec_library_rag_types_docs.txt
- Added coding_prompt_library.md

Framework improvements:
- Updated agent.py, autonomous_agent_demo.py, client.py with minor fixes
- Enhanced dockerize_my_project.py
- Updated prompts (initializer, initializer_bis) with better guidance
- Added docker-compose.my_project.yml example

This commit consolidates improvements made during development sessions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 12:53:14 +01:00
bf790b63a0 Add specification for Markdown support in Library RAG
New feature specification to add native Markdown (.md) file support:
- Skip OCR for .md files (0€ cost vs ~0.003€/page for PDF)
- Process Markdown directly through LLM pipeline
- Maintain full compatibility with existing PDF workflow
- Includes 10 features, 5 implementation steps, comprehensive tests

This will enable users to upload pre-digitized philosophical texts
in Markdown format without incurring OCR costs while still benefiting
from LLM-based metadata extraction, TOC generation, semantic chunking,
and Weaviate vectorization.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 12:46:07 +01:00
25571ca7b6 Add MCP Ikario Memory extension specification for Claude.ai Clone
Created comprehensive spec for integrating Ikario RAG MCP client into existing
Claude.ai Clone project. Features Tool Use API for autonomous memory management.

Key features (10 total):
- MCP client connection and wrapper services (backend)
- Memory API routes (/api/memory/*) (backend)
- Tool Use API integration with save_memory and search_memories tools (backend)
- Tool execution handler and enriched system prompt (backend)
- Manual save button in chat interface (frontend)
- Memory search panel in sidebar (frontend)
- Memory status indicator in header (frontend)
- Automatic conversation backup (backend)

Technologies:
- @modelcontextprotocol/sdk for MCP client
- Claude Tool Use API for autonomous memory operations
- ChromaDB via MCP for semantic search (managed by Ikario RAG server)
- Minimal SQLite changes (1 column addition)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 00:50:23 +01:00
e13e0fa261 Dockerize my_project (ports 4300/4301) and update API base URL 2025-12-15 13:55:57 +01:00
ca47f2bc56 Stop autonomous agent after Linear project is feature-complete 2025-12-15 13:16:00 +01:00
e14f045b42 Add guide and template for creating new applications 2025-12-14 00:59:50 +01:00
a310d4b3cf Initial commit: Linear-integrated autonomous coding agent with Initializer Bis support 2025-12-14 00:45:40 +01:00