# Telelibra Knowledge Cloud — Full Technical & Security Q&A Session

**Comprehensive 25-Question Transparency Guide to Data Processing, Privacy, AI Inference, Cryptography, and GDPR Compliance**

---

## Section 1: Core Architecture & Ingestion Lifecycle

### Q1: What is Telelibra Knowledge Cloud?
**Telelibra Knowledge Cloud** is an automated personal intelligence operating system and knowledge management SaaS ("Second Brain"). It connects to Telegram to ingest links, articles, documents, videos, and chat history exports (`messages.html` / `result.json`), transforming unstructured web content into clean, categorized **Obsidian Vaults** (Markdown) and **Google NotebookLM** compendiums, accessible via **Model Context Protocol (MCP)** for external AI agents.

### Q2: Does Telelibra have access to my private chats, contact book, or background Telegram activity?
**Strictly NO.** Telelibra operates under the fundamental security principle of **Explicit User Submission**. The service has zero background access to your Telegram client, personal dialogues, group chats, phone contacts, or private channels. The bot only receives and analyzes messages or files that you deliberately send directly to `@telelibra_ai_bot` or upload through the Telegram Mini App.

### Q3: How does the Zero-Credit Noise Shield protect my credit balance during Telegram export imports?
When you export your "Saved Messages" from Telegram Desktop, the export often contains system placeholders (e.g. *"PhotoNot included, change data exporting settings to download"*), chat stickers, voice messages, single-word reactions, or delivery notices. Telelibra's pre-ingestion engine analyzes these elements locally before any AI processing:
- System placeholders and orphan reactions are discarded immediately.
- **Zero credits are deducted** for any non-knowledge or noise element.
- Credits are deducted strictly on a 1-to-1 basis upon the successful synthesis and filing of a real web resource into your Obsidian Vault.

### Q4: What happens if a saved message contains sensitive numbers (bank cards, phone numbers, OTPs, IBANs)?
Our **Sensitive Number Filter** immediately detects numeric patterns matching credit/debit cards (13–19 digits), standalone phone numbers, OTP verification codes, and banking keywords. These messages are flagged as private noise: they are **never sent to external AI APIs**, never indexed into public summaries, and **zero credits are charged**.

### Q5: How does Canonical URL Normalization prevent duplicate credit charges?
Links saved across multiple years often carry tracking bloat (`?fbclid=...`, `?utm_source=...`, `?utm_medium=...`, `&feature=youtu.be`). Telelibra automatically strips these tracking tags while preserving essential query parameters (such as YouTube `v=` video IDs). This ensures that saving the same article or video multiple times resolves to the exact same canonical record, preventing duplicate processing and accidental double charges.

### Q6: How is my personal commentary or context preserved when I save a link?
If you add your own thoughts, pitches, or notes when forwarding a link (e.g. *"Review this architecture for our backend"*), Telelibra separates the link from your commentary. The commentary is sanitized and provided directly to Google Gemini 3.5 Flash as `user_context`. The resulting note includes your thoughts in an elegant callout:
```markdown
## User Note & Context
> [!NOTE] User Context
> Review this architecture for our backend
```

---

## Section 2: AI Processing, Google Gemini, & Data Privacy

### Q7: Which AI models process my notes, and are they trained on my data?
Telelibra utilizes **Google Gemini 3.5 Flash** (with fallback support for OpenAI GPT-4o / Azure OpenAI). Under our Google Cloud enterprise agreements and strict privacy policies, all data is processed in **Inference-Only mode**. **Your notes and data are NEVER used, logged, or retained by Google or any third party to train, fine-tune, or evaluate foundation AI models.**

### Q8: What is the 20-category taxonomy system?
Every processed resource is classified by Gemini into one of 20 standardized knowledge domains (e.g., `agents`, `workflows`, `dev`, `ai_models`, `research`, `ecommerce`, `legal`, `design`). Each domain maps to a physical directory within your Obsidian Vault, equipped with standardized tags and cross-note backlink architecture.

### Q9: How are multimodal visual snapshots and YouTube transcripts handled?
- **Web Pages**: Scraped with clean DOM extraction, stripping cookie banners and floating overlays.
- **YouTube Videos**: Automated extraction of spoken transcripts, with sound annotations (`[music]`, `[applause]`) and speaker stutters cleaned in the source language.
- **GitHub Repositories**: Direct ingestion of raw `README.md` and repository metadata.
- **Visuals**: Embedded screenshot snapshots for document verification.

---

## Section 3: Data Isolation, Storage, & Security

### Q10: How does Multi-Tenant Workspace Isolation work?
Telelibra is architected with strict physical and logical multi-tenancy:
- Each user is assigned an immutable internal UUID (derived from Telegram authentication).
- Every tenant operates with an independent filesystem directory (`vaults/tenants/<user_uuid>/`) and a dedicated SQLite database (`data/<user_uuid>/processed_links.db`).
- Cross-tenant data querying or directory traversal is strictly blocked at the kernel and application levels.

### Q11: What is Zero-Trace Logging?
Telelibra enforces structured privacy filters on all server logs:
- User note contents, raw article text, email addresses, phone numbers, and authentication tokens are automatically intercepted and redacted before logs are written to disk or Google Cloud Logging.
- Server logs contain only sanitized technical telemetry (e.g. request status codes, duration in ms).

### Q12: How are my notes stored, and can I access the raw files?
Your notes are stored as standard, open-format **Markdown (`.md`)** files with YAML frontmatter. You can download the entire archive as an **Obsidian Vault `.zip`** at any time and open it locally in Obsidian, Logseq, VS Code, or any text editor with zero vendor lock-in.

---

## Section 4: Cryptographic Anti-Spoofing & Archive Protection

### Q13: How does Telelibra prevent User ID spoofing when downloading export archives?
Telelibra implements an advanced cryptographic token system ([`crypto_security.py`](file:///Users/obolon_sky/telelibra/crypto_security.py)):
- Direct unauthenticated access to user archives via `/export/{user_uuid}` is strictly blocked.
- Archive downloads require a cryptographically signed token: `GET /export/download/{token}`.

### Q14: How are HMAC-SHA256 export tokens structured?
Export tokens consist of a URL-safe Base64 payload and a cryptographic HMAC-SHA256 signature generated using a server-side secret key:
1. **Payload**: contains `user_uuid`, `scope` (`export_download`), `issued_at` (UTC timestamp), `expires_at`, and a random cryptographic `nonce`.
2. **Signature**: calculated over the payload.
3. **Verification**: evaluated using constant-time comparison (`hmac.compare_digest`), completely eliminating timing attacks.

### Q15: What happens if an export download link expires or is tampered with?
- **Expiration**: Export tokens have a strict Time-To-Live (TTL) of 15 to 30 minutes. Once expired, the server returns `HTTP 403 Forbidden ("Token has expired")`.
- **Tampering**: If an attacker alters the `user_uuid` or payload in the token, the HMAC signature verification fails immediately, returning `HTTP 403 Forbidden ("Invalid cryptographic signature")`.

### Q16: How does the Model Context Protocol (MCP) gateway authenticate external AI agents?
When you connect Claude Desktop, Cursor, or Antigravity to Telelibra:
- A high-entropy bearer token (`mcp_sec_...`) is generated and associated with your tenant workspace.
- Inbound JSON-RPC 2.0 requests over HTTP (`POST /mcp`) must include this token in the `Authorization` or `token` header.
- Responses are serialized in the **TOON (Token-Oriented Object Notation)** format, reducing context window consumption by up to 45%.

---

## Section 5: Analytics, Proof of Delivery, & Abuse Protection

### Q17: What analytics events are collected and why?
Under our Radical Transparency Policy, Telelibra records 9 explicit operational events in [`data/telelibra_analytics.db`](file:///Users/obolon_sky/telelibra/data/telelibra_analytics.db):
1. `user_registered`: Account initialization timestamp.
2. `consent_accepted`: Legal proof of Terms & Privacy acceptance.
3. `payment_success`: Telegram Stars transaction audit record.
4. `sync_started` & `sync_completed`: Batch processing volume, duration, and credit balance.
5. `export_requested`: User trigger for archive generation.
6. `export_acknowledged`: **Legal & technical proof of digital service delivery** (user clicks "OK" in Mini App export modal).
7. `mcp_connected`: Remote AI agent tool invocation audit.
8. `data_deleted`: GDPR Article 17 audit trail confirming permanent deletion.

> ️ **Zero Content in Analytics**: The analytics ledger records metadata only (event type, duration in ms, credit balance, timestamp). Note contents, article texts, and private files are never stored in the analytics database.

### Q18: Why is the `/test_pay` command limited to a single execution per user?
The `/test_pay` command is provided strictly as a 1-time introductory trial (granting 1,000 sandbox test credits) so new users can verify the Obsidian Vault and Mini App features. To prevent abuse and protect cloud infrastructure, the execution is permanently recorded in `billing.json` (`test_pay_used: true`). Subsequent attempts are blocked.

### Q19: When is digital service delivery considered completed for refund purposes?
In accordance with international digital goods regulations and Telegram Stars terms, digital service delivery is deemed fully performed once the Second Brain base is generated, an archive export is created, the `export_acknowledged` event is logged, or an active MCP token is issued.

---

## Section 6: GDPR Compliance & Data Deletion

### Q20: How do I exercise my GDPR Article 17 "Right to Erasure" (`/delete_my_data`)?
You can delete your entire account and all associated data at any time:
1. Send the command `/delete_my_data` to `@telelibra_ai_bot` in Telegram.
2. Or click **"Удалить все данные (GDPR)"** on the legal settings screen in the Mini App.
3. **Execution**: Within 1 second, the server permanently removes your tenant directory, Obsidian Vault Markdown files, SQLite database, MCP tokens, and billing records from disk (`shutil.rmtree`).

### Q21: What data remains after executing `/delete_my_data`?
**Zero identifiable data remains.** All personal files, links, notes, and lookup mappings are deleted. Only an anonymous audit event `data_deleted` is recorded to prove GDPR compliance.

### Q22: Can deleted data be recovered?
**No.** We do not maintain hidden shadow backups of deleted tenant vaults. Once deleted, the action is irreversible.

### Q23: How does Telelibra comply with GDPR Article 20 "Right to Data Portability"?
You can export your entire personal Second Brain at any moment in open, standard formats:
- **Obsidian Vault (`.zip`)**: contains `profile.json`, `metadata.json`, `notes.jsonl`, and the `documents/` folder with all categorized Markdown files.
- **Google NotebookLM (`.md`)**: a consolidated master compendium ready for AI audio overview synthesis.

### Q24: Where are the servers hosted, and what are the security standards?
Telelibra runs on **Google Cloud Platform (Cloud Run & Cloud Storage)** in the `europe-west1` (Belgium, European Union) region, complying with EU data sovereignty standards, ISO/IEC 27001, and GDPR Article 28 data processor obligations.

### Q25: How do I contact the security & billing team?
For technical support, billing inquiries, or data privacy questions:
- Telegram Bot: `/paysupport`
- Direct Support Bot: `@telelibra_ai_bot`
- Official Website & Documentation: `https://telelibra-cloud-ayybjhe7uq-ew.a.run.app`