DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to add documents to a wiki from a Python script with LLM Wiki V2

Import the Wiki class and file text or files into a wiki from your own code.

Short answer: Install the library with pip install llmwiki2 (Python 3.11 or later); then in Python, run from llmw2 import Wiki, then wiki = Wiki.from_env(bundle="./wiki") and wiki.init(); set the OKF_* variables and your provider key, for example OPENROUTER_API_KEY, before creating the Wiki object. All steps.

  • Research
  • Intermediate
  • 45 minutes
  • From the README
  • Any agent

Who it is forA developer who has a data pipeline or script that produces documents and wants them filed into a wiki automatically.

The problemDocuments produced by a script end up in folders with no structure, and someone has to file them by hand.

The outcomeA Python script that files each document as a note and returns the result, including the tokens spent.

What you need first

  • Python 3.11 or later, or uv to install it
  • An API key for OpenRouter, OpenAI, Gemini or another OpenAI-compatible server, or Ollama installed for free local use
  • Documents as text, Markdown, PDF, Word, PowerPoint, Excel or OpenDocument files

Steps

  1. Install the library with pip install llmwiki2 (Python 3.11 or later).
  2. In Python, run from llmw2 import Wiki, then wiki = Wiki.from_env(bundle="./wiki") and wiki.init().
  3. Set the OKF_* variables and your provider key, for example OPENROUTER_API_KEY, before creating the Wiki object.
  4. Call result = wiki.ingest(open("meeting.md").read(), title="Pricing meeting") for each document.
  5. Print result and open the note in ./wiki to check the filing. (inferred, check the README)

Prompt for your agent

Write a Python script that imports Wiki from llmw2, points it at ./wiki, and calls ingest on each file in <folder>. Expected output: one result per file with the note and token usage. Verify that each returned note appears as a Markdown file under ./wiki.

Caveat. The README documents the ingest call and Wiki.from_env, but this script's exact return fields should be checked against the library guide before you rely on them.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for crow-hq/llm-wiki-v2 and "Add documents to a wiki from a Python script"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer