Skip to content

feat: ontology semantic search layer for agentic queries#50

Merged
linhdmn merged 2 commits into
mainfrom
feat/ontology-semantic-search-mvp
May 21, 2026
Merged

feat: ontology semantic search layer for agentic queries#50
linhdmn merged 2 commits into
mainfrom
feat/ontology-semantic-search-mvp

Conversation

@linhdmn
Copy link
Copy Markdown
Member

@linhdmn linhdmn commented May 18, 2026

Summary

Implements the MVP for LeanKG ontology to enable semantic search beyond code symbol lookup. Agents can now ask domain-aware questions like "where is checkout refund failure handled?" and get structured context.

Features

  • Concept ontology: domain_entity, service, api_endpoint, data_store, environment, known_issue, playbook, team_knowledge
  • Procedural ontology: workflow, workflow_step, decision_point, failure_mode, playbook_step
  • Stable GIDs for idempotent sync (format: {env}:{scope}:{type}:{id}:v1)
  • YAML loading for manual ontology definitions (ontology/concepts.yaml, ontology/workflows.yaml)
  • MCP tools: kg_context, kg_concept_map, kg_trace_workflow, kg_ontology_status
  • CLI commands: ontology validate/sync/status/context/concept-map/trace-workflow
  • 30 unit tests covering ontology types, loader, and query engine

Test plan

  • cargo test --lib -- ontology - 30 ontology tests pass
  • cargo build --release - builds successfully
  • ./leankg ontology --help - CLI commands available
  • ./leankg ontology validate - validates YAML structure
  • ./leankg ontology sync - syncs ontology to graph

Breaking changes

None - fully additive feature.

linhdmn added 2 commits May 18, 2026 08:31
Implements the MVP for LeanKG ontology to enable semantic search beyond
code symbol lookup. Agents can now ask domain-aware questions like
"where is checkout refund failure handled?" and get structured context.

Features:
- Concept ontology: domain_entity, service, api_endpoint, data_store, etc.
- Procedural ontology: workflow, workflow_step, failure_mode, playbook
- Stable GIDs for idempotent sync
- YAML loading for manual ontology definitions
- MCP tools: kg_context, kg_concept_map, kg_trace_workflow, kg_ontology_status
- CLI commands: ontology validate/sync/status/context/concept-map/trace-workflow
- Full test coverage for ontology types, loader, and query engine

BREAKING: None - fully additive feature
@linhdmn linhdmn merged commit fe5df7b into main May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant