GenAI Tools: Architecture and Content Pipeline

The Wikantik project utilizes a specialized suite of Python-based GenAI tools to automate article drafting, knowledge graph extraction, and cross-reference linking. These tools are designed to run locally, prioritizing privacy and data sovereignty by leveraging Ollama for LLM inference.


1. Python Architecture: Modular and Async

The toolset is organized as a modular Python package (genaitools), designed for extensibility and high-throughput batch processing.

1.1 Core Components

1.2 Async Concurrency

To maximize GPU utilization, tools like link_builder.py and batch_builder.py utilize asynchronous execution patterns. While LLM generation is often sequential per topic, the Embedding generation and Web fetching phases are fully concurrent, significantly reducing the bottleneck of RAG (Retrieval-Augmented Generation) operations.


2. The Content Extraction Pipeline (Deep Research)

The most advanced feature of the toolset is the Deep Research pipeline, which transforms raw web search results into high-signal LLM context.

2.1 The RAG Workflow

  1. Search: Queries are dispatched via DuckDuckGo to identify relevant authoritative sources.
  2. Extraction: For each URL, the tool fetches the raw HTML. It then employs a "Content Stripping" pass using libraries like BeautifulSoup or Trafilatura to remove:
    • Navigational menus and footers.
    • Scripts, styles, and advertisements.
    • Boilerplate privacy notices.
  3. Summarization: Instead of feeding raw text (which wastes context tokens), an LLM generates a focused, 200-400 word summary of the extracted content.
  4. Context Injection: These summaries are injected into the final generation prompt as "Grounding Context," ensuring the generated article is rooted in up-to-date, factual information.

2.2 Semantic Linking

The link_builder.py tool uses this same extraction pipeline to create an internal knowledge web. It computes cosine similarity between the embeddings of the current article and the existing wiki corpus, automatically inserting [Relative Links](PageName) for highly correlated concepts.


3. Ollama Integration and Hardware Optimization

The tools are optimized for local execution on commodity GPU hardware (16GB+ VRAM recommended).

3.1 Model Selection

3.2 Performance Tuning


4. Usage Summary

The tools are invoked via a CLI interface:

# Generate a high-quality article with deep research
python simple_publisher.py -t "Topic" --deep-research -o Topic.md

# Build a massive tutorial from a YAML outline
python document_builder.py -i outline.yaml -o Tutorial.md --smooth

# Run a semantic linking pass across the whole wiki
python link_builder.py --dir ./docs/wikantik-pages --similarity 0.7

By combining a clean Python architecture with the local power of Ollama and a robust content extraction pipeline, Wikantik maintains a high bar for "Human-Vetted" quality while scaling content production to match the needs of a modern knowledge base.