Metadata-Version: 2.4
Name: memexc
Version: 0.1.0
Summary: A knowledge compiler that turns source documents into a living wiki
Project-URL: Homepage, https://github.com/memex-project/memex
Project-URL: Repository, https://github.com/memex-project/memex
Project-URL: Issues, https://github.com/memex-project/memex/issues
Author: Memex Contributors
License: MIT
Keywords: compiler,knowledge,llm,mcp,obsidian,wiki
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: click>=8.0
Requires-Dist: gitpython>=3.1.0
Requires-Dist: httpx>=0.27
Requires-Dist: jinja2>=3.1.0
Requires-Dist: litellm>=1.0.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pypdf>=4.0.0
Requires-Dist: python-slugify>=8.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: trafilatura>=1.8
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=2.0.0; extra == 'embeddings'
Provides-Extra: js
Requires-Dist: playwright>=1.40.0; extra == 'js'
Description-Content-Type: text/markdown

# memex

> Feed it papers. Get a wiki. It compounds.

A knowledge compiler that turns source documents into a living wiki. Sources are input. Claims are the intermediate representation. The wiki is the executable.

## Install

```bash
pip install -e .
```

Or with optional extras:

```bash
pip install -e ".[dev]"          # development tools
pip install -e ".[embeddings]"   # sentence-transformers for semantic search
```

> **One-shot (no install):** `uvx memex`

## Quick Start

```bash
# Initialize a wiki
memex init ./my-wiki

# Ingest a source
memex ingest paper.pdf

# Query the wiki
memex query "What are the key findings?"
```

## What is this?

Memex is a Python MCP server that compiles knowledge from source documents (PDFs, markdown files) into an Obsidian-compatible wiki backed by git. It implements Karpathy's LLM Wiki concept as a real software system.

Like a compiler:
- **Sources** (PDFs, markdown) → **Claims** (the IR) → **Wiki** (the executable)
- Every claim traces to a source
- Every article is derivable from its claims
- Incremental recompilation: only re-synthesize what changed

## Architecture

Memex is organized in three layers:

1. **Interface** (`server.py`, `cli.py`) — MCP server and CLI. Thin dispatch layer; no business logic.
2. **Ops** (`src/memex/ops/`) — Orchestrates each operation (ingest, query, search, lint, …). Coordinates LLM, extractors, search, and VCS; never touches the filesystem directly.
3. **Foundation** — Four focused subsystems:
   - `store/` — All filesystem I/O for the `.memex/` directory (claims, manifest, citations)
   - `llm/` — LiteLLM wrapper with Jinja2 templates and Pydantic structured output
   - `extractors/` — Pluggable readers for PDF, Markdown, HTML, and URLs
   - `search/` — BM25 claim search; `vcs/` — Git integration

Upper layers never bypass the store layer. Every claim traces to a source; every article is derivable from its claims.

## MCP Configuration

```json
{
  "mcpServers": {
    "memex": {
      "command": "uvx",
      "args": ["memex", "--wiki-dir", "./my-wiki"]
    }
  }
}
```

## License

MIT
