How pliablerigidity/kosine works
KOSINE is a local-first, graph-native memory system. Users enter through the CLI, terminal UI, REST API, or agent integrations; they create or import structured memories into an isolated Brain, then query and explore those memories. SQLite is the documented source of truth. The README also describes optional AI and Kuzu support, exports, capture, and several specialized memory layers. Some subsystems are represented by documented capabilities and tree paths rather than sampled implementation; their internal wiring is not inferred.
Main entry points: database.py SQLite Database · kos.py CLI · importer.py Markdown Import · agent_tools.py Agent Tools
Components 23
User Interfaces
- CLI
kos.py - Terminal UI
kos/tui.py - REST API
kos/api.py - Agent Tools
kos/agent_tools.py - MCP Server
kos/mcp_server.py
Memory Core
- Brain Runtime
kos/brain.py - Input Planner
kos/intent.py - SQLite Database
kos/database.py
Retrieval and Views
- Query Engine
kos/query.py - Context Graph
kos/context_graph.py - Local LLM
kos/llm.py - Graph Viewer
kos/graph_viewer.py
Import and Memory Layers
- Inbox Capture
kos/capture.py - Vault Sync
kos/vault.py - Markdown Import
kos/importer.py - Knowledge Extraction
kos/knowledge_extractor.py - Semantic Memory
kos/semantic.py - Episodic Memory
kos/episodic.py - Procedural Memory
kos/procedural.py - Reasoning Graph
kos/reasoning_graph.py - Markdown Export
kos/export_md.py - Kuzu Backend
kos/kg.py
Other components
- Person
Connections 28
- Person → CLI: uses
- Person → Terminal UI: uses
- Person → REST API: sends requests
- CLI → Brain Runtime: selects Brain
kos.py - CLI → Input Planner: plans input
kos.py - Input Planner → SQLite Database: reads and writes
kos/intent.py - REST API → Agent Tools: dispatches tools
kos/agent_tools.py - Agent Tools → SQLite Database: reads and writes
kos/agent_tools.py - CLI → Query Engine: runs queries
kos.py - Query Engine → SQLite Database: searches memory
kos/query.py - CLI → Local LLM: asks questions
kos.py - Local LLM → Context Graph: builds context
kos/llm.py - Context Graph → SQLite Database: retrieves graph
kos/context_graph.py - CLI → Graph Viewer: opens graph
kos.py - Graph Viewer → SQLite Database: reads graph data
kos/graph_viewer.py - CLI → Vault Sync: imports vault
kos.py - Vault Sync → Markdown Import: delegates import
kos/vault.py - Markdown Import → SQLite Database: stores documents
kos/importer.py - Markdown Import → Knowledge Extraction: extracts knowledge
kos/importer.py - Knowledge Extraction → SQLite Database: creates memories
kos/knowledge_extractor.py - CLI → Inbox Capture: captures notes
kos.py - CLI → Markdown Export: exports Markdown
kos.py - SQLite Database → Semantic Memory: supports concepts
- SQLite Database → Episodic Memory: supports episodes
- SQLite Database → Procedural Memory: supports workflows
- SQLite Database → Reasoning Graph: supports traces
- SQLite Database → Kuzu Backend: optional projection
- MCP Server → Agent Tools: uses tool layer
kos/agent_tools.py