Skip to content

Application for organization Links in 2 sections - "watch/read it later" with ai support for rating and "vault" for importnat long term links

Notifications You must be signed in to change notification settings

neliodass/KnowledgeOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 KnowledgeOS

Your personal AI-powered knowledge management system.
Save anything from the web. Let AI score, summarize, and organize it β€” based on your profile, not generic algorithms.

.NET Next.js React TypeScript PostgreSQL OpenRouter Hangfire Tailwind CSS


πŸ“– What is KnowledgeOS?

KnowledgeOS is a self-hosted knowledge vault β€” a place where everything you find on the internet lands, gets evaluated by AI, and either gets archived or filtered out.

Instead of mindlessly saving bookmarks you never revisit, KnowledgeOS uses a personalized AI scoring pipeline to decide how relevant each piece of content is to you β€” based on your hobbies, professional context, and learning goals.

Core flow

URL saved by user
      β”‚
      β–Ό
[Ingestion Job] ──► Fetch metadata (title, image, description)
      β”‚               YouTube API / Reddit JSON / OpenGraph
      β–Ό
[AI Analysis Job] ──► Score 0–100, verdict, summary, tags
      β”‚                Based on your personal profile
      β–Ό
[Inbox] ──► Review ──► [Vault] (permanent archive)
                  └──► [Trash]

✨ Features

πŸ€– AI-Powered Inbox

  • Every saved resource is scored 0–100 based on your personal profile
  • AI generates a verdict, summary, and tags
  • Scoring uses a two-axis system: Intrinsic Quality Γ— Relevance to your profile
  • Protects against keyword hallucination β€” "AI" in title β‰  match if content is a gimmick

πŸ“₯ Inbox & πŸ›οΈ Vault

  • Inbox β€” staging area for new resources, shows AI score and verdict
  • Vault β€” permanent curated archive with categories, notes, and detailed AI summaries
  • One-click promotion from Inbox β†’ Vault with automatic re-analysis
  • Smart Mix β€” surfaces forgotten Vault items across different categories

🌐 Multi-source ingestion

Source What gets fetched
YouTube Title, channel, duration, views, transcript excerpt
Articles / Websites Title, description, author, og:image, favicon fallback

πŸ—‚οΈ Categories & Tags

  • User-defined categories for Vault organization
  • AI suggests category based on existing ones (or proposes new)
  • Auto-tagging with niche, profile-relevant vocabulary

πŸ‘€ User Profile

  • ProfessionalContext β€” who you are, what you do
  • LearningGoals β€” what you want to learn
  • Hobbies β€” your interests (genuinely used for scoring, not decoration)
  • TopicsToAvoid β€” hard filter, caps score at 0–10

βš™οΈ Background Jobs

  • Hangfire-powered async processing pipeline
  • Automatic retry with error recovery job
  • ErrorRecoveryJob β€” periodically rescues stuck resources

πŸ—οΈ Architecture

Backend

KnowledgeOS.Backend/
β”œβ”€β”€ Controllers/          # REST API endpoints
β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ Ai/               # OpenRouter provider, AI service, prompt builder
β”‚   β”œβ”€β”€ Content/          # YouTube, Reddit, Website content fetchers
β”‚   β”œβ”€β”€ Processors/       # Resource processors
β”‚   └── Abstractions/     # Interfaces
β”œβ”€β”€ Jobs/                 # Hangfire background jobs (Ingestion, AI Analysis, Error Recovery)
β”œβ”€β”€ Entities/
β”‚   β”œβ”€β”€ Resources/        # Resource (base), VideoResource, ArticleResource, RedditResource
β”‚   β”‚   β”œβ”€β”€ InboxMetadata # AI score, verdict, inbox summary
β”‚   β”‚   └── VaultMetadata # Detailed summary, category, user notes
β”‚   β”œβ”€β”€ Tagging/          # Tag, Category
β”‚   └── Users/            # ApplicationUser, UserPreference
β”œβ”€β”€ DTOs/                 # Data Transfer Objects
β”œβ”€β”€ Data/                 # AppDbContext, EF Core (TPT strategy)
└── Migrations/           # EF Core migrations

Frontend

knowledgeos-frontend/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   β”œβ”€β”€ login/        # Login page
β”‚   β”‚   └── register/     # Registration page
β”‚   └── dashboard/
β”‚       β”œβ”€β”€ inbox/        # Inbox view β€” scored resources awaiting review
β”‚       β”œβ”€β”€ vault/        # Vault view β€” curated archive with filters
β”‚       β”œβ”€β”€ add/          # Add new resource by URL
β”‚       β”œβ”€β”€ settings/     # User preferences & account settings
β”‚       └── layout.tsx    # Dashboard shell with navigation
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ InboxCard.tsx     # Resource card for inbox (score, verdict, tags)
β”‚   β”œβ”€β”€ InboxDetailModal.tsx  # Full resource detail view for inbox
β”‚   β”œβ”€β”€ VaultCard.tsx     # Resource card for vault (category, notes)
β”‚   └── VaultDetailModal.tsx  # Full resource detail view for vault
└── lib/
    β”œβ”€β”€ api.ts            # All API calls (typed fetch wrappers)
    β”œβ”€β”€ types.ts          # Shared TypeScript types
    β”œβ”€β”€ categoryColor.ts  # Category color mapping utility
    └── ThemeProvider.tsx # Dark/light theme context

Key design decisions

  • Table Per Type (TPT) β€” VideoResource, ArticleResource, RedditResource each have their own table, sharing the base Resources table
  • 1:1 Metadata composition β€” InboxMetadata and VaultMetadata are separate tables linked by FK, not flat columns on Resource
  • Global query filters β€” all queries are automatically scoped to CurrentUser.UserId
  • AI provider abstraction β€” multiple models registered as IAiProvider, AiService tries them in order with fallback
  • Next.js App Router β€” full server/client component split, JWT stored in localStorage, all API calls typed via shared lib/types.ts

πŸš€ Getting Started

Prerequisites

Backend setup

  1. Clone the repository

    git clone https://github.com/your-username/KnowledgeOS.git
    cd KnowledgeOS/KnowledgeOS.Backend
  2. Configure environment
    Create a .env file in KnowledgeOS.Backend/:

    JWT_KEY=your_super_secret_jwt_key_min_32_chars
    OPENROUTER_API_KEY=sk-or-...
  3. Configure appsettings.json

    {
      "ConnectionStrings": {
        "DefaultConnection": "Host=localhost;Port=5432;Database=knowledge_os;Username=postgres;Password=yourpassword"
      },
      "Ai": {
        "Model_1": "google/gemini-2.0-flash-exp:free",
        "Model_2": "meta-llama/llama-3.3-70b-instruct:free",
        "Model_3": "mistralai/mistral-small-3.1-24b-instruct:free"
      }
    }
  4. Run migrations & start

    dotnet ef database update
    dotnet run

Frontend setup

cd KnowledgeOS/knowledgeos-frontend
npm install
npm run dev

Frontend runs on http://localhost:3000, backend on https://localhost:5001.

Docker β€” full stack

The entire stack (PostgreSQL, backend, frontend) can be run with a single command.

  1. Copy and configure the environment file

    cp .env.example .env

    Open .env and set your values. The most important one is NEXT_PUBLIC_API_URL β€” this is the address the browser uses to reach the backend, so it must be your machine's actual IP (not localhost) if you want to access it from other devices on the network or expose it externally:

    # Local network (phone, tablet, other PC on the same WiFi)
    NEXT_PUBLIC_API_URL=http://192.168.1.100:5000/api
    
    # VPS / public server
    NEXT_PUBLIC_API_URL=https://api.yourdomain.com/api
    
    # Ports (change if you have conflicts)
    FRONTEND_PORT=3000
    BACKEND_PORT=5000
    
    # Secrets
    JWT_KEY=your_min_32_char_secret_here
    OPENROUTER_API_KEY=sk-or-...
  2. Run

    docker compose up -d --build
  3. Run database migrations (first time only)

    docker compose exec backend dotnet ef database update
    Service Default address
    Frontend http://localhost:3000
    Backend API http://localhost:5000
    Swagger http://localhost:5000/swagger
    Adminer (DB UI) http://localhost:8080

    Tip: To find your local IP on Linux run ip route get 1 | awk '{print $7}'


πŸ“‘ API Overview

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login, returns JWT
GET /api/auth/me Get display name
PUT /api/auth/me/password Change password
PUT /api/auth/me/display-name Change display name
GET /api/preferences Get user preferences
PUT /api/preferences Update user preferences
POST /api/resources Save new resource (URL)
GET /api/inbox Get inbox resources (paged)
GET /api/inbox/mix Get smart mix (high/mid/low score)
GET /api/vault Get vault resources (paged, filterable)
GET /api/vault/mix Get vault rediscovery mix
PUT /api/resources/{id}/status Promote / trash resource
PUT /api/resources/{id}/category Assign category
DELETE /api/resources/{id} Two-step delete (Trash β†’ permanent)
GET /api/categories List categories
POST /api/categories Create category
DELETE /api/categories/{id} Delete category

πŸ›£οΈ Roadmap

πŸ”§ In Progress

  • Browser extension β€” save to KnowledgeOS directly from any webpage with one click
  • Extension for Shortcut app for iOS β€” add to KnowledgeOS from iPhone share sheet

πŸ“‹ Planned

Core Features

  • PWA (Progressive Web App) β€” installable mobile/desktop app with offline support and home screen shortcut
  • Vector search β€” semantic similarity search across saved resources using embeddings
  • Reddit as a source β€” support saving Reddit posts and comments with appropriate metadata and AI analysis

AI & Intelligence

  • AI re-analysis β€” manually trigger re-analysis after updating your profile
  • Duplicate detection β€” warn when saving content already in vault (semantic, not just URL match)
  • Trend surfacing β€” detect recurring themes across saved resources

Organization

  • Nested categories β€” subcategories for deeper organization
  • Collections / reading lists β€” group resources manually across categories
  • Resource relations β€” link related resources together

UX & Settings

  • Settings page β€” manage account, preferences, AI model choice, and danger zone
  • Admin panel β€” user management, job queue monitoring, system health
  • Password reset via email β€” forgot password flow with email token
  • Email verification β€” verify email on registration

Integrations

  • Pocket / Readwise import β€” migrate existing bookmarks
  • Obsidian export β€” export vault as Obsidian-compatible Markdown vault
  • RSS / Atom feed ingestion β€” auto-import from feeds

πŸ–ΌοΈ Screenshots

Dashboard Modal Add Add_category inbox vault settings


🧰 Tech Stack

Layer Technology
Frontend Next.js 16, React 19, TypeScript, Tailwind CSS 4
Backend ASP.NET Core 10, C#
Database PostgreSQL + EF Core 10 (TPT)
Auth ASP.NET Core Identity + JWT
AI OpenRouter API (multi-model with fallback)
Background Jobs Hangfire + PostgreSQL storage
Content Fetching YoutubeExplode, HtmlAgilityPack, Reddit JSON API
API Docs Swagger / OpenAPI

πŸ“„ License

MIT License β€” see LICENSE for details.


Built with curiosity, need and too many saved tabs. Also with a dash of AI (especially frontend ^^)

About

Application for organization Links in 2 sections - "watch/read it later" with ai support for rating and "vault" for importnat long term links

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published