io.github.ldclabs/KIP

编码与调试

by ldclabs

基于 Knowledge Graphs 的能力组件,用于实现持久记忆、知识演化与可解释交互。

什么是 io.github.ldclabs/KIP

基于 Knowledge Graphs 的能力组件,用于实现持久记忆、知识演化与可解释交互。

README

🧬 KIP (Knowledge Interaction Protocol)

English | 中文

<p align="center"> <em>A graph-oriented interaction protocol designed specifically for Large Language Models,<br/>bridging the gap between LLM and Knowledge Graph.</em> </p>

What is KIP?

KIP (Knowledge Interaction Protocol) is a standard interaction protocol that bridges the gap between LLM (Probabilistic Reasoning Engine) and Knowledge Graph (Deterministic Knowledge Base). It is not merely a database interface, but a set of memory and cognitive operation primitives designed specifically for intelligent agents.

Large Language Models (LLMs) have demonstrated remarkable capabilities in general reasoning and generation. However, their "Stateless" essence results in a lack of long-term memory, while their probability-based generation mechanism often leads to uncontrollable "hallucinations" and knowledge obsolescence.

KIP was born to solve this problem through Neuro-Symbolic AI approach.

Key Benefits

  • 🧠 Memory Persistence: Transform conversations, observations, and reasoning results into structured "Knowledge Capsules"
  • 📈 Knowledge Evolution: Complete CRUD and metadata management for autonomous learning and error correction
  • 🔍 Explainable Interaction: Make every answer traceable and every decision logically transparent
  • LLM-Optimized: Protocol syntax optimized for Transformer architectures with native JSON structures

Quick Start

prolog
// Query: Find all drugs that treat headache
FIND(?drug.name)
WHERE {
  ?drug {type: "Drug"}
  (?drug, "treats", {name: "Headache"})
}
LIMIT 10
prolog
// Store: Create a new knowledge capsule
UPSERT {
  CONCEPT ?aspirin {
    {type: "Drug", name: "Aspirin"}
    SET ATTRIBUTES { molecular_formula: "C9H8O4", risk_level: 2 }
    SET PROPOSITIONS { ("treats", {type: "Symptom", name: "Headache"}) }
  }
}
WITH METADATA { source: "FDA", confidence: 0.95 }
prolog
// Explore: Discover schema
DESCRIBE PRIMER

Documentation

DocumentDescription
📖 SpecificationComplete KIP protocol specification (English)
📖 规范文档完整的 KIP 协议规范 (中文)
🤖 Agent InstructionsOperational guide for AI agents using KIP
⚙️ System InstructionsSystem-level maintenance and hygiene guide
📋 Function Definitionexecute_kip function schema for LLM integration

Core Concepts

Cognitive Nexus

A knowledge graph composed of Concept Nodes and Proposition Links, serving as the AI Agent's unified memory brain.

mermaid
graph LR
    subgraph "Cognitive Nexus"
        A[Drug: Aspirin] -->|treats| B[Symptom: Headache]
        A -->|is_class_of| C[DrugClass: NSAID]
        A -->|has_side_effect| D[Symptom: Stomach Upset]
    end

KIP Instruction Sets

Instruction SetPurposeExamples
KQL (Query)Knowledge retrieval and reasoningFIND, WHERE, FILTER
KML (Manipulation)Knowledge evolution and learningUPSERT, DELETE
META (Discovery)Schema exploration and groundingDESCRIBE, SEARCH

Schema Bootstrapping

KIP uses a self-describing schema where type definitions are stored within the graph itself:

  • $ConceptType: Meta-type for defining concept node types
  • $PropositionType: Meta-type for defining proposition predicates
  • Domain: Organizational units for knowledge

Resources

This repository includes ready-to-use resources for building KIP-powered AI agents:

📦 Knowledge Capsules (capsules/)

Pre-built knowledge capsules for bootstrapping your Cognitive Nexus:

CapsuleDescription
Genesis.kipFoundational capsule that bootstraps the entire type system
Person.kipPerson concept type for actors (AI, Human, Organization)
Event.kipEvent concept type for episodic memory
persons/self.kipThe $self concept instance
persons/system.kipThe $system concept instances

🧠 Hippocampus (hippocampus/)

A dedicated LLM layer that manages the Cognitive Nexus on behalf of business agents — no KIP knowledge required:

FileDescription
HippocampusFormation.mdSystem prompt for memory encoding (messages → structured knowledge)
HippocampusRecall.mdSystem prompt for memory retrieval (natural language → KIP → answer)
HippocampusMaintenance.mdSystem prompt for memory maintenance (sleep mode)
RecallFunctionDefinition.jsonrecall_memory function schema for business agent integration
code
┌─────────────────────┐
│   Business Agent    │  ← No KIP knowledge needed
└────────┬────────────┘
         │ Natural Language
         ▼
┌─────────────────────┐
│    Hippocampus      │  ← Formation / Recall / Maintenance
└────────┬────────────┘
         │ KIP (KQL/KML/META)
         ▼
┌─────────────────────┐
│  Cognitive Nexus    │  ← Persistent Knowledge Graph
└─────────────────────┘

🔌 MCP Server (mcp/)

kip-mcp-server - Model Context Protocol server that exposes KIP tools over stdio:

  • Tools: execute_kip, list_logs
  • Resources: kip://docs/SelfInstructions.md, kip://docs/KIPSyntax.md
  • Prompt: kip_bootstrap for ready-to-inject system prompt

🎯 Agent Skills (skill/)

kip-cognitive-nexus - Publishable skill for AI agents:

  • Python client script for anda_cognitive_nexus_server
  • Complete syntax reference and agent workflow guide

Implementations

ProjectDescription
Anda KIP SDKRust SDK for building AI knowledge memory systems
Anda Cognitive NexusRust implementation of KIP based on Anda DB
Anda HippocampusAutonomous Graph Memory for AI Agents
Anda Cognitive Nexus PythonPython binding for Anda Cognitive Nexus
Anda Cognitive Nexus HTTP ServerAn Rust-based HTTP server that exposes KIP via a small JSON-RPC API (GET /, POST /kip)
Anda AppAI Agent client app based on KIP

Version History

VersionDateChanges
v1.0-RC52026-03-25v1.0 Release Candidate 5: Added execute_kip_readonly interface
v1.0-RC42026-03-09v1.0 Release Candidate 4: Added IN, IS_NULL, IS_NOT_NULL FILTER operators; clarified UNION variable scope semantics; defined batch response structure; added temporal and UNION query examples
v1.0-RC32026-01-09v1.0 Release Candidate 3:Optimized documentation; optimized instructions; optimized knowledge capsules
.........
v1.0-draft12025-06-09Initial Draft

Full version history →

About Us

License

Copyright © 2025 LDC Labs.

Licensed under the MIT License. See LICENSE for details.

常见问题

io.github.ldclabs/KIP 是什么?

基于 Knowledge Graphs 的能力组件,用于实现持久记忆、知识演化与可解释交互。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描111.1k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描111.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描111.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.0k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.7k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论