AI Agent Hub
Back to skills
Token Secretary: Save Tokens icon

Token Secretary: Save Tokens

AI Agent Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_5b2fc4e3/token-sheng into your AI assistant.

About this skill

What It Solves

Token Secretary targets a concrete problem: cloud models often ingest long local knowledge context at once, increasing token cost and drifting from the source material. It fixes a retrieval → compression → cloud refinement pipeline so DeepSeek receives a filtered, compressed evidence block instead of raw documents.

How It Works

The skill reuses GLOBAL_RULES.md and existing local scripts:
- Intent classification: casual chat is answered directly; technical, process, and quote cases continue.
- Entity extraction: pulls materials, processes, parameters, and question type from the prompt.
- Dual retrieval: keyword search and FAISS semantic search run in parallel, then merge and keep up to 20 items.
- Local compression: llama3.2:1b compresses to under 500 characters; on timeout it falls back to the first 3 raw snippets.
- Cloud refinement: DeepSeek answers from the compressed block, with an observability marker at the start.

It depends on knowledge_querier.py, rag_semantic_search.py, compress_knowledge.sh, and the GLOBAL_RULES.md patterns. If FAISS, Ollama, or compression is unavailable, it degrades to keyword search, raw truncation, or pure cloud inference. It suits engineers with a local knowledge base who need controlled cloud token use, not fresh research without local sources.

Use Cases

  • When answering material, process, and parameter questions, retrieve local keyword and semantic evidence, then compress it before cloud drafting.
  • Before preparing a quote, extract material, process, and parameter clues from the local knowledge base into a short evidence block for DeepSeek.
  • While maintaining an Agentic RAG setup, reuse GLOBAL_RULES intent, extraction, and fallback behavior instead of rewriting scripts.
  • Before generating STEP suggestions, search local process notes and compress them to provide material context to the cloud model.

Best For

  • Engineers with a local process knowledge base who need material, process, and parameter lookups
  • Technical operations staff who compress retrieval results before asking a cloud model to draft quotes
  • Automation engineers maintaining Agentic RAG scripts who want to reuse GLOBAL_RULES
  • Process support staff who need material answers with lower hallucination risk