Skip to main content

magi

MAGI logo

PyPI version Python versions npm package @carneirofc/magi-web License: Apache-2.0

Personal multi-channel AI assistant on the Agno framework. One shared agent brain, many channel adapters. Model-agnostic — local llama.cpp llama-server by default (direct, or through the LiteLLM proxy); Claude via the proxy; Ollama kept as a dormant fallback.

The name. MAGI is the supercomputer at the heart of NERV in Neon Genesis Evangelion — three linked units (Melchior, Balthasar, Casper) that reason as one and reach decisions by majority vote. The nod fits: one shared brain backed by a roster of specialized members, speaking through many channels.

Features

magi is the reusable core of a personal AI assistant — not one bot, but the engine several bots share.

  • One shared brain, many channels. A Discord bot, an HTTP API, an OpenAI-compatible shim, an embeddable desktop SDK, and a native desktop shell all drive the same assembled stack — only the transport differs.
  • Deliberate memory. The assistant's durable knowledge of a user lives in inspectable files written on purpose by a post-turn curator — never silently auto-extracted. Recent turns, evicted-but-unsummarized turns, freshly-learned facts, and past episodes are all assembled into each run's context.
  • Bot identity. A global, operator-set profile — display name, description, and profile picture — the assistant presents as itself: injected into every run so the model both knows its name and can show its picture on request.
  • Knowledge corpus (RAG). A shared, read-only document corpus the assistant searches on demand — and optionally auto-injects the top hits for each message straight into context. Distinct from per-user memory.
  • Byte archive. A durable file/image store the model uses as memory for bytes: stash a file, recall it later by reference. Local filesystem or any S3-compatible backend.
  • Admin dashboard. A web UI to inspect and edit everything the assistant remembers — users, facts, sessions, knowledge, persona, and identity.
  • Model-agnostic. Local llama-server by default; Claude (via LiteLLM) and Ollama drop in without touching the team code.
  • Engine + persona. Boots and chats with a neutral demo persona; a private persona repo overlays prompts and registers its own specialists without forking.
flowchart LR
    D[Discord] --> CS[ConversationService]
    A[HTTP API + OpenAI shim] --> CS
    W[Web / desktop chat] --> CS
    CS --> MEM[(Deliberate memory<br/>+ identity)]
    CS --> TEAM{{Agent team<br/>lead → specialists}}
    TEAM --> BK[llama-server / LiteLLM / Ollama]
    MEM --> ST[(files · Qdrant · SQLite)]
    TEAM --> OBJ[(byte archive · knowledge)]

Admin dashboard

A web dashboard to inspect and edit everything the assistant remembers — the counterpart to deliberate memory. Browse users and their curated facts, read sessions as a chat transcript, promote a session's takeaways into long-term memory, manage the knowledge corpus, and edit the global persona and identity. It also embeds a streaming chat console to talk to the brain as any user. Built on the @carneirofc/ui design system with light/dark themes. See web/ to run it.

MAGI admin dashboard

A user's memory — facts as editable cards
Memory — a user's facts as editable cards, under tabs
Session rendered as a chat transcript
Session — the conversation window as a chat transcript
Knowledge corpus
Knowledge — corpus as table or cards, filtered by subject/tag
Persona editor
Persona — edit the global persona and bot identity
Subject registry
Subjects — the controlled vocabulary the corpus is grouped by
Dark theme
Dark theme — a click away, on every page

More views in the admin UI README.

Use as a library & extend

magi is meant to be overlaid, not forked. A persona repo depends on the engine and adds its own persona + specialists without editing the public tree — this is how a private persona overlay is built (full plan in docs/split-plan.md; the frontend twin in docs/frontend-split.md).

# your-persona/pyproject.toml
[project]
dependencies = ["magi-ai-assistant"]    # pin magi-ai-assistant==0.1.* for a release
                                         # (dist name — you still `import magi`)

[tool.uv.sources]                       # …or a live editable link during dev
magi-ai-assistant = { path = "../chatbot", editable = true }

Four seams, no forking:

# register private specialists, tools & skills at your entrypoint, before build_team()
from magi.agent.members import register_member
from magi.agent.skills import Skill, register_skill
from magi.agent.tools import register_lead_toolkit

@register_member
def build_myspecialist(model): ...      # your own agno Agent factory

@register_lead_toolkit
def build_mytools(memory): ...          # your own lead tools, memory-injected

register_skill(Skill(                   # prompt + tools + gate as one unit
    name="dice", prompt="Roll dice via roll_dice…", tools=(roll_dice,)))
  • Prompts are an overlay search path — point a config dir at your persona's prompts; the bundled neutral demo prompts are the fallback (magi/core/prompts.py). Persona is data, not code.
  • The frontend mirrors this — build your admin/chat UI on the published @carneirofc/magi-web component + chat-runtime library.

Releases. Tag v* builds the engine and publishes it to PyPI as magi-ai-assistant — plus a GitHub Release carrying the wheel/sdist (.github/workflows/publish-magi.yml); tag magi-web-v* publishes the frontend library to GitHub Packages (.github/workflows/publish-magi-web.yml). Tag release-v* ships both in lockstep (.github/workflows/release.yml).

Documentation

Full docs live in docs/ — this README is just the map.

Topic Doc
Install & run, first chat, Open WebUI getting-started.md
Design, request lifecycle, diagrams architecture.md
Deliberate memory (the centerpiece) memory.md
Discord / HTTP / OpenAI shim contracts channels.md
Desktop app client (embed or HTTP SDK) desktop.md
Every configuration field configuration.md
Team, members, tool catalog agent-and-tools.md
Docker services, ports, ingestion infrastructure.md
Split into engine + persona overlay; releasing both libraries split-plan.md · frontend-split.md

Domain vocabulary is defined in CONTEXT.md; architecture decisions in docs/adr/; the release history in CHANGELOG.md.

Run

python main.py api      # standalone HTTP service (+ OpenAI shim) for external clients
python main.py discord  # Discord bot (needs DISCORD_BOT_TOKEN)
python main.py desktop  # frameless native shell over the web frontend (uv sync --extra desktop)
python main.py admin    # operator admin API (memory + knowledge)

Every chat channel serves the same brain (magi/channels/bootstrap.py); only the transport differs. Config is code-first: each channel's settings live in its configure_* function in main.py, and defaults in magi/core/config.py. Only secrets come from .env (DISCORD_BOT_TOKEN, API_AUTH_TOKEN, QDRANT_API_KEY, …). Add --docker to any chat channel to overlay the container-only deltas. Full walkthroughs — first chat, Open WebUI, Docker, storage backends — are in docs/.

Clients

  • HTTP API + OpenAI shim — JSON over HTTP, session-scoped, with an OpenAI-compatible /v1/chat/completions so off-the-shelf UIs (Open WebUI, LibreChat) work unchanged. Streams delta events over SSE, carries media both ways. Contract in docs/channels.md.
  • Desktop SDK — magi.client embeds the whole brain in a Python GUI (embed(...), no server) or talks to a running API (connect(...)) behind one call surface; SyncClient wraps either in blocking methods for Tkinter/PyQt/wx. Runnable example: examples/desktop_chat.py. See docs/desktop.md.
  • Native desktop shell — python main.py desktop renders the web frontend in a chromeless, translucent window and serves it from one process, with a JS↔Python bridge.
from magi.client import SyncClient, embed, connect

ui = SyncClient(embed(user_id="local"))                 # in-process, no server
# ui = SyncClient(connect("http://127.0.0.1:8000", user_id="local"))  # over HTTP
print(ui.send("hello").text)
for chunk in ui.stream("tell me more"):                 # streamed deltas
    ...
ui.close()

Metadata

Release files for magi-ai-assistant 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magi-ai-assistant 0.4.0
File Size Uploaded Provenance Actions
magi_ai_assistant-0.4.0.tar.gz 249.2 kB Without provenance Details for magi_ai_assistant-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magi-ai-assistant 0.4.0
File Interpreter ABI Platform Actions
magi_ai_assistant-0.4.0-py3-none-any.whl Python 3 none any Details for magi_ai_assistant-0.4.0-py3-none-any.whl

Total release size: 548.5 kB

Release files / magi_ai_assistant-0.4.0.tar.gz

Download URL magi_ai_assistant-0.4.0.tar.gz
Size 249.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c85b53b30da3616268e211fb97e428ae318ad83ef9549a4d6399f7b514b42aed
BLAKE2b-256 checksum
How to use checksums
fc9a8dfe8dfa465f1aea9f95b43820a93d44fb0c2415127df7e67180a9d7eba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / magi_ai_assistant-0.4.0-py3-none-any.whl

Download URL magi_ai_assistant-0.4.0-py3-none-any.whl
Size 299.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0daa5381b631002b9edff3d4a7a78826fc7f7988d265a7d7baaa006c462db5b8
BLAKE2b-256 checksum
How to use checksums
45661343d2f027d13b5a8428b22b004c1246bbf16a8ab2a028c3795edbe5dec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for magi-ai-assistant 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page