LLM Engineering Navigation System — discovers recurring solution patterns from LLM research papers
Project description
LENS — LLM Engineering Navigation System
Automatically discovers recurring solution patterns, contradiction resolutions, architecture innovations, and agentic design patterns from LLM research papers (arxiv).
Inspired by TRIZ methodology — but with richer knowledge structures, fully automated discovery, and continuous learning from the evolving LLM research landscape.
Core Knowledge Structures
-
Contradiction Matrix — Maps LLM tradeoffs (e.g., accuracy vs. latency) to resolution techniques (e.g., distillation, speculative decoding). Uses a canonical vocabulary of parameters and principles, extensible via LLM-proposed new concepts.
-
Architecture Catalog — Organizes LLM architecture components (attention, positional encoding, FFN, etc.) by slot with property-based comparison across variants. Answers "what are my options for component X?"
-
Agentic Pattern Catalog — Catalogs recurring patterns for building LLM-based agents (ReAct, Reflexion, multi-agent debate, etc.) with emergent categories discovered from data.
Status
Core pipeline implemented. All three knowledge structures are functional: contradiction matrix, architecture catalog (property-based comparison), and agentic pattern catalog (emergent categories). Full monitor pipeline: acquire → enrich → extract → build → ideate.
See docs/architecture.md for the full architecture doc.
Quick Start
# Install from PyPI
pip install lens-research
# or
uv add lens-research
# Initialize the database and config
lens init
# Acquire seed papers (10 landmark LLM papers)
lens acquire seed
# Initialize canonical vocabulary (12 parameters + 12 principles)
lens vocab init
# Extract tradeoffs, architecture, and agentic patterns from papers
lens extract
# Build taxonomy and contradiction matrix
lens build all
Optional extras
# Multi-provider LLM routing (OpenRouter, Anthropic, etc.)
pip install "lens-research[litellm]" # or: uv add "lens-research[litellm]"
# Agent-optimized paper search via DeepXiv
pip install "lens-research[deepxiv]" # or: uv add "lens-research[deepxiv]"
Usage
# Analyze a tradeoff — suggests resolution techniques from the matrix
lens analyze "reduce hallucination without hurting latency"
# Analyze architecture — find matching variants by property
lens analyze --type architecture "efficient attention for long context"
# Analyze agentic — find matching patterns
lens analyze --type agentic "reliable multi-step code generation"
# Explain any LLM concept with adaptive depth
lens explain "grouped-query attention"
lens explain "knowledge distillation" --tradeoffs
lens explain "MoE" --related
# Emit a YAML provenance sidecar linking claims to papers + vocabulary
lens analyze "reduce latency" --provenance analyze.yaml
lens explain "MoE" --provenance moe.yaml
# Search papers
lens search "attention mechanisms" # hybrid keyword + semantic
lens search --author "Vaswani" # filter by author
lens search "efficiency" --after 2024-01-01 # combine search + filters
lens search --venue "NeurIPS" --limit 5 # filter by venue
# Browse the knowledge base
lens vocab list # list vocabulary (parameters + principles)
lens vocab list --kind parameter # filter by kind
lens vocab show inference-latency # details for a concept
lens explore matrix
lens explore paper 2401.12345
# Browse architecture catalog
lens explore architecture # list all slots with variant counts
lens explore architecture Attention # compare variants with properties
lens explore evolution Attention # timeline view by paper date
# Browse agentic patterns
lens explore agents # list patterns by category
lens explore agents Reasoning # filter by category
# Acquire more papers from arxiv
lens acquire arxiv --query "LLM" --since 2025-01
lens acquire file paper.pdf # ingest a local PDF
# Acquire via DeepXiv (requires: pip install "lens-research[deepxiv]")
lens acquire deepxiv "LLM agent architecture" --max-results 10
lens acquire deepxiv --paper 2507.01701 # single paper with rich metadata
# Fetch SPECTER2 embeddings from Semantic Scholar
lens acquire semantic # all papers missing embeddings
lens acquire semantic --paper-id 2401.12345 # specific paper
# Knowledge base overview
lens status # paper counts, vocab, matrix, issues
# Run a monitoring cycle (acquire → enrich → extract → build → ideate)
lens monitor
lens monitor --skip-enrich # skip OpenAlex enrichment
lens monitor --skip-build # skip taxonomy/matrix rebuild
lens monitor --trending # show ideation gaps
# Browse research opportunities
lens explore ideas
lens explore ideas --type sparse_cell
# Health-check the knowledge base
lens lint # report issues across 7 categories
lens lint --fix # auto-fix safe issues
lens lint --check orphans,stale # run specific checks only
# View the event log (audit trail of all mutations)
lens log # last 20 events
lens log --kind extract # filter by event kind
lens log --since 2026-04-01 --limit 50 # date range + limit
# Configuration
lens config show
lens config set llm.default_model openrouter/anthropic/claude-sonnet-4-6
# Verbose logging (-v=INFO, -vv=DEBUG)
lens -v extract
lens -vv monitor
LLM Backend
LENS needs an LLM for extraction, taxonomy labeling, and analysis. For production deployment, see docs/deployment.md. Two options:
Gateway mode (recommended for production) — Point to any OpenAI-compatible endpoint (litellm gateway, vLLM, Ollama). No litellm dependency needed. Keeps API keys out of application pods.
# ~/.lens/config.yaml
llm:
api_base: "http://litellm-gateway:4000/v1"
api_key: "your-gateway-key"
default_model: "gpt-4"
Direct mode — Install litellm for multi-provider routing (OpenRouter, OpenAI, Anthropic, etc.):
pip install "lens-research[litellm]" # or: uv add "lens-research[litellm]"
Embeddings
Two embedding providers, configurable via ~/.lens/config.yaml:
Local (default) — sentence-transformers (SPECTER2 / MiniLM fallback). Free, works offline, but requires ~400MB model download on first use.
Cloud — Any embedding API via litellm or OpenAI-compatible endpoint. Fast, scalable, no local model needed.
# Switch to cloud embeddings
lens config set embeddings.provider cloud
lens config set embeddings.model text-embedding-3-small
Architecture
- Python 3.12+ with
uvpackage manager - SQLite + sqlite-vec — embedded database with vector search (cosine distance)
- openai SDK — LLM and embedding client (works with any OpenAI-compatible endpoint)
- litellm (optional) — multi-provider routing for direct API access
- deepxiv-sdk (optional) — agent-optimized paper search with hybrid retrieval and progressive reading
- Guided extraction — canonical vocabulary for all extraction types (tradeoffs, architecture, agentic)
- sentence-transformers or cloud embeddings — configurable provider
- Typer — CLI framework
Data flows through four layers:
Layer 0: Papers (arxiv, DeepXiv, PDF, OpenAlex enrichment)
↓
Layer 1: Raw Extractions (LLM-extracted tradeoffs, architecture, agentic patterns)
↓
Layer 2: Taxonomy (unified vocabulary: parameters, principles, arch slots, agentic categories)
↓
Layer 3: Knowledge Structures (contradiction matrix, ideation gaps)
Public API is synchronous; async internals are wrapped with asyncio.run().
Development
# Clone and set up for development
git clone https://github.com/flyersworder/lens.git
cd lens
uv sync
# Install pre-commit hooks (uses prek, a fast Rust-based pre-commit runner)
uv tool install prek
prek install
# Run the CLI from source
uv run lens init
Testing
uv run pytest # run all tests
uv run pytest tests/test_store.py -v # run specific test file
uv run pytest -m "not integration" # skip live API tests
Tests use tmp_path fixtures for isolated SQLite instances. No mocking — real embedded database instances are used in all tests.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lens_research-0.10.1.tar.gz.
File metadata
- Download URL: lens_research-0.10.1.tar.gz
- Upload date:
- Size: 304.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
549fd769244393034ca148c6a11cfc4cc043ea1f9c6347955c9d77f8953e5702
|
|
| MD5 |
52c86fd96c978b3fc36d066ae3787360
|
|
| BLAKE2b-256 |
48d89c75d995bacd20c51479ae119403f509780c45f2ee3b8a72ca112acd710c
|
Provenance
The following attestation bundles were made for lens_research-0.10.1.tar.gz:
Publisher:
ci-and-publish.yml on flyersworder/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_research-0.10.1.tar.gz -
Subject digest:
549fd769244393034ca148c6a11cfc4cc043ea1f9c6347955c9d77f8953e5702 - Sigstore transparency entry: 1374049013
- Sigstore integration time:
-
Permalink:
flyersworder/lens@b82059bb96aaed0a42ff827e0348e77c93d2482d -
Branch / Tag:
refs/tags/v0.10.1 - Owner: https://github.com/flyersworder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-and-publish.yml@b82059bb96aaed0a42ff827e0348e77c93d2482d -
Trigger Event:
release
-
Statement type:
File details
Details for the file lens_research-0.10.1-py3-none-any.whl.
File metadata
- Download URL: lens_research-0.10.1-py3-none-any.whl
- Upload date:
- Size: 117.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1d457588628c71de9de12b0d43e1d35aed7c725c523ce7222dbfea0bf2d4469
|
|
| MD5 |
1ca4e3960cb4685d0238b7ca68266e65
|
|
| BLAKE2b-256 |
a01aa9df2f87b18c5aec27f2a297b467e5ee414a5b7d8111eb5e371e9f44fca6
|
Provenance
The following attestation bundles were made for lens_research-0.10.1-py3-none-any.whl:
Publisher:
ci-and-publish.yml on flyersworder/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_research-0.10.1-py3-none-any.whl -
Subject digest:
f1d457588628c71de9de12b0d43e1d35aed7c725c523ce7222dbfea0bf2d4469 - Sigstore transparency entry: 1374049095
- Sigstore integration time:
-
Permalink:
flyersworder/lens@b82059bb96aaed0a42ff827e0348e77c93d2482d -
Branch / Tag:
refs/tags/v0.10.1 - Owner: https://github.com/flyersworder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-and-publish.yml@b82059bb96aaed0a42ff827e0348e77c93d2482d -
Trigger Event:
release
-
Statement type: