Anda KIP
A Rust SDK of KIP (Knowledge Interaction Protocol) for building sustainable AI knowledge memory systems.
Overview
🧬 KIP (Knowledge Interaction Protocol) is a knowledge memory interaction protocol designed for Large Language Models (LLMs), aimed at building sustainable learning and self-evolving knowledge memory systems for AI Agents.
This crate provides a complete Rust SDK of the KIP specification, offering:
- Parser: Full KIP command parsing with comprehensive error handling
- AST: Rich Abstract Syntax Tree structures for all KIP command types
- Executor Framework: Trait-based execution system for implementing KIP backends
- Request/Response: Standardized JSON-based communication structures
- Type Safety: Leverages Rust's type system for reliable KIP command processing
Specification
This implementation follows the official KIP specification. For detailed information about the protocol, syntax, and semantics, please refer to:
👉 KIP Specification
Quick Start
Add this to your Cargo.toml:
[]
= "0.4"
Basic Usage
use ;
// Parse a KQL query
let query = parse_kip?;
// Parse a KML statement
let statement = parse_kip?;
// Parse a META command
let meta = parse_kip?;
Implementing an Executor
use ;
use async_trait;
High-Level Execution
use ;
// Using the high-level execution function
let executor = new;
let response = execute_kip.await?;
// Using structured requests with parameters
let request = Request ;
let response = request.execute.await?;
Architecture
The crate is organized into several key modules:
ast: Abstract Syntax Tree definitions for all KIP constructscapsule: KIP Genesis Capsuleserror: Comprehensive error types and handlingexecutor: Execution framework and traitsparser: Nom-based parsers for KQL, KML, and META commandsrequest: Request/Response structures for JSON-based communicationtypes: KIP Entity Types
Contributing
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
License
Copyright © 2026 LDC Labs.
anda_kip is licensed under the MIT License. See LICENSE for the full license text.