当前位置: 首页 > Skill >

Fabrik Codek

Fabrik Codek

Fabrik Codek

个人认知架构,学习您的工作方式。从会话中构建知识图谱,分析专业技能,按任务适配检索。

1.10.0 2026.11.17 787
获取Skill文件查看使用说明
作 者:周澄 许可证: 更新时间:2026.11.17
本文目录展开

Fabrik-Codek

A 7B model that knows you is worth more than a 400B that doesn't.

Fabrik-Codek is a personal cognitive architecture that runs locally with any Ollama model. It doesn't just retrieve documents — it builds a knowledge graph from how you work, measures your expertise per topic, routes tasks to the right model with the right retrieval strategy, observes whether its responses actually helped, and refines itself over time.

How It Works

  1. You work — Fabrik-Codek captures code changes, session transcripts, decisions, and learnings in a local datalake
  2. Knowledge extraction — An 11-step pipeline extracts entities and relationships into a knowledge graph alongside a vector DB
  3. Personal profiling — Analyzes your datalake to learn your domain, stack, patterns, and tooling preferences
  4. Competence scoring — Measures how deep your knowledge is per topic (Expert / Competent / Novice / Unknown)
  5. Adaptive routing — Classifies each query by task type and topic, selects the right model, adapts retrieval depth, and builds a 3-layer system prompt
  6. Outcome tracking — Infers whether responses were useful from conversational patterns (zero friction, no manual feedback)
  7. Self-correction — Adjusts retrieval parameters for underperforming task/topic combinations

Every interaction feeds back into the system. Fabrik-Codek itself makes zero outbound network requests — it only connects to Ollama and optionally Meilisearch on localhost. Model downloads are handled by Ollama's own CLI (ollama pull), not by Fabrik-Codek.

Setup

Configure as an MCP server in your openclaw.json or ~/.claude/settings.json:

{
  "mcpServers": {
    "fabrik-codek": {
      "command": "fabrik",
      "args": ["mcp"]
    }
  }
}

For network access (SSE transport):

{
  "mcpServers": {
    "fabrik-codek": {
      "command": "fabrik",
      "args": ["mcp", "--transport", "sse", "--port", "8421"]
    }
  }
}

First Run

After installing, initialize and build the knowledge base:

fabrik init                              # Set up config, download models
fabrik graph build --include-transcripts  # Build knowledge graph from sessions
fabrik rag index                         # Index datalake into vector DB
fabrik profile build                     # Build your personal profile
fabrik competence build                  # Build competence map

Available MCP Tools

fabrik_ask

Ask a question to the local LLM with optional context from the knowledge base. The Task Router automatically classifies your query, selects the right model based on your competence, adapts retrieval strategy, and builds a personalized system prompt.

  • use_rag=true — vector search context
  • use_graph=true — hybrid context (vector + graph + full-text)

Example: "How should I handle database connection pooling?"

fabrik_search

Semantic vector search across your accumulated knowledge. Returns the most relevant documents, patterns, and examples by meaning — not just keywords.

Example: "Find examples of retry logic with exponential backoff"

fabrik_graph_search

Traverse the knowledge graph to find entities (technologies, patterns, strategies) and their relationships. Useful for understanding how concepts connect in your experience.

  • depth — how many hops to traverse (default: 2)

Example: "What technologies are related to FastAPI in my knowledge graph?"

fabrik_fulltext_search

Full-text keyword search via Meilisearch. Use this for exact keyword or phrase matching when you know the specific terms. Optional — the system works without Meilisearch installed.

Example: "Search for 'EXPLAIN ANALYZE' in my knowledge base"

fabrik_graph_stats

Knowledge graph statistics: entity count, edge count, connected components, type breakdown, and relation types.

fabrik_status

System health check: Ollama availability, RAG engine, knowledge graph, full-text search, and datalake status.

Available MCP Resources

URI Description
fabrik://status System component status
fabrik://graph/stats Knowledge graph statistics
fabrik://config Current configuration (sanitized)

When to Use Each Tool

Scenario Tool Why
Coding question needing context fabrik_ask with use_graph=true Gets hybrid retrieval + personalized prompt
Find similar patterns or examples fabrik_search Semantic similarity across all knowledge
Understand how concepts relate fabrik_graph_search Graph traversal shows entity relationships
Find exact terms or phrases fabrik_fulltext_search BM25 keyword matching
Check if knowledge base is healthy fabrik_status Component health check
Understand knowledge distribution fabrik_graph_stats Entity/edge counts and types

The Cognitive Loop

The system gets smarter the more you use it:

You work → Flywheel captures it → Pipeline extracts knowledge
    ↑                                        ↓
Strategy Optimizer ← Outcome Tracker ← LLM responds with context
    ↓                                        ↑
    └──── adjusts retrieval ──→ Task Router ─┘
                                    ↓
                  Profile + Competence + task-specific prompt
  • Personal Profile learns your domain, stack, and preferences from your datalake
  • Competence Model scores expertise per topic using 4 signals (entry count, graph density, recency, outcome rate)
  • Task Router classifies queries into 7 task types, detects topic, selects model, adapts retrieval
  • Outcome Tracker infers response quality from conversational patterns (topic change = accepted, reformulation = rejected)
  • Strategy Optimizer adjusts retrieval parameters for weak spots
  • Graph Temporal Decay fades stale knowledge, reinforces recent activity
  • Semantic Drift Detection alerts when an entity's context shifts between graph builds
  • Context Gate decides whether to inject RAG context at all (skips for generic queries where context would be noise)
  • Relevance Filter drops retrieved chunks with low query-text token overlap, preventing domain-specific knowledge from contaminating generic answers

Requirements

  • Fabrik-Codek installed from source (git clone + pip install -e ".[dev]")
  • Ollama running locally with any model (e.g., ollama pull qwen2.5-coder:7b)
  • Optional: Meilisearch for full-text search (system works without it)

Note on installation: Fabrik-Codek is an instruction-only skill — there is no automated installer. You install it manually from the GitHub repository via git clone + pip install -e ".[dev]". This lets you audit the full source code before installing. The skill itself contains documentation and MCP server configuration, not executable code.

Security & Privacy

No external network calls

Fabrik-Codek makes zero outbound network requests. It connects only to services running on your own machine:

  • Ollama at localhost:11434 — your locally running LLM server (for inference and embeddings)
  • Meilisearch at localhost:7700 (optional) — your locally running search engine

No telemetry, no analytics, no phone-home. Verify in the source: grep -r "requests.|httpx.|urllib" src/ — all HTTP calls target localhost only. The only network activity that occurs during setup is ollama pull, which is Ollama's own CLI downloading models from ollama.ai/library — Fabrik-Codek does not initiate or control these downloads.

What fabrik init does

fabrik init performs these local-only operations:

  1. Checks Python version (>= 3.11)
  2. Detects if Ollama is running at localhost:11434
  3. Creates a .env config file in the current directory
  4. Creates local data directories (./data/embeddings/, ./data/graphdb/, ./data/profile/)
  5. Pulls Ollama models via ollama pull — models are downloaded by Ollama itself from ollama.ai/library, not by Fabrik-Codek

Fabrik-Codek does not download any files from any server. Model downloads are handled entirely by Ollama's own CLI.

Data access scope

Reads (all local, all opt-in, never automatic):

Path What When Why
~/.claude/projects/*/ Session transcript JSONL files (already on disk from Claude Code) Only when you explicitly run fabrik learn process or fabrik graph build --include-transcripts Extracts entities and reasoning patterns to build the knowledge graph. This path is NOT in configPaths because Fabrik-Codek does not write to it — it is read-only and user-initiated.
./data/ or FABRIK_DATALAKE_PATH Your datalake (training pairs, captures, metadata) During graph build, rag index, profile build, competence build Source data for building the knowledge base and personal profile

Writes (all local):

Path What
./data/embeddings/ LanceDB vector index
./data/graphdb/ NetworkX knowledge graph (JSON)
./data/profile/ Personal profile, competence map, strategy overrides (JSON)
./data/01-raw/outcomes/ Outcome tracking records (JSONL)

All paths are declared in the skill metadata configPaths. The skill never writes outside these directories.

Network transport

  • Default: stdio — no network listener, no ports opened, no exposure
  • Optional: sse — starts an HTTP server bound to 127.0.0.1:8421 by default (localhost only, not reachable from other machines)
  • If you change the SSE bind address to 0.0.0.0, your indexed data would be accessible over the network. Do not do this without proper firewall/ACL rules

Session transcript privacy

The fabrik learn command reads Claude Code session transcripts, which may contain sensitive data (code, credentials, conversation history). This command is opt-in — you must run it manually. It does not run in the background or on a schedule unless you explicitly configure fabrik learn watch. Review what's in your ~/.claude/projects/ before indexing.

Source verification

Fully open source at github.com/ikchain/Fabrik-Codek (MIT license). Clone the repo and audit before installing.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,002
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,001
PHP集成RabbitMQ实现消息队列的完整步骤

使用 php-amqplib 库,通过建立连接、声明交换机与队列并绑定,即可在 PHP 中实现消息的发送与消费。

2026.05.24 1,001
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
Skill 文件
  • SKILL.md
    • Fabrik-Codek
    • How It Works
    • Setup
      • First Run
    • Available MCP Tools
      • fabrik_ask
      • fabrik_search
      • fabrik_graph_search
      • fabrik_fulltext_search
      • fabrik_graph_stats
      • fabrik_status
    • Available MCP Resources
    • When to Use Each Tool
    • The Cognitive Loop
    • Requirements
    • Security & Privacy
      • No external network calls
      • What fabrik init does
      • Data access scope
      • Network transport
      • Session transcript privacy
      • Source verification
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期