Skip to main content

Personal knowledge ingestion server

Project description

Whorl

Whorl is a system to scalably ingest all your personal documents (journals, writing, things you've read, etc...) and then make these accessible for you and for the AIs you interact with.

In doing so, you can effectively personalize your interactions with models, by making them query and get information from your whorl. Whorl gives AIs tools to fetch this knowldge, and also uses agents to trigger workflows whenever you add to your whorl - eg keeping lists of tasks, media recommendations, or ideas that might be worth exploring.

Whorl is designed to be simple, living in markdown files on your system, and then relying on agents to apply transformations, link these files, and enhance them in whatever way you'd like.

It is self-hosted, meaning that to have an AI use it, you need to run it from some public IP or endpoint, and then the mcp url is at /mcp.

Getting started

Install:

pip install whorled
# or
uv tool install whorled

Setup default configuration:

whorl init

If you want AI features, set your anthropic API key in .env or environment:

export ANTHROPIC_API_KEY="your-anthropic-key"  # for AI features

Running the Server

whorl server

The web UI will be available at http://localhost:8000.

Ingestion

Now you will want to upload data to Whorl.

It is all stored in ~/.whorl/docs (or $WHORL_HOME/docs) in any kind of flat or foldered structure you want, so you can also just move files there.

If you have a folder with your notes, journals, etc... you can use the CLI:

whorl upload ~/notes --context "personal-notes"

Otherwise, use an agent with the whorl MCP server, or just move files into the docs directory.

For agents, the ingest API is:

curl -X POST http://localhost:8000/api/ingest \
  -H "Content-Type: application/json" \
  -H "X-Password: $WHORL_PASSWORD" \
  -d '{"content": "Your note content here", "title": "Note Title", "metadata": {}}'

Workflows

You can configure automated workflows that agents execute whenever you upload to whorl. These agents run bash commands on your files, so be careful with your data!

You can add some defaults using whorl init, which sets up:

  • automatically summarizing and tagging new notes
  • extracting todos and tasks into tasks.md
  • gathering media references into media.md
  • collecting ideas into ideas.md

Then, in docs/index.md, you can reference these files (renders on the whorl homepage):

[[ideas.md]]
[[media.md]]
[[tasks.md]]

This is very flexible - go wild! Let me know what you find useful, I've just started experimenting with this.

CLI Usage

whorl server                     # start server on :8000
whorl server --port 3000         # custom port
whorl server --reload            # dev mode with auto-reload

whorl upload <dir>               # upload text files from directory
whorl upload <dir> -f            # flat (non-recursive)
whorl upload <dir> -e "*.draft"  # exclude pattern
whorl upload <dir> -c "source"   # add source context

whorl sync                       # run missing agents on all docs
whorl init                       # set up default prompts and index

MCP Integration

Whorl exposes an MCP server at /mcp for integration with Claude Code and other MCP-compatible tools.

Add to your Claude MCP configuration (e.g. ~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "whorl": {
      "url": "http://localhost:8000/mcp",
      "type": "http",
      "headers": {
        "X-Password": "your-whorl-password"
      }
    }
  }
}

Available MCP tools:

  • ingest - Add content to knowledge base
  • text_search - Full-text search
  • agent_search - AI search
  • bash - Run commands in the docs directory

You can add something to your global system prompt with the MCP, and then tell your chat assistant to use these tools when it might benefit from context about you.

Custom Ingestion Agents

Create markdown prompts in ~/.whorl/prompts/ingestion/ to process documents during ingestion. Each prompt file becomes an agent that runs on ingested content.

Example prompt (~/.whorl/prompts/ingestion/summarize.md):

---
model: sonnet
max_turns: 10
---
You are a document summarizer. Given the document at {filepath}, create a summary file.

Use the bash and str_replace_editor tools to read the document and create a summary.

Feel free to contribute! Note because this was a quick side project I was pretty lax on supervision with claude code, which was very useful.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whorled-0.1.0.tar.gz (74.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whorled-0.1.0-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file whorled-0.1.0.tar.gz.

File metadata

  • Download URL: whorled-0.1.0.tar.gz
  • Upload date:
  • Size: 74.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for whorled-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab706d82c308e3fb97901f7ca680159d3cd9df4781f4b498e55f8a5b186ded20
MD5 b4a1df1c8395c338d6c86116b6a377f7
BLAKE2b-256 0b2048c2fcbd3bbdccbaed1986ab9a7a531e2156bb67c5f774e3f6a60236cc30

See more details on using hashes here.

File details

Details for the file whorled-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: whorled-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 75.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for whorled-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a22132fbff64a288a1b14ac2ed6bd58951950a1d8c1f8a3ee2af2df82010907
MD5 407860f07c00d40857adad988b613dfe
BLAKE2b-256 241415d0daaf99f62f8b54d2c1c12a967c69853a3f53b4f580d5e37ec939d9c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page