<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `build_default_config()` function in `PDF_parser/converter.py` do?<|im_end|>
<|im_start|>assistant
**`build_default_config()`** in `PDF_parser/converter.py`:
```python
def build_default_config(
```

Create a sensible default ``ConversionConfig`` for command‑line use.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `build_default_config()` function in `PDF_parser/converter.py` do?

[Assistant]
**`build_default_config()`** in `PDF_parser/converter.py`:
```python
def build_default_config(
```

Create a sensible default ``ConversionConfig`` for command‑line use.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `run_full_conversion()` function in `PDF_parser/converter.py` do?<|im_end|>
<|im_start|>assistant
**`run_full_conversion()`** in `PDF_parser/converter.py`:
```python
def run_full_conversion(
```

Run the conversion pipeline and print a timing summary.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `run_full_conversion()` function in `PDF_parser/converter.py` do?

[Assistant]
**`run_full_conversion()`** in `PDF_parser/converter.py`:
```python
def run_full_conversion(
```

Run the conversion pipeline and print a timing summary.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `PDF_parser/converter.py`?<|im_end|>
<|im_start|>assistant
**`PDF_parser/converter.py`** — PDF to Markdown conversion

This module contains 1229 lines of Python code with 6 class(es) and 8 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `PDF_parser/converter.py`?

[Assistant]
**`PDF_parser/converter.py`** — PDF to Markdown conversion

This module contains 1229 lines of Python code with 6 class(es) and 8 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What classes and functions are in PDF_parser/layout.py?<|im_end|>
<|im_start|>assistant
**PDF_parser/layout.py** — Page layout analysis

**Lines**: 149
**Classes** (1): BoundingBox
**Functions** (1): passes_size_filter
<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What classes and functions are in PDF_parser/layout.py?

[Assistant]
**PDF_parser/layout.py** — Page layout analysis

**Lines**: 149
**Classes** (1): BoundingBox
**Functions** (1): passes_size_filter


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `passes_size_filter()` function in `PDF_parser/layout.py` do?<|im_end|>
<|im_start|>assistant
**`passes_size_filter()`** in `PDF_parser/layout.py`:
```python
def passes_size_filter(
```

Determine whether a block meets a minimum size requirement.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `passes_size_filter()` function in `PDF_parser/layout.py` do?

[Assistant]
**`passes_size_filter()`** in `PDF_parser/layout.py`:
```python
def passes_size_filter(
```

Determine whether a block meets a minimum size requirement.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `PDF_parser/layout.py`?<|im_end|>
<|im_start|>assistant
**`PDF_parser/layout.py`** — Page layout analysis

This module contains 149 lines of Python code with 1 class(es) and 1 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `PDF_parser/layout.py`?

[Assistant]
**`PDF_parser/layout.py`** — Page layout analysis

This module contains 149 lines of Python code with 1 class(es) and 1 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What classes and functions are in PDF_parser/tables.py?<|im_end|>
<|im_start|>assistant
**PDF_parser/tables.py** — Table detection

**Lines**: 283
**Classes** (2): TableData, TableProcessor
<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What classes and functions are in PDF_parser/tables.py?

[Assistant]
**PDF_parser/tables.py** — Table detection

**Lines**: 283
**Classes** (2): TableData, TableProcessor


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `PDF_parser/tables.py`?<|im_end|>
<|im_start|>assistant
**`PDF_parser/tables.py`** — Table detection

This module contains 283 lines of Python code with 2 class(es) and 0 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `PDF_parser/tables.py`?

[Assistant]
**`PDF_parser/tables.py`** — Table detection

This module contains 283 lines of Python code with 2 class(es) and 0 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What classes and functions are in PDF_parser/images.py?<|im_end|>
<|im_start|>assistant
**PDF_parser/images.py** — Image extraction

**Lines**: 263
**Classes** (2): ImageInfo, ImageExtractor
<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What classes and functions are in PDF_parser/images.py?

[Assistant]
**PDF_parser/images.py** — Image extraction

**Lines**: 263
**Classes** (2): ImageInfo, ImageExtractor


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `PDF_parser/images.py`?<|im_end|>
<|im_start|>assistant
**`PDF_parser/images.py`** — Image extraction

This module contains 263 lines of Python code with 2 class(es) and 0 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `PDF_parser/images.py`?

[Assistant]
**`PDF_parser/images.py`** — Image extraction

This module contains 263 lines of Python code with 2 class(es) and 0 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What classes and functions are in pymu_rag_launcher.py?<|im_end|>
<|im_start|>assistant
**pymu_rag_launcher.py** — Main application launcher

**Lines**: 425
**Functions** (18): is_frozen, bundled_root, runtime_root, legacy_runtime_root, migrate_legacy_runtime_home, should_skip_copy, is_mutable_runtime_data_path, file_fingerprint, target_matches_source_metadata, copy_tree_preserving_data, ... (+8 more)
<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What classes and functions are in pymu_rag_launcher.py?

[Assistant]
**pymu_rag_launcher.py** — Main application launcher

**Lines**: 425
**Functions** (18): is_frozen, bundled_root, runtime_root, legacy_runtime_root, migrate_legacy_runtime_home, should_skip_copy, is_mutable_runtime_data_path, file_fingerprint, target_matches_source_metadata, copy_tree_preserving_data, ... (+8 more)


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `is_frozen()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`is_frozen()`** in `pymu_rag_launcher.py`:
```python
def is_frozen() -> bool:
```

This function is part of the main application launcher.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `is_frozen()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`is_frozen()`** in `pymu_rag_launcher.py`:
```python
def is_frozen() -> bool:
```

This function is part of the main application launcher.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `bundled_root()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`bundled_root()`** in `pymu_rag_launcher.py`:
```python
def bundled_root() -> Path:
```

This function is part of the main application launcher.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `bundled_root()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`bundled_root()`** in `pymu_rag_launcher.py`:
```python
def bundled_root() -> Path:
```

This function is part of the main application launcher.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `runtime_root()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`runtime_root()`** in `pymu_rag_launcher.py`:
```python
def runtime_root() -> Path:
```

This function is part of the main application launcher.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `runtime_root()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`runtime_root()`** in `pymu_rag_launcher.py`:
```python
def runtime_root() -> Path:
```

This function is part of the main application launcher.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `legacy_runtime_root()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`legacy_runtime_root()`** in `pymu_rag_launcher.py`:
```python
def legacy_runtime_root() -> Path:
```

Adopt the pre-unification PyMuRAGWorkspace home on first launch.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `legacy_runtime_root()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`legacy_runtime_root()`** in `pymu_rag_launcher.py`:
```python
def legacy_runtime_root() -> Path:
```

Adopt the pre-unification PyMuRAGWorkspace home on first launch.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `migrate_legacy_runtime_home()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`migrate_legacy_runtime_home()`** in `pymu_rag_launcher.py`:
```python
def migrate_legacy_runtime_home(root: Path) -> None:
```

Adopt the pre-unification PyMuRAGWorkspace home on first launch.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `migrate_legacy_runtime_home()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`migrate_legacy_runtime_home()`** in `pymu_rag_launcher.py`:
```python
def migrate_legacy_runtime_home(root: Path) -> None:
```

Adopt the pre-unification PyMuRAGWorkspace home on first launch.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `should_skip_copy()` function in `pymu_rag_launcher.py` do?<|im_end|>
<|im_start|>assistant
**`should_skip_copy()`** in `pymu_rag_launcher.py`:
```python
def should_skip_copy(path: Path) -> bool:
```

This function is part of the main application launcher.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `should_skip_copy()` function in `pymu_rag_launcher.py` do?

[Assistant]
**`should_skip_copy()`** in `pymu_rag_launcher.py`:
```python
def should_skip_copy(path: Path) -> bool:
```

This function is part of the main application launcher.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `pymu_rag_launcher.py`?<|im_end|>
<|im_start|>assistant
**`pymu_rag_launcher.py`** — Main application launcher

This module contains 425 lines of Python code with 18 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `pymu_rag_launcher.py`?

[Assistant]
**`pymu_rag_launcher.py`** — Main application launcher

This module contains 425 lines of Python code with 18 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What classes and functions are in rag_core.py?<|im_end|>
<|im_start|>assistant
**rag_core.py** — Core RAG functionality

**Lines**: 362
**Functions** (18): normalize_path, _escape_sql_string, _safe_lancedb_filter_value, _safe_lancedb_key, _safe_lancedb_id_list, _chunk_id, model_to_db_name, model_to_db_path, list_available_databases, _get_embedding_schema, ... (+8 more)
<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What classes and functions are in rag_core.py?

[Assistant]
**rag_core.py** — Core RAG functionality

**Lines**: 362
**Functions** (18): normalize_path, _escape_sql_string, _safe_lancedb_filter_value, _safe_lancedb_key, _safe_lancedb_id_list, _chunk_id, model_to_db_name, model_to_db_path, list_available_databases, _get_embedding_schema, ... (+8 more)


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `normalize_path()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`normalize_path()`** in `rag_core.py`:
```python
def normalize_path(path: str) -> str:
```

This function is part of the core rag functionality.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `normalize_path()` function in `rag_core.py` do?

[Assistant]
**`normalize_path()`** in `rag_core.py`:
```python
def normalize_path(path: str) -> str:
```

This function is part of the core rag functionality.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `model_to_db_name()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`model_to_db_name()`** in `rag_core.py`:
```python
def model_to_db_name(model_path: str) -> str:
```

This function is part of the core rag functionality.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `model_to_db_name()` function in `rag_core.py` do?

[Assistant]
**`model_to_db_name()`** in `rag_core.py`:
```python
def model_to_db_name(model_path: str) -> str:
```

This function is part of the core rag functionality.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `model_to_db_path()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`model_to_db_path()`** in `rag_core.py`:
```python
def model_to_db_path(model_path: str, db_root: str = DB_ROOT) -> str:
```

This function is part of the core rag functionality.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `model_to_db_path()` function in `rag_core.py` do?

[Assistant]
**`model_to_db_path()`** in `rag_core.py`:
```python
def model_to_db_path(model_path: str, db_root: str = DB_ROOT) -> str:
```

This function is part of the core rag functionality.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `list_available_databases()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`list_available_databases()`** in `rag_core.py`:
```python
def list_available_databases(db_root: str = DB_ROOT) -> List[str]:
```

This function is part of the core rag functionality.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `list_available_databases()` function in `rag_core.py` do?

[Assistant]
**`list_available_databases()`** in `rag_core.py`:
```python
def list_available_databases(db_root: str = DB_ROOT) -> List[str]:
```

This function is part of the core rag functionality.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `create_vector_index()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`create_vector_index()`** in `rag_core.py`:
```python
def create_vector_index(tbl) -> None:
```

Create IVF_FLAT vector index if it does not already exist.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `create_vector_index()` function in `rag_core.py` do?

[Assistant]
**`create_vector_index()`** in `rag_core.py`:
```python
def create_vector_index(tbl) -> None:
```

Create IVF_FLAT vector index if it does not already exist.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What does the `read_gguf_metadata()` function in `rag_core.py` do?<|im_end|>
<|im_start|>assistant
**`read_gguf_metadata()`** in `rag_core.py`:
```python
def read_gguf_metadata(
```

This function is part of the core rag functionality.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What does the `read_gguf_metadata()` function in `rag_core.py` do?

[Assistant]
**`read_gguf_metadata()`** in `rag_core.py`:
```python
def read_gguf_metadata(
```

This function is part of the core rag functionality.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of `rag_core.py`?<|im_end|>
<|im_start|>assistant
**`rag_core.py`** — Core RAG functionality

This module contains 362 lines of Python code with 18 function(s). <|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of `rag_core.py`?

[Assistant]
**`rag_core.py`** — Core RAG functionality

This module contains 362 lines of Python code with 18 function(s).


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What endpoints does SimpleRAG expose for document management?<|im_end|>
<|im_start|>assistant
**Document endpoints** (from `GUI/router.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| POST | `/api/documents/upload` | Upload PDF for processing |
| GET | `/api/documents` | List all documents |
| GET | `/api/documents/{id}` | Get document metadata |
| DELETE | `/api/documents/{id}` | Remove document and chunks |
| POST | `/api/documents/reindex` | Rebuild search index |
| GET | `/api/documents/{id}/chunks` | List document chunks |<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What endpoints does SimpleRAG expose for document management?

[Assistant]
**Document endpoints** (from `GUI/router.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| POST | `/api/documents/upload` | Upload PDF for processing |
| GET | `/api/documents` | List all documents |
| GET | `/api/documents/{id}` | Get document metadata |
| DELETE | `/api/documents/{id}` | Remove document and chunks |
| POST | `/api/documents/reindex` | Rebuild search index |
| GET | `/api/documents/{id}/chunks` | List document chunks |


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What chat endpoints does SimpleRAG expose?<|im_end|>
<|im_start|>assistant
**Chat endpoints** (from `GUI/router.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| POST | `/api/chat` | RAG-augmented chat |
| POST | `/api/chat/stream` | Streaming SSE chat |
| GET | `/api/chat/history` | Chat message history |
| DELETE | `/api/chat/history` | Clear chat history |<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What chat endpoints does SimpleRAG expose?

[Assistant]
**Chat endpoints** (from `GUI/router.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| POST | `/api/chat` | RAG-augmented chat |
| POST | `/api/chat/stream` | Streaming SSE chat |
| GET | `/api/chat/history` | Chat message history |
| DELETE | `/api/chat/history` | Clear chat history |


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
How does the knowledge graph endpoint work?<|im_end|>
<|im_start|>assistant
The `/api/graph/search` endpoint accepts a query string and returns entity-relationship results:

1. Query is processed by `GUI/hybrid_graph_service.py`
2. Entities matching the query are found in the graph
3. Related entities and edges are retrieved
4. Results include entity names, types, relationships, and confidence scores
5. The Discord bot's `/graph search` command calls this endpoint

The graph is workspace-scoped — each workspace has its own independent graph.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] How does the knowledge graph endpoint work?

[Assistant]
The `/api/graph/search` endpoint accepts a query string and returns entity-relationship results:

1. Query is processed by `GUI/hybrid_graph_service.py`
2. Entities matching the query are found in the graph
3. Related entities and edges are retrieved
4. Results include entity names, types, relationships, and confidence scores
5. The Discord bot's `/graph search` command calls this endpoint

The graph is workspace-scoped — each workspace has its own independent graph.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What model management endpoints are available?<|im_end|>
<|im_start|>assistant
**Model endpoints** (from `GUI/llama_cpp_routes.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| GET | `/api/models` | List available models |
| POST | `/api/models/load` | Load a model |
| POST | `/api/models/unload` | Unload current model |
| GET | `/api/models/status` | Current model info |
| GET | `/api/models/embedders` | List embedding models |<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What model management endpoints are available?

[Assistant]
**Model endpoints** (from `GUI/llama_cpp_routes.py`):

| Method | Endpoint | Purpose |
|:---|:---|:---|
| GET | `/api/models` | List available models |
| POST | `/api/models/load` | Load a model |
| POST | `/api/models/unload` | Unload current model |
| GET | `/api/models/status` | Current model info |
| GET | `/api/models/embedders` | List embedding models |


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
How do I add a new API endpoint to SimpleRAG?<|im_end|>
<|im_start|>assistant
To add a new endpoint to SimpleRAG:

1. Open `GUI/router.py` (~4600 lines)
2. Add a new route handler:
```python
@router.get("/api/my-endpoint")
async def my_endpoint(param: str = Query(...)):
    return {"result": param}
```
3. The router is included in `PDF_parser/chat_backend.py` which creates the FastAPI app
4. Restart the launcher to apply changes
5. Test with: `curl http://127.0.0.1:8010/api/my-endpoint?param=test`<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] How do I add a new API endpoint to SimpleRAG?

[Assistant]
To add a new endpoint to SimpleRAG:

1. Open `GUI/router.py` (~4600 lines)
2. Add a new route handler:
```python
@router.get("/api/my-endpoint")
async def my_endpoint(param: str = Query(...)):
    return {"result": param}
```
3. The router is included in `PDF_parser/chat_backend.py` which creates the FastAPI app
4. Restart the launcher to apply changes
5. Test with: `curl http://127.0.0.1:8010/api/my-endpoint?param=test`


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
How does SimpleRAG handle the venv and dependencies?<|im_end|>
<|im_start|>assistant
SimpleRAG uses a Python 3.12 virtual environment at `.venv/`:

**Key packages**: fastapi 0.115.0, pymupdf 1.24.5, torch 2.4.1, transformers 4.51.0, sentence-transformers 3.0.1, discord.py 2.4.0, unsloth 2026.8.14, peft 0.20.0, trl 0.24.0

**Critical pitfall**: Hermes agent runs Python 3.11 with its own numpy. Always use:
```bash
PYTHONPATH="" .venv/Scripts/python.exe <command>
```
Without this, Python 3.11's numpy C extensions crash Python 3.12.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] How does SimpleRAG handle the venv and dependencies?

[Assistant]
SimpleRAG uses a Python 3.12 virtual environment at `.venv/`:

**Key packages**: fastapi 0.115.0, pymupdf 1.24.5, torch 2.4.1, transformers 4.51.0, sentence-transformers 3.0.1, discord.py 2.4.0, unsloth 2026.8.14, peft 0.20.0, trl 0.24.0

**Critical pitfall**: Hermes agent runs Python 3.11 with its own numpy. Always use:
```bash
PYTHONPATH="" .venv/Scripts/python.exe <command>
```
Without this, Python 3.11's numpy C extensions crash Python 3.12.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
What is the purpose of each directory in the SimpleRAG project?<|im_end|>
<|im_start|>assistant
| Directory | Purpose |
|:---|:---|
| `GUI/` | Main application code — router, PDF parser, chat, Discord bot, graph, embeddings |
| `PDF_parser/` | Low-level PDF parsing library — layout, tables, images, conversion |
| `SimpleUI/` | React + Vite frontend |
| `electron_app/` | Electron desktop shell |
| `TrainingModel/` | Model training scripts and datasets |
| `tests/` | pytest test suite (1150+ tests) |
| `.venv/` | Python 3.12 virtual environment |
| `Echidna-*/` | Trained model outputs |<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] What is the purpose of each directory in the SimpleRAG project?

[Assistant]
| Directory | Purpose |
|:---|:---|
| `GUI/` | Main application code — router, PDF parser, chat, Discord bot, graph, embeddings |
| `PDF_parser/` | Low-level PDF parsing library — layout, tables, images, conversion |
| `SimpleUI/` | React + Vite frontend |
| `electron_app/` | Electron desktop shell |
| `TrainingModel/` | Model training scripts and datasets |
| `tests/` | pytest test suite (1150+ tests) |
| `.venv/` | Python 3.12 virtual environment |
| `Echidna-*/` | Trained model outputs |


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
How does the Discord bot auto-detect the SimpleRAG backend?<|im_end|>
<|im_start|>assistant
The Discord bot (`GUI/discord_bot.py`, ~2170 lines) auto-discovers the backend:

1. **Port scan**: Checks ports 18110-18130 and 8000-8034
2. **Log inspection**: Reads Electron app logs for backend URL
3. **OpenAPI verification**: Fetches `/openapi.json` to confirm SimpleRAG identity and discover endpoints (journal, knowledge graph, documents)
4. **Health check**: Confirms backend is responsive

The bot requires the SimpleRAG desktop app to be running with a loaded model.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] How does the Discord bot auto-detect the SimpleRAG backend?

[Assistant]
The Discord bot (`GUI/discord_bot.py`, ~2170 lines) auto-discovers the backend:

1. **Port scan**: Checks ports 18110-18130 and 8000-8034
2. **Log inspection**: Reads Electron app logs for backend URL
3. **OpenAPI verification**: Fetches `/openapi.json` to confirm SimpleRAG identity and discover endpoints (journal, knowledge graph, documents)
4. **Health check**: Confirms backend is responsive

The bot requires the SimpleRAG desktop app to be running with a loaded model.


<|im_start|>system
You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.<|im_end|>
<|im_start|>user
How does SimpleRAG handle GPU layer offloading for llama.cpp?<|im_end|>
<|im_start|>assistant
GPU layer offloading in `GUI/llama_cpp_runtime.py`:

1. Detects available GPU memory via `torch` or `llama.cpp` APIs
2. Calculates how many model layers fit in VRAM
3. Passes `n_gpu_layers` parameter to llama.cpp loader
4. Remaining layers run on CPU
5. Embedding models can also use GPU offloading via `GUI/embedding_manager.py`

On the RX 6750 XT (12GB), typically 20-28 of 28 layers fit for 0.5B models.<|im_end|>

[System] You are Echidna, the AI assistant for SimpleRAG — an offline-first RAG desktop application (FastAPI backend port 8010, React frontend port 8080). You understand every module, function, endpoint, and configuration in the codebase.

[User] How does SimpleRAG handle GPU layer offloading for llama.cpp?

[Assistant]
GPU layer offloading in `GUI/llama_cpp_runtime.py`:

1. Detects available GPU memory via `torch` or `llama.cpp` APIs
2. Calculates how many model layers fit in VRAM
3. Passes `n_gpu_layers` parameter to llama.cpp loader
4. Remaining layers run on CPU
5. Embedding models can also use GPU offloading via `GUI/embedding_manager.py`

On the RX 6750 XT (12GB), typically 20-28 of 28 layers fit for 0.5B models.