Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KRONOS

Knowledge Reasoning Ontology Network for Open Science.

KRONOS is an Obsidian-first scientific knowledge system that turns research notes into a persistent Markdown wiki and machine-readable graph. The current prototype combines an Obsidian plugin with a local Python helper exposed over HTTP on localhost.

Authors

  • Daniele Bailo
  • Valerio Vinciarelli

Project Goal

KRONOS explores an LLM Wiki workflow for open science:

Raw sources -> LLM semantic extraction -> Markdown wiki -> Graph index -> Search/query

Instead of retrieving isolated chunks at question time, KRONOS incrementally builds persistent knowledge pages:

  • source pages
  • synthesis pages
  • concept pages
  • entity pages
  • claim pages
  • graph nodes and edges

The first target environment is Obsidian, so the knowledge base stays readable, editable and versionable as ordinary Markdown.

Current Milestone

This repository is at a collaboration handoff milestone. The ingest pipeline is usable as an MVP and the next development block can focus on query/research.

Implemented:

  • Obsidian plugin scaffold
  • Python local helper
  • helper endpoints:
    • GET /status
    • GET /config
    • POST /config
    • POST /wiki/page
    • POST /llm/test
    • POST /ingest
    • POST /search
  • OpenAI-compatible LLM calls for LM Studio and similar local servers
  • configurable model endpoints and model names
  • LLM-driven semantic extraction for concepts, entities and claims
  • no silent heuristic fallback when an LLM is configured
  • enriched semantic wiki pages with LLM summaries and key points
  • raw source copy into raw/notes/
  • generated pages under:
    • wiki/sources/
    • wiki/syntheses/
    • wiki/concepts/
    • wiki/entities/
    • wiki/claims/
  • automatic index.md and log.md updates
  • graph persistence under .kronos/graph/
    • nodes.json
    • edges.json
    • manifest.json
  • Obsidian side panel with:
    • ingest button
    • visible activity/status feedback
    • copyable activity log
    • local search box
    • clickable search results
  • editable prompt panel for:
    • ingestion / semantic extraction agent
    • graph relation extraction agent
    • query / research agent
    • judge / validation agent
    • wiki lint / maintenance agent

Repository Layout

helper/
  kronos_helper/
    app.py        # HTTP server and endpoint routing
    config.py     # helper configuration store
    graph.py      # embedded graph persistence
    ingest.py     # ingest workflow
    llm.py        # OpenAI-compatible LLM client and prompt rendering
    search.py     # local wiki/graph search
    wiki.py       # Markdown page templates and index/log maintenance
  tests/
    test_app.py
  pyproject.toml

plugin/
  src/main.ts     # Obsidian plugin source
  main.js         # built plugin bundle
  styles.css      # plugin styles
  manifest.json
  package.json

Vault Structure

KRONOS expects or creates this structure inside the Obsidian vault:

raw/
  notes/
wiki/
  concepts/
  entities/
  claims/
  sources/
  syntheses/
.kronos/
  graph/
  vector/
  cache/
  config/
index.md
log.md

Local Configuration

Current development setup:

helper URL: http://127.0.0.1:8765
LLM endpoint: http://127.0.0.1:1234
model: qwen/qwen3-4b
API key: none
provider style: OpenAI-compatible

The same local model is currently used for generation, embedding and judge configuration fields. Embeddings and judge workflows are configured but not yet fully implemented.

Run The Helper

cd helper
python3 -m kronos_helper

The helper listens on:

http://127.0.0.1:8765

Quick check:

curl http://127.0.0.1:8765/status

Build The Plugin

cd plugin
npm install
npm run build

For manual development, copy or symlink the plugin directory into:

<vault>/.obsidian/plugins/kronos/

In the current local vault, the development plugin path is:

/Users/danielebailo/Documents/Obsidian/KRONOS/.obsidian/plugins/kronos

After rebuilding, reload Obsidian or disable/enable the KRONOS plugin.

Run Tests

cd helper
python3 -m unittest discover -s tests

Current status:

15 tests OK

Obsidian Commands

Available commands:

  • KRONOS: Check Helper Status
  • KRONOS: Push Helper Config
  • KRONOS: Initialize Vault
  • KRONOS: Create Knowledge Page
  • KRONOS: Test Generation Endpoint
  • KRONOS: Edit Prompts
  • KRONOS: Open KRONOS Panel
  • KRONOS: Ingest Active File

The side panel is the preferred user-facing workflow:

KRONOS: Open KRONOS Panel

Prompt Governance

Prompt strings are intentionally visible and editable from the plugin.

The plugin exposes prompt editors for:

  • Agent: Ingestion / Semantic Extraction
  • Agent: Graph Relation Extraction
  • Agent: Query / Research
  • Agent: Judge / Validation
  • Agent: Wiki Lint / Maintenance

Only the semantic extraction prompt is actively used in the current ingest workflow. The remaining prompts are configuration-ready for the next phases.

Important Ingest Behavior

If an LLM endpoint or generation model is configured, KRONOS requires the LLM to succeed. If the LLM times out, returns invalid JSON, or extracts no knowledge items, /ingest fails and does not create wiki pages.

Heuristic extraction remains only for development/offline cases where no LLM is configured at all.

This avoids producing low-quality pages that look authoritative but were not actually created by the configured model.

Embedded Graph Schema

Current node types:

  • Source
  • WikiPage
  • Concept
  • Entity
  • Claim

Current edge types:

  • DESCRIBES
  • DERIVED_FROM
  • MENTIONS
  • SUPPORTS
  • ABOUT

Graph files:

.kronos/graph/nodes.json
.kronos/graph/edges.json
.kronos/graph/manifest.json

Completed Work By Phase

Phase 0: Foundations

  • helper/plugin communication over HTTP
  • /status, /config
  • Obsidian settings for helper and model endpoints

Phase 1: Vault Initialization

  • KRONOS vault folder structure
  • index.md
  • log.md

Phase 2: Markdown Management

  • structured page templates
  • page creation
  • index/log updates

Phase 3: Helper-Driven Wiki Creation

  • POST /wiki/page
  • helper-side Markdown generation

Phase 4: LLM Integration

  • POST /llm/test
  • OpenAI-compatible chat completions
  • LM Studio endpoint support

Phase 5: Basic Source Ingestion

  • POST /ingest
  • .md and .txt support
  • raw copy
  • source/synthesis page generation

Phase 6: LLM Semantic Extraction

  • concept/entity/claim extraction
  • LLM summaries and key points
  • no silent fallback when LLM is configured

Phase 7: Graph Persistence

  • graph nodes and edges written during ingest
  • graph manifest
  • local graph-aware search foundation

Phase 8: Plugin UX Foundation

  • right-side KRONOS panel
  • visible status feedback
  • copyable activity output
  • prompt editor for all planned agents
  • local search UI

Next Features To Implement

Recommended next development order:

  1. Query/research endpoint

    • add POST /query
    • retrieve local search results
    • load relevant Markdown pages
    • build LLM context
    • answer using query_prompt
  2. Judge validation

    • call judge model with judge_prompt
    • return verdict, issues and revised answer
  3. Relation extraction

    • use relation_extraction_prompt
    • ask LLM for richer typed edges
    • persist those edges in .kronos/graph/edges.json
  4. Wiki lint

    • add POST /lint
    • analyze active page using lint_prompt
    • show issues in the side panel
  5. Better graph search

    • graph neighborhood expansion
    • centrality/degree hints
    • claim-source traceability views
  6. Vector index

    • implement embeddings under .kronos/vector/
    • hybrid lexical/vector/graph retrieval
  7. Packaging

    • choose helper distribution strategy
    • local Python install script or packaged binary
    • plugin release packaging

Known Limitations

  • Search is currently local lexical search over Markdown plus graph nodes.
  • Query answering with LLM context is not implemented yet.
  • Judge and lint prompts are editable but not yet wired to endpoints.
  • Relation extraction prompt is editable but richer LLM edge extraction is not wired yet.
  • Embedding configuration exists but vector indexing is not implemented.
  • The helper must be started manually during development.

Handoff Notes For Valerio

Good entry points:

  • helper HTTP routing: helper/kronos_helper/app.py
  • ingest workflow: helper/kronos_helper/ingest.py
  • LLM prompt/client logic: helper/kronos_helper/llm.py
  • graph persistence: helper/kronos_helper/graph.py
  • local search: helper/kronos_helper/search.py
  • Obsidian panel and commands: plugin/src/main.ts

Suggested first task:

Implement POST /query by composing search results into context and calling the
generation model with query_prompt.

That would turn the current milestone from “ingest + local search” into the first useful research assistant loop.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages