Commit Graph
51 Commits
Author SHA1 Message Date
Nuno Campos 494cd4f6ad checkpoint 2.0.24 2025-04-02 15:44:58 -07:00
William Fu-Hinthorn 10859da99a Handle sneds 2025-03-24 17:12:50 -07:00
William Fu-Hinthorn d8cc9c9680 merge with ormsgpack 2025-03-24 16:21:59 -07:00
Nuno Campos a88794b74e Update ormsgpack 2025-03-24 09:03:23 -07:00
Nuno Campos 3d16acf3f5 Switch serialization lib to ormsgpack
- faster for large states
- supports tuples as dict keys
2025-03-24 09:01:55 -07:00
William Fu-Hinthorn 0b9adc28c3 langgraph-checkpoint 2.0.21 2025-03-17 15:15:29 -07:00
William Fu-Hinthorn 18ed044c27 Bump patch version 2025-03-14 14:03:30 -07:00
William Fu-Hinthorn f1162ac898 Bump 2025-03-11 20:22:58 -07:00
William FHandGitHub c3df8bd500 Ensure key is string (#3739)
Mainly relevenat for the in memory store.
2025-03-07 11:21:32 -08:00
William FHandGitHub 09bd5990d4 Add TTL option for store items (#3704) 2025-03-06 13:20:32 -08:00
Nuno Campos f4fec76257 checkpoint: Fix memory leak in checkpoint serializer
- Packer instances can't be kept in memory as they retain memory after used
2025-02-18 11:44:26 -08:00
Nuno Campos 9706211aca Exclude complex values from checkpoint metadata 2025-02-14 17:35:14 -08:00
Nuno Campos bf7252cadc checkpoint 2.0.14 2025-02-14 12:28:04 -08:00
Vadym BardaandGitHub d45253cee8 checkpoint: release libraries (#3412) 2025-02-12 22:44:44 -05:00
William FHandGitHub e81979827f Support index embed specification via string (#3317)
So you can do

```
from langgraph.store.memory|posgres|etc. import InMemoryStore

InMemoryStore(index={"embed": "openai:text-embedding-3-small"})
```
2025-02-09 02:09:10 +00:00
William FHandGitHub 3daa4ae466 Update name to InMemorySaver (#2044)
(Keep MemorySaver around for backwards compatibility)

"MemorySaver" is ambiguous: is it saving memories? Where is it saving
memories to?

InMemorySaver aligns naming InMemoryStore as well as similar LangChain
objects (InMemoryVectorStore, etc.)
2025-02-05 22:04:25 -08:00
Nuno Campos 2c984dfe4e checkpoint 2.0.10 2025-01-15 11:14:03 -08:00
Vadym BardaandGitHub a200027cda checkpoint: release 2.0.9 (#2744) 2024-12-12 15:06:54 -05:00
William FHandGitHub 36b6cd1493 fix: Handle empty store similarity (numpy) (#2602) 2024-12-02 18:20:19 -08:00
William FHandGitHub 855a3d21ff Update Checkpoint Version (#2565) 2024-11-27 20:50:11 -08:00
William FHandGitHub d767af421b feat: Add vector search (#2535)
- Initializing the store with an 'embedding config' -> this contains the
'dims' (used to create the table) and the encoder object (rn langchain
embeddings object, though that is ......)
- Call setup() -> creates the vector table.

Each document has 1 or more vectors associated with it for each json
path in the embedding config.

Would welcome critique and requests! 

Leaving the params as the defaults for pgvector but open to feedback if
you think it's important to be able to more transparently configure that
in setup()

```python
from typing import TypedDict, List, Dict, Any, Optional

from langchain_openai import OpenAIEmbeddings
from langgraph.graph import StateGraph
from langgraph.store.postgres import PostgresStore

emb_config = {
    "dims": 1536,  # OpenAI embedding dimensions
    "embed": OpenAIEmbeddings(model="text-embedding-3-small"),
    "distance_type": "cosine",
}
with PostgresStore.from_conn_string(
    "postgres://postgres:postgres@localhost:5441",
    embedding=emb_config,
) as store:
    store.setup()


# Define the state type for our graph
class State(TypedDict):
    query: str
    results: Optional[List[Dict[str, Any]]]


def put_stuff(state: State) -> State:
    docs = [
        ("doc1", {"text": "red apple in kitchen"}),
        ("doc2", {"text": "blue car in garage"}),
        ("doc3", {"text": "green apple on table"}),
    ]
    for key, value in docs:
        store.put(("docs",), key, value)


def search_stuff(state: State) -> State:
    """Search for documents using vector similarity."""
    results = store.search(("docs",), query=state["query"])

    return {"results": results}


builder = StateGraph(State)
builder.add_node(put_stuff)
builder.add_node(search_stuff)
builder.add_edge("__start__", "put_stuff")
builder.add_edge("put_stuff", "search_stuff")
# Compile
with PostgresStore.from_conn_string(
    "postgres://postgres:postgres@localhost:5441",
    embedding=emb_config,
) as store:
    chain = builder.compile(store=store)

    result = chain.invoke({"query": "sour apple"})

# Print results
for doc in result["results"]:
    print(doc.key)
    print(doc.value)
    print(doc.response_metadata)

```
2024-11-28 04:40:12 +00:00
William FHandGitHub 62a36befd5 Add in-mem vector search (#2547) 2024-11-27 14:53:24 -08:00
William FHandGitHub 8f649abd0a Release PG Checkpointer (#2536) 2024-11-26 01:44:45 +00:00
William FHandGitHub c6360e5408 [Checkpoint] 2.0.5 (#2450) 2024-11-18 08:19:17 -08:00
Nuno Campos 7051bccc30 checkpoint 2.0.4 2024-11-13 17:37:01 -08:00
William FHandGitHub 7b4c29a20d [Checkpointers] MemorySaver: refrain from overwriting writes (#2399) 2024-11-13 00:20:38 +00:00
Vadym BardaandGitHub a0e99f704f checkpoint: release 2.0.2 (#2179) 2024-10-24 13:52:02 -04:00
William FHandGitHub 57727be9db Checkpoint 2.0.1 (#2018) 2024-10-06 14:10:48 -07:00
Vadym BardaandGitHub 78c9c15b14 langgraph, checkpoint: update versions (#1942) 2024-10-01 13:43:07 -04:00
Vadym BardaandGitHub 3c9441c039 checkpoint: release 1.0.14 (#1917) 2024-09-30 14:54:00 -04:00
William FHandGitHub 9ad617bb7a [Release] 1.0.13 (#1903) 2024-09-30 10:16:50 -07:00
Vadym BardaandGitHub a319727a9e checkpoint: release 1.0.12 (#1888) 2024-09-27 14:19:00 -04:00
Vadym BardaandGitHub 434e7519bc checkpoint: release 1.0.11 (#1814) 2024-09-23 17:58:25 -04:00
Nuno Campos 4d26c3599f ci: Enable mypy checks for checkpoint lib 2024-09-18 18:12:11 -07:00
Nuno Campos 70af3bc3cb checkpoint 1.0.10 2024-09-16 14:10:03 -07:00
Nuno CamposandGitHub 3b05279e32 Implement serialization with msgpack library (#1716)
* Implement serialization with msgpack library

- encode custom python objects with a msgpack extension type, with constructor path string, and args encoded as nested msgpack doc

* Smaller msgpack extension types

* Update lock files

* lock

* Don't delegate to pydantic json

* Fix kafka serde

- should use our serializer to load, as inputs to subgraphs are serialized using it
2024-09-16 14:06:42 -07:00
Vadym BardaandGitHub 46b6cd45e2 checkpoint: release 1.0.9 (#1628) 2024-09-05 17:24:18 -04:00
Vadym BardaandGitHub 7bf99a5d2f langgraph: changes for compatibility pydantic v2 / langchain-core==0.3 (#1594) 2024-09-05 15:26:35 -04:00
Nuno Campos eca419008c checkpoint 1.0.8 2024-08-30 16:10:57 -07:00
Nuno Campos 3943637202 Bump them all 2024-08-30 14:18:35 -07:00
Nuno Campos 330c91f622 Update ruff 2024-08-27 10:50:39 -07:00
Nuno Campos 4a4dd16535 checkpoint 1.0.6 2024-08-23 18:25:56 -07:00
Nuno Campos c49692d794 checkpoint 1.0.5 2024-08-23 18:15:48 -07:00
Nuno Campos 8a00a0026e checkpoint1.0.4 2024-08-22 12:45:20 -07:00
Nuno Campos d07cbd34ce checkpoint1.0.3 2024-08-15 10:19:50 -07:00
Vadym BardaandGitHub 5cab47f751 checkpoint: move memory into a directory to fix namespace import issues (#1249) 2024-08-07 09:41:06 -04:00
Vadym BardaandGitHub 2b860f04ce checkpoint: release 1.0.1 (#1243) 2024-08-06 22:38:13 -04:00
Vadym BardaandGitHub c149a99b44 checkpoint-sqlite: new library for sqlite checkpointer implementation (#1203)
* checkpoint-sqlite: new library for sqlite checkpointer implementation
2024-08-02 22:14:12 +00:00
Nuno Campos 55044ba231 Add make test_watch_all command 2024-08-02 12:56:53 -07:00
Vadym BardaandGitHub bbd5e692e1 checkpoint: release 1.0.0 (#1201) 2024-08-02 14:10:00 -04:00