tingly-wiki

module
v0.0.0-...-5626d12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2026 License: MPL-2.0

README

Tingly-Wiki

A Go module for building LLM-powered personal knowledge bases with persistent, compounding wikis.

Features

  • Persistent Knowledge Base: Extract and maintain structured information from source documents
  • Smart Extraction: Automatically identify entities, concepts, and relationships
  • Query & Synthesis: Ask questions and get AI-powered answers with citations
  • Health Checking: Detect contradictions, orphan pages, and stale information
  • Multiple LLM Providers: Support for OpenAI and Anthropic (Claude)
  • Flexible Storage: Markdown (Obsidian-compatible) or in-memory storage
  • Cross-References: Automatic linking between related pages

Installation

go get github.com/tingly-dev/tingly-wiki

Quick Start

package main

import (
    "context"
    "log"

    "github.com/tingly-dev/tingly-wiki/config"
    "github.com/tingly-dev/tingly-wiki/llm"
    "github.com/tingly-dev/tingly-wiki/schema"
    "github.com/tingly-dev/tingly-wiki/storage"
    "github.com/tingly-dev/tingly-wiki/wiki"
)

func main() {
    // Create wiki with OpenAI
    openaiLLM, _ := llm.NewOpenAIAdapter(&llm.OpenAIConfig{
        Model: "gpt-4o-mini",
    })

    cfg := &config.Config{
        Storage: storage.NewMemoryStorage(),
        LLM:     openaiLLM,
        Layout:  config.DefaultLayout(),
    }

    w, _ := wiki.New(cfg)
    defer w.Close()

    // Ingest a document
    source := &schema.Source{
        Type:    schema.SourceTypeText,
        Content: "OpenAI develops GPT-4, a large language model...",
    }

    result, _ := w.Ingest(context.Background(), source)
    log.Printf("Created %d pages", result.PagesCreated)

    // Query the wiki
    answer, _ := w.Query(context.Background(), "What is GPT-4?", nil)
    log.Printf("Answer: %s", answer.Answer)
}

Examples

See the examples directory for more usage examples:

Configuration

Storage Options
// In-memory (for testing)
storage := storage.NewMemoryStorage()

// Markdown files (Obsidian-compatible)
storage, _ := storage.NewMarkdownStorage("./my-wiki", config.DefaultLayout())
LLM Options
// OpenAI
openaiLLM, _ := llm.NewOpenAIAdapter(&llm.OpenAIConfig{
    APIKey: "sk-...",
    Model:  "gpt-4o-mini",
})

// Anthropic Claude
anthropicLLM, _ := llm.NewAnthropicAdapter(&llm.AnthropicConfig{
    APIKey: "sk-ant-...",
    Model:  "claude-3-5-sonnet-20241022",
})

// Mock (for testing)
mockLLM := llm.NewMockLLM()
Custom Layout
layout := &config.LayoutConfig{
    SourcesDir:  "docs/",
    EntitiesDir: "entities/",
    ConceptsDir: "concepts/",
    IndexPath:   "index.md",
    LogPath:     "log.md",
}

How It Works

  1. Ingest: Process source documents → Extract entities/concepts → Create/update pages
  2. Query: Search relevant pages → LLM synthesizes answer → Return with citations
  3. Lint: Analyze all pages → Detect issues → Suggest improvements

Acknowledgments

This project is inspired by the ideas discussed in let me wikipedia this for you by Andrej Karpathy. The concept of using LLMs as "programmers" that maintain and grow a persistent knowledge base is directly influenced by those insights.

License

See LICENSE in the main project.

Directories

Path Synopsis
cmd
wiki command
Package eval provides scenario-driven quality evaluation for tingly-wiki.
Package eval provides scenario-driven quality evaluation for tingly-wiki.
benchmarks
Package benchmarks provides adapters for public external benchmark datasets (LoCoMo, LongMemEval) that convert them into eval.Scenario instances and produce comparison reports against published mem0/Zep baseline numbers.
Package benchmarks provides adapters for public external benchmark datasets (LoCoMo, LongMemEval) that convert them into eval.Scenario instances and produce comparison reports against published mem0/Zep baseline numbers.
benchmarks/locomo
Package locomo provides an adapter from the LoCoMo benchmark dataset (HuggingFace snap-research/locomo) to eval.Scenario instances.
Package locomo provides an adapter from the LoCoMo benchmark dataset (HuggingFace snap-research/locomo) to eval.Scenario instances.
benchmarks/longmemeval
Package longmemeval provides an adapter from the LongMemEval benchmark dataset (github.com/xiaowu0162/LongMemEval) to eval.Scenario instances.
Package longmemeval provides an adapter from the LongMemEval benchmark dataset (github.com/xiaowu0162/LongMemEval) to eval.Scenario instances.
examples
basic command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL