Skip to main content

LLM assistant for Python packages in REPLs and notebooks

Project description

sagely Agent Banner

LLM-powered assistant for every Python package you import.
Just add .sage.ask("your question") to any module.

PyPI version CI Status GitHub stars


🧠 sagely Agent

sagely Agent automatically injects a .sage assistant into every package you import. Ask questions about the library you're using, get help with errors, and explore code with syntax-highlighted answers — all powered by an LLM.


🎥 Demo

(Click to view full video)

https://github.com/superpandas-ai/sagely/assets/demo.gif
or
https://loom.com/share/sagely-demo-link


❓ Why sagely?

There are thousands of Python libraries, but their docs aren't always intuitive. sagely fills that gap:

  • You don't need to search Stack Overflow every time you forget a method.
  • You get context-aware help, including recent exceptions and object summaries.
  • It's built for exploration — whether you're using a notebook, REPL, or script.

✨ Features

  • �� Ask any module .sage.ask("How do I do X?")
  • 💡 Smart context: recent errors + object summaries
  • 🧩 Auto-attaches to every import
  • 💾 Caches answers to avoid repeated API calls
  • 🎨 Syntax-highlighted output with pygments
  • 🧠 IPython magic: %sagely pandas how to merge?

🚀 Getting Started

1. Install

pip install sagely

2. Import It

import sagely

It hooks into all future imports.

🧪 Usage Examples

Inline Python

import matplotlib

matplotlib.sage.ask("how to make a scatter plot?")

In Jupyter / IPython

%load_ext sagely

%sagely numpy how to generate random numbers?

Programmatic

from sagely import agent

agent.ask("requests", "how do I send a POST request?")

🔧 Requirements

  • openai
  • ipywidgets
  • pygments
  • ipython

(Installed automatically.)

🧠 Project Structure

sagely/
├── src/sagely/
│   ├── agent.py
│   ├── cache.py
│   ├── context.py
│   ├── import_hook.py
│   ├── ipython_magics.py
│   ├── widgets.py
│   └── __init__.py
├── tests/
├── pyproject.toml
├── MANIFEST.in
└── README.md

🤝 Contributing

sagely is early-stage — PRs and ideas welcome!

  • Want to support other LLMs?
  • Want advanced caching or error tracing?
  • Want to auto-annotate cells with answers?

Open an issue or submit a PR. 💥

🧷 License

MIT © 2025 SuperPandas Ltd

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

sagely-0.0.2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

sagely-0.0.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file sagely-0.0.2.tar.gz.

File metadata

  • Download URL: sagely-0.0.2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for sagely-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5ad9dc644ceed451df903fe8bca2e39290ed1afdc6bce4b8cf68f0b4ffd3ed3d
MD5 054b424c2d0171f3f29d034302c3d13a
BLAKE2b-256 2f163fe28138baae6c9cf4641b32c319a16a6d24308a65720ea519b680e324b0

See more details on using hashes here.

File details

Details for the file sagely-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: sagely-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for sagely-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89914419789f1af4dfccbdfeb86340049e6ee0e95fb1e750aab2c7f2de1f31e0
MD5 802bd650ecc2a4574b590258100ca62f
BLAKE2b-256 4f1cf258f832820c71445574d2318be490a283a88db704e0263f62dd8290ff8c

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