Anda Cognitive Nexus
Anda Cognitive Nexus is a Rust implementation of KIP (Knowledge Interaction Protocol) built on top of anda_db. It provides a persistent, graph-based long-term memory substrate for AI agents (concepts + propositions) with a KIP executor API.
Links:
- KIP spec: https://github.com/ldclabs/KIP
- HTTP server (optional): https://github.com/ldclabs/anda-db/tree/main/rs/anda_cognitive_nexus_server
- Database core: https://github.com/ldclabs/anda-db/tree/main/rs/anda_db
What is KIP?
KIP (Knowledge Interaction Protocol) is a specialized protocol designed for Large Language Models (LLMs). It establishes a standard for efficient, reliable, and bidirectional knowledge exchange between an LLM (the "neural core") and a knowledge graph (the "symbolic core"). This allows AI Agents to build a memory that is not only queryable but also auditable and capable of evolution.
Key Design Principles
- LLM-Friendly: Declarative syntax that is easy for LLMs/tools to generate.
- Graph-Native: Optimized for knowledge graph patterns.
- Auditable: Queries and mutations can be logged and reviewed as an execution trail.
- Lifecycle-aware: Supports querying, inserting, and evolving knowledge over time.
Core Concepts
- Cognitive Nexus: The knowledge graph itself, composed of Concept Nodes and Proposition Links.
- Concept Node: An entity or abstract concept (e.g., a
Drugnamed "Aspirin"). Each node has a type, a name, attributes, and metadata. - Proposition Link: A reified fact that connects two nodes in a
(subject, predicate, object)structure (e.g.,(Aspirin, treats, Headache)). - Knowledge Capsule: An atomic unit of knowledge, containing a set of nodes and links, used for transactional updates to the nexus.
Features
- KIP executor: Runs KQL / KML / META commands via
anda_kip. - Persistent & performant: Built on Anda DB for durable storage and indexing.
- Self-describing schema: Concept/proposition types live inside the graph.
- Async API: Designed for modern, non-blocking applications.
Getting Started
Add dependencies to your Cargo.toml (pick a concrete object_store backend):
[]
= "0.6"
= "0.6"
= { = "1", = ["full"] }
# Provide an ObjectStore implementation
= { = "0.13", = ["fs"] }
# Optional (recommended for local filesystem): metadata + conditional put support
= "0.3"
Quickstart (in-memory)
This example boots a Nexus on an in-memory object store, inserts a small capsule via KML, and queries it via KQL.
use ;
use ;
use ;
use InMemory;
use Arc;
async
LLM-friendly request/response
If you want a single structured interface (handy for function calling), use anda_kip::Request / Response. This is also what anda_cognitive_nexus_server expects under POST /kip with method=execute_kip.
use ;
let req = Request ;
let : = req.execute.await;
println!;
Run the Demo
This repository includes a comprehensive demo: https://github.com/ldclabs/anda-db/tree/main/rs/anda_cognitive_nexus/examples/kip_demo.rs
To run it:
Related
anda_kip: parser + request/response model for KIP.anda_db: embedded storage engine.anda_cognitive_nexus_server: expose KIP over HTTP (JSON-RPC).
License
Copyright © 2026 LDC Labs.
ldclabs/anda-db is licensed under the MIT License. See LICENSE for the full license text.