kip-cognitive-nexus
Persistent graph-based memory for AI agents via KIP (Knowledge Interaction Protocol). Provides structured knowledge storage (concepts, propositions), retrieval (KQL queries), schema discovery (META), and memory metabolism. Use when: (1) remembering user preferences, identities, or relationships across sessions, (2) storing conversation summaries or episodic events, (3) building and querying knowledge graphs, (4) the user says "remember this", "what do you know about me", or asks about past conversations, (5) needing to maintain context continuity across sessions. Requires HTTP access to a KIP backend (anda_cognitive_nexus_server).
When & Why to Use This Skill
The KIP Cognitive Nexus skill provides AI agents with a persistent, graph-based memory system powered by the Knowledge Interaction Protocol (KIP). It enables agents to move beyond stateless interactions by providing structured storage for concepts and propositions, advanced retrieval via KQL (Knowledge Query Language), and automated memory metabolism. This skill is essential for maintaining long-term context, remembering user preferences, and building evolving knowledge graphs across multiple sessions.
Use Cases
- Personalized User Profiles: Storing and retrieving long-term user identities, specific preferences, and relationship dynamics to deliver a highly customized and consistent experience.
- Long-term Project Tracking: Maintaining continuity in complex workflows by recording past decisions, commitments, and episodic events, ensuring the agent stays aligned with historical context.
- Dynamic Knowledge Graph Construction: Building a structured database of facts and relationships that can be queried to answer complex questions based on previous interactions and domain-specific knowledge.
- Memory Consolidation: Automatically summarizing conversation events into stable semantic facts, allowing the agent to 'learn' from interactions while maintaining memory hygiene by filtering out low-signal data.
| name | kip-cognitive-nexus |
|---|---|
| description | Persistent graph-based memory for AI agents via KIP (Knowledge Interaction Protocol). Provides retrieval-first memory operations (KQL), durable writes (KML), schema discovery (META), and memory hygiene patterns. Use whenever the agent needs to consult or update persistent memory, especially for: remembering user preferences/identity/relationships, storing conversation events, answering questions that depend on past sessions, and any task involving `execute_kip`. |
KIP Cognitive Nexus
You have a Cognitive Nexus (external persistent memory) accessible via KIP commands.
Operating Principle
You are not stateless—you have persistent memory. Your job:
- Retrieve first: Before answering non-trivial questions, check memory
- Store selectively: Capture stable facts, preferences, relationships
- Use silently: Do not expose KIP syntax to users
Script Interface
# Single command
python scripts/execute_kip.py --command 'DESCRIBE PRIMER'
# With parameters (safe substitution)
python scripts/execute_kip.py \
--command 'FIND(?p) WHERE { ?p {type: :type} } LIMIT :limit' \
--params '{"type": "Person", "limit": 5}'
# Batch commands
python scripts/execute_kip.py \
--commands '["DESCRIBE PRIMER", "FIND(?t.name) WHERE { ?t {type: \"$ConceptType\"} }"]'
# Dry run (validation only, use before DELETE)
python scripts/execute_kip.py --command 'DELETE CONCEPT ?n DETACH WHERE {...}' --dry-run
Environment: KIP_SERVER_URL (default: http://127.0.0.1:8080/kip), KIP_API_KEY (optional)
Core Operations
1. Schema Discovery (Start Here)
DESCRIBE PRIMER -- Global summary + domain map
DESCRIBE CONCEPT TYPE "Person" -- Type schema
SEARCH CONCEPT "alice" LIMIT 5 -- Fuzzy entity search
2. Query (KQL)
FIND(?p, ?p.attributes.role) WHERE { ?p {type: "Person"} } LIMIT 10
FIND(?e) WHERE { ?e {type: "Event"} (?e, "belongs_to_domain", {type: "Domain", name: "Projects"}) }
3. Store (KML)
UPSERT {
CONCEPT ?e {
{type: "Event", name: "conv:2025-01-09:topic"}
SET ATTRIBUTES { event_class: "Conversation", content_summary: "..." }
SET PROPOSITIONS { ("belongs_to_domain", {type: "Domain", name: "Projects"}) }
}
}
WITH METADATA { source: "conversation", author: "$self", confidence: 0.9 }
4. Delete (Carefully)
DELETE CONCEPT ?n DETACH WHERE { ?n {type: "Event", name: "old_event"} }
-- Always use --dry-run first; DETACH is mandatory
What to Store
| Store ✓ | Do NOT Store ✗ |
|---|---|
| Stable preferences, goals | Secrets, credentials |
| Identities, relationships | Raw transcripts (use raw_content_ref) |
| Decisions, commitments | Low-signal chit-chat |
| Corrected facts | Highly sensitive data |
Memory Types
| Layer | Type | Lifespan | Example |
|---|---|---|---|
| Episodic | Event |
Short → consolidate | "User asked about X on 2025-01-09" |
| Semantic | Person, custom |
Long-term | "User prefers dark mode" |
Consolidation: After storing an Event, ask "Does this reveal something stable?" If yes, extract to durable concept.
References
- Agent workflow patterns and KIP syntax: references/INSTRUCTIONS.md