Skip to content

uh-joan/cortellis-cli

Repository files navigation

Cortellis AI-native knowledge base - Intelligence that compounds

  ╔═════════════════════════════════════════════════════════════════════════════╗
  ║                                                                             ║
  ║    ██████╗ ██████╗ ██████╗ ████████╗███████╗██╗     ██╗     ██╗███████╗     ║
  ║   ██╔════╝██╔═══██╗██╔══██╗╚══██╔══╝██╔════╝██║     ██║     ██║██╔════╝     ║
  ║   ██║     ██║   ██║██████╔╝   ██║   █████╗  ██║     ██║     ██║███████╗     ║
  ║   ██║     ██║   ██║██╔══██╗   ██║   ██╔══╝  ██║     ██║     ██║╚════██║     ║
  ║   ╚██████╗╚██████╔╝██║  ██║   ██║   ███████╗███████╗███████╗██║███████║     ║
  ║    ╚═════╝ ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝╚══════╝╚══════╝╚═╝╚══════╝     ║
  ║                                                                             ║
  ║            P h a r m a c e u t i c a l   I n t e l l i g e n c e            ║
  ╚═════════════════════════════════════════════════════════════════════════════╝

Disclaimer: Unofficial, community-built tool. Not affiliated with Clarivate or Cortellis. Requires valid API credentials and an active subscription.

The pharma analyst that never sleeps. Cortellis data, deterministic skill pipelines, a self-building knowledge base, and exports ready for the boardroom — powered by AI that compounds with every session.

The Problem

Pharma CI analysts spend 70% of their time gathering data and 30% on actual analysis. Every landscape starts from scratch. Insights from last month's analysis vanish. Five database tabs open to answer one question about a competitor. The quarterly report means rebuilding everything from zero.

Built on Karpathy's LLM Wiki pattern: knowledge is compiled once and kept current, not re-derived on every query. The wiki is a persistent, compounding artifact.

Install

pip install git+https://github.com/uh-joan/cortellis-cli.git
cortellis setup    # credentials + API test, 30 seconds

Windows

Works on Windows with a few prerequisites. Open PowerShell and follow these steps:

1. Install Python 3.9+ Download from https://www.python.org/downloads/ — during install, check "Add Python to PATH".

2. Install Git Bash (required for skills — /landscape, /pipeline, etc.) Download from https://git-scm.com/download/win. Use all defaults.

3. Install Node.js (required for Claude Code) Download from https://nodejs.org — LTS version.

4. Install Claude Code

npm install -g @anthropic-ai/claude-code

5. Pull and set up

git clone https://github.com/uh-joan/cortellis-cli.git
cd cortellis-cli
cortellis setup

That's it. cortellis setup creates the local environment and walks through credentials. After that, all CLI commands and chat mode work from PowerShell.

Note: Skills (/landscape, /pipeline, etc.) require Git Bash to be installed. Basic data commands work without it.

Three Layers

A CLI for raw data access, a harness for deterministic multi-step analysis, and a compounding wiki that gets smarter with every session.

1. CLI — 13 Data Domains, 80+ Commands

cortellis drugs search --phase L --indication 238 --hits 10
cortellis --json deals search --drug "semaglutide" | jq .
cortellis trials search --phase C3 --indication obesity
cortellis regulations search --region USA

Drugs, companies, deals, trials, regulatory, targets, drug design, ontology, analytics, conferences, literature, press releases, NER.

2. Skills — Multi-Step Analysis Workflows

Slash commands that orchestrate full analytical pipelines — works with Claude Code, OpenAI Codex, Pi, a local LM Studio server, or the GitHub Copilot CLI:

Command What it does
/landscape obesity Competitive landscape — CPI rankings, mechanism crowding, deals, opportunities
/pipeline "Novo Nordisk" Company pipeline — all phases, deals, trials
/drug-profile tirzepatide Deep drug profile — SWOT, financials, history, competitors
/target-profile GLP-1 Target biology — disease associations, drug pipeline, pharmacology
/drug-comparison tirzepatide vs semaglutide Head-to-head comparison across all dimensions
/conference-intel ASCO 2026 Conference briefing — "What's New / So What / What's Next"

Skills are self-evolving. The more you use them, the faster and smarter they get. Entity lookups are cached so repeated runs skip API calls entirely. After each run, a reviewer checks what worked and what was empty, and encodes the patterns directly into the skill — so next time it skips what's known to be irrelevant for that drug class or indication. Ships pre-seeded with common patterns from real runs; compounds from there. Inspired by Hermes Agent's background skill review mechanism.

Every skill runs through the harness — a deterministic DAG executor (cortellis run-skill) that sequences steps, hard-fails on any error, and guarantees the same output whether triggered from chat, the web UI, or the CLI directly. No silent gaps, no improvised steps.

cortellis run-skill landscape obesity      # same pipeline as /landscape in chat
cortellis run-skill pipeline "Novo Nordisk"
cortellis run-skill drug-profile tirzepatide --dry-run  # preview execution plan

Knowledge base commandswiki refresh, changelog, ingest, /signals, /insights.

3. Knowledge Base — Persistent, Compounding Intelligence

Every analysis compiles into a persistent wiki that gets richer over time.

wiki/
├── INDEX.md                 ← Master catalog (auto-maintained)
├── log.md                   ← Chronological activity record
├── indications/             ← Compiled landscape articles (14+)
├── companies/               ← Cross-indication company profiles (100+)
├── drugs/                   ← Drug profile articles
├── targets/                 ← Target biology articles
├── insights/sessions/       ← Session-derived analytical insights
├── graph.json               ← NetworkX knowledge graph
└── GRAPH_REPORT.md          ← Entity clusters, god nodes, bridges

Compile — each skill run writes wiki articles with YAML frontmatter and [[wikilinks]]. Accumulate — session hooks capture conversation insights automatically. Inject — next session starts with everything in context. Lint — 7 structural health checks keep the wiki healthy.

Open in Obsidian for graph view, backlinks, and visual navigation — Open folder as vault → wiki/.

Web UI

Prefer a browser? The same intelligence is available as a web app:

cortellis web          # opens http://localhost:7337

Chat with your compiled wiki, run queries, and explore the knowledge graph — no terminal required. The UI is built during cortellis setup.

See It In Action

Start the CLI with Claude Code (default), OpenAI Codex, Pi, LM Studio, or GitHub Copilot:

cortellis                        # Claude Code (default)
cortellis --engine codex         # OpenAI Codex
cortellis --engine pi            # Pi coding agent
cortellis --engine lmstudio      # local LM Studio server
cortellis --engine copilot       # GitHub Copilot CLI

The SessionStart hook injects compiled wiki context — the AI already knows your landscapes, signals, and previous insights.

you> what is the competitive landscape for obesity?

Answers in seconds from compiled knowledge. No pipeline, no API calls. 772 drugs, CPI rankings, mechanism analysis — all from the wiki.

you> how does Novo Nordisk's position compare across our analyzed indications?

Cross-references wiki/companies/novo-nordisk.md — CPI 95.0 in obesity, 77.5 in GLP-1.

you> compare all our analyzed indications

14 indications in one table, sorted by pipeline size.

you> what changed in the obesity landscape?

Drug count deltas by phase, deal velocity, company ranking shifts.

you> show me how the obesity pipeline has evolved over the last year

Fetches real historical data via Cortellis change_history API. Phase 3 nearly doubled in 12 months (17 to 32). Tirzepatide launched Dec 2025. Survodutide entered Phase 3 Mar 2026.

you> export the obesity landscape as a PowerPoint deck

8-slide PPTX. Also: Excel (5 sheets), BD brief (deal comps + licensing targets), executive brief (5 bullets, plain language).

you> compare tirzepatide vs semaglutide

Head-to-head: phase, mechanism, indications, trials, deals — side-by-side.

you> what have we learned from previous analyses?

Accumulated session insights — key findings, scenarios, implications from past runs.

Exit. The SessionEnd hook captures the transcript, extracts insights, writes to daily/. Next session starts with those insights — the system remembers.

Requirements

  • Python 3.9+
  • Cortellis API credentials — active subscription required
  • AI engine (choose one, all optional — all CLI commands work without them):
    • Claude Codenpm install -g @anthropic-ai/claude-code + claude login
    • OpenAI Codexnpm install -g @openai/codex + codex login --device-auth (ChatGPT Plus/Pro subscription)
    • Pinpm install -g @mariozechner/pi-coding-agent + pi /log (configure any LLM provider)
    • LM Studio — run a local model server, then point at it with LMSTUDIO_URL (default http://127.0.0.1:1234) and optional LMSTUDIO_MODEL. Fully local, no API key.
    • GitHub Copilot CLInpm install -g @github/copilot + gh auth login (or set COPILOT_GITHUB_TOKEN to a fine-grained PAT with the Copilot Requests permission; classic ghp_ PATs are not supported). Requires an active Copilot subscription.
  • Obsidian (optional) — for wiki graph view and visual navigation

About

Pharmaceutical intelligence CLI - self-building wiki knowledge base, 80+ Cortellis API commands, AI-powered analytical skills (landscape, pipeline, profiles), and a browser UI. Knowledge that compounds with every session.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors