Metadata-Version: 2.4
Name: june-langgraph
Version: 0.1.0
Summary: Give your LangGraph agent a June memory — mirror chat history from any LangGraph checkpointer into a searchable, cited June knowledge canvas. Three commands, no code changes.
Author-email: Junemind <access@januraine.ai>
License-Expression: MIT
Project-URL: Homepage, https://june.januraine.ai
Project-URL: Source, https://github.com/Junemind/june-langgraph
Project-URL: Releases, https://github.com/Junemind/June_releases
Keywords: langgraph,langchain,agent-memory,checkpointer,knowledge-graph,june
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langgraph-checkpoint>=2
Provides-Extra: sqlite
Requires-Dist: langgraph-checkpoint-sqlite>=2; extra == "sqlite"
Provides-Extra: postgres
Requires-Dist: langgraph-checkpoint-postgres>=2; extra == "postgres"
Provides-Extra: mysql
Requires-Dist: langgraph-checkpoint-mysql[pymysql]>=2; extra == "mysql"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: langgraph>=0.2; extra == "dev"
Requires-Dist: langgraph-checkpoint-sqlite>=2; extra == "dev"
Dynamic: license-file

# june-langgraph

**Give your LangGraph agent a June memory.** If your agent saves conversations
with a LangGraph checkpointer (SQLite or Postgres), this connects that history
to [Junê](https://june.januraine.ai) — so you can *search* every conversation,
*ask questions* about them ("what did we decide about pricing?") and get
grounded, cited answers, and give the agent itself memory of past sessions.

No code changes required. Three commands:

```bash
pip install "june-langgraph[sqlite]"     # [postgres] / [mysql] for server DBs
june-langgraph connect                   # one-time setup — it finds everything
june-langgraph watch                     # keeps June updated while your agent runs
```

`connect` is a small wizard: it looks for June on your computer (it finds the
Junê desktop app automatically), looks for your agent's chat database in the
current folder, checks the whole path works, and saves the setup. `watch`
then quietly mirrors every new message into a June canvas as your agent runs.
Run `june-langgraph sync` once to bring in the history you already have.

```
your LangGraph app ──▶ checkpointer DB ──▶ june-langgraph ──▶ June canvas
     (unchanged)         (unchanged)        (watch/sync)    (search · ask · cite)
```

Your checkpoint database is **never modified** — it is only read, and always
through LangGraph's own deserializer, so what June sees is exactly what your
agent saved.

## Why

LangGraph checkpointers are built for *resuming* a conversation, not for
*finding* one. The history lives in serialized checkpoint blobs across
several tables — fine for the framework, hopeless for "show me everything we
said about the contract". June turns that history into a searchable, cited
knowledge graph.

## Everyday commands

| command | what it does |
|---|---|
| `june-langgraph connect` | one-time setup wizard (safe to re-run any time) |
| `june-langgraph sync` | one catch-up pass — brings existing history into June |
| `june-langgraph watch` | keeps syncing while your agent runs (Ctrl+C to stop) |
| `june-langgraph status` | what's configured + how much has synced |
| `june-langgraph doctor` | checks every part of the setup, PASS/FAIL per item |

Everything is incremental: only new messages are sent, tracked per message in
a small ledger, so re-running never duplicates. If June is offline, `watch`
keeps trying quietly and catches up when it's back; your agent is never
affected.

## For developers: mirror in-process instead

If you'd rather not run a second process, wrap your checkpointer — one line:

```python
from langgraph.checkpoint.sqlite import SqliteSaver
from june_langgraph import JuneSaver

with SqliteSaver.from_conn_string("checkpoints.sqlite") as inner:
    app = graph.compile(checkpointer=JuneSaver(
        inner,                                 # any BaseCheckpointSaver
        june_url="http://127.0.0.1:8799",      # the Junê app's local engine
        api_key="local",
        canvas="agent-chats",
        state_file=".june_pushed.json",        # dedupe ledger, survives restarts
    ))
```

LangGraph behaviour is untouched (resume, time travel, `.list()` — everything
delegates to the inner saver). New messages mirror to June at save time, while
they're still live objects — nothing is ever deserialized. Sync and async
graphs both work. If June is down the agent keeps running and unpushed
messages retry on the next save.

## Pairs with june-mcp

Both packages speak the same env vars (`JUNE_BASE_URL`, `JUNE_API_KEY`,
`JUNE_CANVAS`) and the same canvas semantics. Point
[june-mcp](https://pypi.org/project/june-mcp) at the same canvas and Claude
(Desktop or Code) can answer questions over your agent's entire chat history —
`june_answer` with citations, `june_search`, `june_enumerate` — while
`june-langgraph watch` keeps it current. Your LangGraph app can also read June
at runtime (`/v1/search`, `/v1/context`) to give the agent long-term memory.

## Which databases work

| your checkpointer | install | `--db` looks like |
|---|---|---|
| `SqliteSaver` | `june-langgraph[sqlite]` | `checkpoints.sqlite` |
| `PostgresSaver` | `june-langgraph[postgres]` | `postgresql://user:pw@host/db` |
| `PyMySQLSaver` (community) | `june-langgraph[mysql]` | `mysql://user:pw@host/db` |
| **anything else** (Redis, Mongo, …) | that saver's package | its conn string + `--saver` |

The `--saver` escape hatch accepts any `BaseCheckpointSaver` via a
`package.module:factory` spec — the factory is called with your `--db` string:

```bash
june-langgraph sync --db "redis://localhost:6379" \
  --saver "langgraph.checkpoint.redis:RedisSaver.from_conn_string"
```

So new community checkpointers work the day they exist, without waiting for a
june-langgraph release. (Custom savers always use the full-scan change
detection; the metadata-only fast path is SQLite-specific.)

## Configuration

`connect` writes `~/.june/langgraph.json` (key-holding, chmod 600). Everything
can be overridden per-run with flags (`--db`, `--june-url`, `--june-key`,
`--canvas`) or the env vars above. `JUNE_LANGGRAPH_HOME` relocates the config
directory. Custom state key? `messages_key` in the config file (default
`messages`).

## Troubleshooting

Run `june-langgraph doctor`. It checks, in order: configuration → June
reachable → canvas resolves → database readable → ledger writable, and prints
a mapped hint for each FAIL. Exits 0 only when everything passes.

## License

MIT. The Junê engine itself is a separate, closed-source product — this
connector is the open part, by design.
