
What's New in the Shared Package:
#

CodeSage: The Elite AI Coding Assistant [APEX v1.2.1]
CodeSage is not just another "chat with your code" tool. It is a high-performance **Database, Incubator, and Personal Think Tank** designed to revolutionize the way developers interact with Artificial Intelligence. By moving away from local hardware constraints and toward a structured, cloud-native memory architecture, CodeSage levels the playing field for every developer.
---
##

Core Philosophy: The Sovereign Think Tank
CodeSage is built on the principle of **Sovereign Intelligence**. It treats your coding workflow as a persistent asset.
* **Database First**: Unlike ephemeral chat windows, CodeSage is an umbrella of **SQLite-backed Projects**. Every decision, discovery, and line of code is stored in a structured `project_memory.db`.
* **The 100MB Workflow**: Each project supports up to **100MB of text-based workflow data**. This allows you to incubate massive, multi-file software systems without losing the "thread" of development.
* **The Blackboard (Temp Memory)**: The Blackboard acts as the "shared brain" between you and the AI. It is a persistent context layer that you can save, wipe, or reload instantly. When you load a `.sage` file, your entire mental state—including chat history and project requirements—is restored to the Blackboard.
* **100% Cloud-Native**: By leveraging high-performance cloud APIs (DeepSeek-V4, OpenRouter), CodeSage removes the **Hardware Bottleneck**. Whether you are on a $5,000 workstation or a $300 budget laptop, you have access to the exact same reasoning power.
---
##

Claude-Mem: The Long-Term Memory Expansion
The **Claude-Mem Expansion Pack** is the secret weapon of the CodeSage ecosystem. It is designed specifically to solve the "Context Collapse" problem and reduce token costs.
###

Key Benefits:
1. **Token Efficiency**: By retrieving context semantically from memory rather than re-reading the entire codebase, you can save up to **89% in token usage** on complex tasks.
2. **Semantic Retrieval**: Claude-Mem uses a vector-based "Observations" system. It remembers *why* you made a choice, not just *what* the choice was.
3. **Project Synchronisation**: The `sync_claude_mem.py` bridge automatically imports high-level insights from Claude's long-term memory into the CodeSAGE Project DB's **Decisions Table**.
---
##

Technical Specs & Forensic Transparency
CodeSage v1.2.1 introduces **Apex-Level Transparency** to ensure you are never guessing which engine is under the hood.
* **Forensic Engine Tags**: Every AI response includes a blue diagnostic tag: `● [ENGINE VERIFIED: Model Name]`. This provides the **Server Truth**, eliminating model "Identity Confusion."
* **DeepSeek-V4 Default**: Native integration with **DeepSeek V4 Pro** (High Precision) and **V4 Flash** (Ultra Speed).
* **Custom Model Support**: Access ANY model from OpenRouter instantly by entering its technical ID (e.g., `mistralai/pixtral-12b`).
* **Knowledge Window**: Static training up to **February 2026**, with fine-tuning extending to **early April 2026**.
* **BrowseComp Integration**: For data post-April 2026, CodeSage uses live web search to bridge the gap.
##

Smart Upgrade: Safety First
For users moving from older versions of CodeSage, we have implemented a **Sovereign Migration** protocol to ensure no data is lost during the transition to the Apex edition.
* **setup_codesage.py**: The shared distribution now includes a dedicated safety script. When run, it:
* **Detects Existing Projects**: Scans for previous project databases and merges them into the new registry without overwriting.
* **Protects .env**: Ensures your current API keys and environmental configurations are preserved.
* **Validates Architecture**: Checks the directory structure and ensures all necessary folders (`projects`, `saved_projects`, `backups`) are correctly initialized for the new version.
---
##

Power User Guide: Master the Interface
###

Shortcuts for Speed
* `Ctrl + Enter`: Send Message
* `Ctrl + P`: **Command Palette** (Search models, tools, and sessions)
* `Ctrl + N`: New Project (Fresh start)
* `Ctrl + S`: Save Project (`.sage` file)
* `Ctrl + L`: Load Project
* `Ctrl + F`: Forensic Search (Search within chat history)
###

Custom Aesthetics
Access the **Theme Gallery** (Settings

) to toggle between premium, high-contrast modes:
* **Midnight Ocean**: Professional deep navy.
* **Obsidian**: Pure OLED black.
* **Nord Frost**: Clean blue-grey aesthetic.
* **Dracula**: The iconic dark mode for developers.
---
##

Rules of Engagement (The AI "Bible")
CodeSage operates under a strict **Sovereign Ruleset** (AI.md) to ensure project safety:
1. **Surgical Precision**: Only modify what is asked. No "silent refactoring."
2. **Zero-Autonomy**: No package installs or file deletions without explicit permission.
3. **The Suggestions Gate**: All optimizations or bugs found outside the request are quarantined in an "ARCHITECTURAL SUGGESTIONS" block at the end.
4. **Comment Integrity**: Existing comments and debug logs are never removed.
---
>

*“The more I share, the more it will be developed further.”*
>
> **Stay Sovereign. Stay Sharp.**
> — CodeSage Development Team v1.2.1