hyperstack-langgraph 1.0.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyperstack_langgraph-1.2.0/PKG-INFO +24 -0
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph/__init__.py +156 -29
- hyperstack_langgraph-1.2.0/hyperstack_langgraph.egg-info/PKG-INFO +24 -0
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph.egg-info/SOURCES.txt +0 -2
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/pyproject.toml +3 -3
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/setup.cfg +4 -4
- hyperstack_langgraph-1.0.0/LICENSE +0 -21
- hyperstack_langgraph-1.0.0/PKG-INFO +0 -156
- hyperstack_langgraph-1.0.0/README.md +0 -129
- hyperstack_langgraph-1.0.0/hyperstack_langgraph.egg-info/PKG-INFO +0 -156
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph.egg-info/dependency_links.txt +0 -0
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph.egg-info/requires.txt +0 -0
- {hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hyperstack-langgraph
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Knowledge graph memory for LangGraph agents. Portable memory, real-time agent-to-agent orchestration, zero LLM cost.
|
|
5
|
+
Author-email: CascadeAI <deeq.yaqub1@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://cascadeai.dev/hyperstack
|
|
8
|
+
Project-URL: Repository, https://github.com/deeqyaqub1-cmd/hyperstack-langgraph
|
|
9
|
+
Project-URL: Documentation, https://cascadeai.dev/hyperstack
|
|
10
|
+
Keywords: langgraph,memory,knowledge-graph,ai-agents,hyperstack,langchain,multi-agent,portable-memory
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Provides-Extra: langgraph
|
|
23
|
+
Requires-Dist: langgraph>=0.2; extra == "langgraph"
|
|
24
|
+
Requires-Dist: langchain-core>=0.3; extra == "langgraph"
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
"""
|
|
2
2
|
HyperStack LangGraph Integration
|
|
3
3
|
Knowledge graph memory for LangGraph agents.
|
|
4
|
+
Portable memory across tools. Multi-agent coordination.
|
|
4
5
|
"""
|
|
5
6
|
|
|
6
7
|
import os
|
|
7
8
|
import json
|
|
8
9
|
import urllib.request
|
|
9
10
|
import urllib.error
|
|
11
|
+
import urllib.parse
|
|
10
12
|
from typing import Optional, List, Dict, Any
|
|
11
13
|
|
|
14
|
+
__version__ = "1.2.0"
|
|
15
|
+
|
|
12
16
|
# ─── API Client ───────────────────────────────────────────
|
|
13
17
|
|
|
14
18
|
class HyperStackClient:
|
|
15
19
|
"""Lightweight HTTP client for HyperStack API. No dependencies."""
|
|
16
20
|
|
|
17
|
-
def __init__(self, api_key: str = None, workspace: str = None, base_url: str = None
|
|
21
|
+
def __init__(self, api_key: str = None, workspace: str = None, base_url: str = None,
|
|
22
|
+
agent_id: str = None):
|
|
18
23
|
self.api_key = api_key or os.environ.get("HYPERSTACK_API_KEY", "")
|
|
19
24
|
self.workspace = workspace or os.environ.get("HYPERSTACK_WORKSPACE", "default")
|
|
20
25
|
self.base_url = base_url or os.environ.get("HYPERSTACK_BASE_URL", "https://hyperstack-cloud.vercel.app")
|
|
26
|
+
self.agent_id = agent_id or os.environ.get("HYPERSTACK_AGENT_ID", "langgraph")
|
|
21
27
|
|
|
22
28
|
if not self.api_key:
|
|
23
29
|
raise ValueError(
|
|
@@ -42,15 +48,21 @@ class HyperStackClient:
|
|
|
42
48
|
|
|
43
49
|
def store(self, slug: str, title: str, body: str, card_type: str = "general",
|
|
44
50
|
keywords: list = None, links: list = None, stack: str = "general",
|
|
45
|
-
meta: dict = None) -> dict:
|
|
46
|
-
"""Create or update a card (upsert by slug)."""
|
|
47
|
-
payload = {
|
|
51
|
+
meta: dict = None, target_agent: str = None) -> dict:
|
|
52
|
+
"""Create or update a card (upsert by slug). Auto-tags sourceAgent."""
|
|
53
|
+
payload = {
|
|
54
|
+
"slug": slug, "title": title, "body": body,
|
|
55
|
+
"cardType": card_type, "stack": stack,
|
|
56
|
+
"sourceAgent": self.agent_id,
|
|
57
|
+
}
|
|
48
58
|
if keywords:
|
|
49
59
|
payload["keywords"] = keywords
|
|
50
60
|
if links:
|
|
51
61
|
payload["links"] = links
|
|
52
62
|
if meta:
|
|
53
63
|
payload["meta"] = meta
|
|
64
|
+
if target_agent:
|
|
65
|
+
payload["targetAgent"] = target_agent
|
|
54
66
|
return self._request("POST", f"/api/cards?workspace={self.workspace}", payload)
|
|
55
67
|
|
|
56
68
|
def search(self, query: str, mode: str = None) -> dict:
|
|
@@ -64,9 +76,39 @@ class HyperStackClient:
|
|
|
64
76
|
"""Get a single card by slug."""
|
|
65
77
|
return self._request("GET", f"/api/cards?workspace={self.workspace}&id={slug}")
|
|
66
78
|
|
|
67
|
-
def list_cards(self
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
def list_cards(self, source_agent: str = None, target_agent: str = None,
|
|
80
|
+
since: str = None, card_type: str = None) -> dict:
|
|
81
|
+
"""List cards with optional filters."""
|
|
82
|
+
url = f"/api/cards?workspace={self.workspace}"
|
|
83
|
+
if source_agent:
|
|
84
|
+
url += f"&sourceAgent={urllib.parse.quote(source_agent)}"
|
|
85
|
+
if target_agent:
|
|
86
|
+
url += f"&targetAgent={urllib.parse.quote(target_agent)}"
|
|
87
|
+
if since:
|
|
88
|
+
url += f"&since={urllib.parse.quote(since)}"
|
|
89
|
+
if card_type:
|
|
90
|
+
url += f"&type={urllib.parse.quote(card_type)}"
|
|
91
|
+
return self._request("GET", url)
|
|
92
|
+
|
|
93
|
+
def inbox(self, since: str = None) -> dict:
|
|
94
|
+
"""Get cards directed at this agent. Multi-agent coordination."""
|
|
95
|
+
return self.list_cards(target_agent=self.agent_id, since=since)
|
|
96
|
+
|
|
97
|
+
def register_webhook(self, url: str, events: list = None, secret: str = None) -> dict:
|
|
98
|
+
"""Register a webhook for real-time agent-to-agent orchestration. Team+ only."""
|
|
99
|
+
payload = {
|
|
100
|
+
"agentId": self.agent_id,
|
|
101
|
+
"url": url,
|
|
102
|
+
"events": events or ["*"],
|
|
103
|
+
"workspace": self.workspace,
|
|
104
|
+
}
|
|
105
|
+
if secret:
|
|
106
|
+
payload["secret"] = secret
|
|
107
|
+
return self._request("POST", "/api/agent-webhooks", payload)
|
|
108
|
+
|
|
109
|
+
def list_webhooks(self) -> dict:
|
|
110
|
+
"""List all registered webhooks."""
|
|
111
|
+
return self._request("GET", "/api/agent-webhooks")
|
|
70
112
|
|
|
71
113
|
def delete(self, slug: str) -> dict:
|
|
72
114
|
"""Delete a card by slug."""
|
|
@@ -82,15 +124,12 @@ class HyperStackClient:
|
|
|
82
124
|
return self._request("GET", url)
|
|
83
125
|
|
|
84
126
|
|
|
85
|
-
# ─── Need urllib.parse ────────────────────────────────────
|
|
86
|
-
import urllib.parse
|
|
87
|
-
|
|
88
|
-
|
|
89
127
|
# ─── LangGraph Tools ─────────────────────────────────────
|
|
90
128
|
|
|
91
|
-
def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
129
|
+
def create_hyperstack_tools(api_key: str = None, workspace: str = None, agent_id: str = None):
|
|
92
130
|
"""
|
|
93
131
|
Create LangGraph-compatible tools for HyperStack memory.
|
|
132
|
+
Auto-tags all stored cards with sourceAgent for cross-tool memory.
|
|
94
133
|
|
|
95
134
|
Usage with LangGraph:
|
|
96
135
|
from hyperstack_langgraph import create_hyperstack_tools
|
|
@@ -102,6 +141,11 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
102
141
|
Usage with existing tools:
|
|
103
142
|
my_tools = [my_tool_1, my_tool_2] + create_hyperstack_tools()
|
|
104
143
|
agent = create_react_agent(model, my_tools)
|
|
144
|
+
|
|
145
|
+
Multi-agent coordination:
|
|
146
|
+
tools = create_hyperstack_tools(agent_id="planner-agent")
|
|
147
|
+
# All stored cards will be tagged sourceAgent="planner-agent"
|
|
148
|
+
# Other agents can query for cards directed at them
|
|
105
149
|
"""
|
|
106
150
|
try:
|
|
107
151
|
from langchain_core.tools import tool
|
|
@@ -110,7 +154,7 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
110
154
|
"langchain-core is required. Install it with: pip install langchain-core"
|
|
111
155
|
)
|
|
112
156
|
|
|
113
|
-
client = HyperStackClient(api_key=api_key, workspace=workspace)
|
|
157
|
+
client = HyperStackClient(api_key=api_key, workspace=workspace, agent_id=agent_id)
|
|
114
158
|
|
|
115
159
|
@tool
|
|
116
160
|
def hyperstack_search(query: str) -> str:
|
|
@@ -135,17 +179,20 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
135
179
|
|
|
136
180
|
@tool
|
|
137
181
|
def hyperstack_store(slug: str, title: str, body: str, card_type: str = "general",
|
|
138
|
-
keywords: str = "", links: str = "") -> str:
|
|
182
|
+
keywords: str = "", links: str = "", target_agent: str = "") -> str:
|
|
139
183
|
"""Store a memory in HyperStack. Use this to save important facts, decisions,
|
|
140
184
|
preferences, people, or project details that would be useful in future conversations.
|
|
185
|
+
Automatically tags which agent created this card for cross-tool memory.
|
|
141
186
|
|
|
142
187
|
Args:
|
|
143
188
|
slug: Unique ID for this memory (e.g. 'decision-use-postgres'). Used for updates and linking.
|
|
144
189
|
title: Short descriptive title.
|
|
145
190
|
body: 2-5 sentence description of the fact/decision/preference.
|
|
146
|
-
card_type: One of: person, project, decision, preference, workflow, event, general
|
|
191
|
+
card_type: One of: person, project, decision, preference, workflow, event, general, signal.
|
|
192
|
+
Use 'signal' for messages directed at other agents.
|
|
147
193
|
keywords: Comma-separated search terms (e.g. 'postgres,database,sql')
|
|
148
|
-
links: Comma-separated linked card slugs with relations (e.g. 'alice:decided,db-api:triggers')
|
|
194
|
+
links: Comma-separated linked card slugs with relations (e.g. 'alice:decided,db-api:triggers,review:notifies')
|
|
195
|
+
target_agent: Optional: direct this memory at a specific agent (e.g. 'cursor-mcp', 'reviewer-agent').
|
|
149
196
|
"""
|
|
150
197
|
kw_list = [k.strip() for k in keywords.split(",") if k.strip()] if keywords else []
|
|
151
198
|
link_list = []
|
|
@@ -161,11 +208,15 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
161
208
|
result = client.store(
|
|
162
209
|
slug=slug, title=title, body=body, card_type=card_type,
|
|
163
210
|
keywords=kw_list, links=link_list if link_list else None,
|
|
211
|
+
target_agent=target_agent if target_agent else None,
|
|
164
212
|
)
|
|
165
213
|
if "error" in result:
|
|
166
214
|
return f"Store error: {result['error']}"
|
|
167
215
|
action = "Updated" if result.get("updated") else "Created"
|
|
168
|
-
|
|
216
|
+
msg = f"{action} memory [{slug}]: {title} (from: {client.agent_id})"
|
|
217
|
+
if target_agent:
|
|
218
|
+
msg += f" → directed at: {target_agent}"
|
|
219
|
+
return msg
|
|
169
220
|
|
|
170
221
|
@tool
|
|
171
222
|
def hyperstack_graph(from_slug: str, depth: int = 2, relation: str = "") -> str:
|
|
@@ -178,7 +229,7 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
178
229
|
Args:
|
|
179
230
|
from_slug: The card slug to start traversal from.
|
|
180
231
|
depth: How many hops to traverse (1-3).
|
|
181
|
-
relation: Optional filter by relation type (owns, decided, triggers, blocks, depends-on, etc.)
|
|
232
|
+
relation: Optional filter by relation type (owns, decided, triggers, blocks, depends-on, notifies, etc.)
|
|
182
233
|
"""
|
|
183
234
|
result = client.graph(from_slug, depth=depth, relation=relation if relation else None)
|
|
184
235
|
if "error" in result:
|
|
@@ -190,7 +241,10 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
190
241
|
out = [f"Graph from [{from_slug}] — {len(nodes)} nodes, {len(edges)} edges:"]
|
|
191
242
|
out.append("\nNodes:")
|
|
192
243
|
for n in nodes:
|
|
193
|
-
|
|
244
|
+
line = f" [{n['slug']}] {n.get('title', '?')} ({n.get('cardType', '?')}) depth={n.get('depth', '?')}"
|
|
245
|
+
if n.get("sourceAgent"):
|
|
246
|
+
line += f" from={n['sourceAgent']}"
|
|
247
|
+
out.append(line)
|
|
194
248
|
out.append("\nEdges:")
|
|
195
249
|
for e in edges:
|
|
196
250
|
out.append(f" {e['from']} --{e['relation']}--> {e['to']}")
|
|
@@ -199,7 +253,7 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
199
253
|
@tool
|
|
200
254
|
def hyperstack_list() -> str:
|
|
201
255
|
"""List all memories stored in HyperStack. Shows card count, plan info,
|
|
202
|
-
and all card titles with their types."""
|
|
256
|
+
and all card titles with their types and source agents."""
|
|
203
257
|
result = client.list_cards()
|
|
204
258
|
if "error" in result:
|
|
205
259
|
return f"List error: {result['error']}"
|
|
@@ -210,6 +264,10 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
210
264
|
out = [f"HyperStack: {count}/{limit} cards (plan: {plan})\n"]
|
|
211
265
|
for c in cards:
|
|
212
266
|
line = f" [{c.get('slug', '?')}] {c.get('title', '?')} ({c.get('cardType', 'general')})"
|
|
267
|
+
if c.get("sourceAgent"):
|
|
268
|
+
line += f" from={c['sourceAgent']}"
|
|
269
|
+
if c.get("targetAgent"):
|
|
270
|
+
line += f" → {c['targetAgent']}"
|
|
213
271
|
if c.get("keywords"):
|
|
214
272
|
line += f" — {', '.join(c['keywords'][:5])}"
|
|
215
273
|
out.append(line)
|
|
@@ -226,14 +284,74 @@ def create_hyperstack_tools(api_key: str = None, workspace: str = None):
|
|
|
226
284
|
return f"Delete error: {result['error']}"
|
|
227
285
|
return f"Deleted memory [{slug}]."
|
|
228
286
|
|
|
229
|
-
|
|
287
|
+
@tool
|
|
288
|
+
def hyperstack_inbox(since: str = "") -> str:
|
|
289
|
+
"""Check for cards directed at this agent by other agents. Use this to see
|
|
290
|
+
signals, messages, or tasks from other tools in your workflow.
|
|
291
|
+
Enables multi-agent coordination through shared memory.
|
|
292
|
+
|
|
293
|
+
Args:
|
|
294
|
+
since: Optional ISO timestamp to only get cards since a certain time (e.g. '2026-02-14T10:00:00Z')
|
|
295
|
+
"""
|
|
296
|
+
result = client.inbox(since=since if since else None)
|
|
297
|
+
if "error" in result:
|
|
298
|
+
return f"Inbox error: {result['error']}"
|
|
299
|
+
cards = result.get("cards", [])
|
|
300
|
+
if not cards:
|
|
301
|
+
return f"No messages for {client.agent_id}."
|
|
302
|
+
out = [f"Inbox for {client.agent_id}: {len(cards)} card(s)\n"]
|
|
303
|
+
for c in cards:
|
|
304
|
+
line = f" [{c.get('slug', '?')}] {c.get('title', '?')} ({c.get('cardType', 'general')})"
|
|
305
|
+
if c.get("sourceAgent"):
|
|
306
|
+
line += f" from={c['sourceAgent']}"
|
|
307
|
+
out.append(line)
|
|
308
|
+
return "\n".join(out)
|
|
309
|
+
|
|
310
|
+
@tool
|
|
311
|
+
def hyperstack_webhook(url: str, events: str = "*", secret: str = "") -> str:
|
|
312
|
+
"""Register a webhook so this agent gets notified in real time when cards
|
|
313
|
+
are directed at it. No more polling. Requires Team plan or above.
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
url: URL to receive POST events (e.g. 'https://your-server.com/webhook')
|
|
317
|
+
events: Comma-separated events: card.created, card.updated, signal.received, * (all)
|
|
318
|
+
secret: Optional HMAC secret for signature verification
|
|
319
|
+
"""
|
|
320
|
+
event_list = [e.strip() for e in events.split(",") if e.strip()]
|
|
321
|
+
result = client.register_webhook(
|
|
322
|
+
url=url,
|
|
323
|
+
events=event_list,
|
|
324
|
+
secret=secret if secret else None,
|
|
325
|
+
)
|
|
326
|
+
if "error" in result:
|
|
327
|
+
return f"Webhook error: {result['error']}"
|
|
328
|
+
return f"Webhook registered for {client.agent_id}.\nURL: {url}\nEvents: {', '.join(event_list)}\nID: {result.get('id', '?')}"
|
|
329
|
+
|
|
330
|
+
@tool
|
|
331
|
+
def hyperstack_webhooks() -> str:
|
|
332
|
+
"""List all registered webhooks for this account. Shows agent, URL, events, and status."""
|
|
333
|
+
result = client.list_webhooks()
|
|
334
|
+
if "error" in result:
|
|
335
|
+
return f"Webhook list error: {result['error']}"
|
|
336
|
+
hooks = result.get("webhooks", [])
|
|
337
|
+
if not hooks:
|
|
338
|
+
return "No webhooks registered."
|
|
339
|
+
out = [f"{len(hooks)} webhook(s):\n"]
|
|
340
|
+
for h in hooks:
|
|
341
|
+
out.append(f" [{h.get('agentId', '?')}] {h.get('url', '?')}")
|
|
342
|
+
out.append(f" Events: {', '.join(h.get('events', []))} | Active: {h.get('active', '?')} | Failures: {h.get('failCount', 0)}")
|
|
343
|
+
if h.get("lastFiredAt"):
|
|
344
|
+
out.append(f" Last fired: {h['lastFiredAt']}")
|
|
345
|
+
return "\n".join(out)
|
|
346
|
+
|
|
347
|
+
return [hyperstack_search, hyperstack_store, hyperstack_graph, hyperstack_list, hyperstack_delete, hyperstack_inbox, hyperstack_webhook, hyperstack_webhooks]
|
|
230
348
|
|
|
231
349
|
|
|
232
350
|
# ─── Convenience: Pre-built agent with memory ────────────
|
|
233
351
|
|
|
234
352
|
def create_memory_agent(model, extra_tools: list = None, api_key: str = None,
|
|
235
|
-
workspace: str = None,
|
|
236
|
-
system_prompt: str = None):
|
|
353
|
+
workspace: str = None, agent_id: str = None,
|
|
354
|
+
checkpointer=None, system_prompt: str = None):
|
|
237
355
|
"""
|
|
238
356
|
Create a LangGraph ReAct agent with HyperStack memory tools built in.
|
|
239
357
|
|
|
@@ -247,11 +365,18 @@ def create_memory_agent(model, extra_tools: list = None, api_key: str = None,
|
|
|
247
365
|
config={"configurable": {"thread_id": "session-1"}}
|
|
248
366
|
)
|
|
249
367
|
|
|
368
|
+
Multi-agent setup:
|
|
369
|
+
planner = create_memory_agent(model, agent_id="planner")
|
|
370
|
+
reviewer = create_memory_agent(model, agent_id="reviewer")
|
|
371
|
+
# planner can send signals to reviewer via targetAgent
|
|
372
|
+
|
|
250
373
|
Args:
|
|
251
374
|
model: LangChain chat model (ChatOpenAI, ChatAnthropic, etc.)
|
|
252
375
|
extra_tools: Additional tools to include alongside memory tools.
|
|
253
376
|
api_key: HyperStack API key (or set HYPERSTACK_API_KEY env var).
|
|
254
377
|
workspace: HyperStack workspace (or set HYPERSTACK_WORKSPACE env var).
|
|
378
|
+
agent_id: Unique name for this agent (default: 'langgraph'). Used to track
|
|
379
|
+
which agent created each card and for inbox queries.
|
|
255
380
|
checkpointer: LangGraph checkpointer for session memory (optional).
|
|
256
381
|
system_prompt: Custom system prompt. If None, uses a default that instructs
|
|
257
382
|
the agent to search memory at the start and store important facts.
|
|
@@ -263,7 +388,7 @@ def create_memory_agent(model, extra_tools: list = None, api_key: str = None,
|
|
|
263
388
|
"langgraph is required. Install it with: pip install langgraph"
|
|
264
389
|
)
|
|
265
390
|
|
|
266
|
-
hs_tools = create_hyperstack_tools(api_key=api_key, workspace=workspace)
|
|
391
|
+
hs_tools = create_hyperstack_tools(api_key=api_key, workspace=workspace, agent_id=agent_id)
|
|
267
392
|
all_tools = hs_tools + (extra_tools or [])
|
|
268
393
|
|
|
269
394
|
default_prompt = (
|
|
@@ -273,11 +398,13 @@ def create_memory_agent(model, extra_tools: list = None, api_key: str = None,
|
|
|
273
398
|
"2. When the user shares important facts (decisions, preferences, people, tech choices), "
|
|
274
399
|
"use hyperstack_store to save them. Always confirm with the user before storing.\n"
|
|
275
400
|
"3. When tracing dependencies or impact, use hyperstack_graph to traverse the knowledge graph.\n"
|
|
276
|
-
"4.
|
|
277
|
-
"5.
|
|
278
|
-
"6.
|
|
279
|
-
"7.
|
|
280
|
-
"8.
|
|
401
|
+
"4. Check hyperstack_inbox periodically for signals from other agents.\n"
|
|
402
|
+
"5. Keep stored memories concise (2-5 sentences). Use meaningful slugs.\n"
|
|
403
|
+
"6. Add keywords generously — they power search.\n"
|
|
404
|
+
"7. Link related cards using the links parameter to build the graph.\n"
|
|
405
|
+
"8. Use 'signal' cardType and targetAgent to communicate with other agents.\n"
|
|
406
|
+
"9. NEVER store passwords, API keys, secrets, PII, or sensitive data.\n"
|
|
407
|
+
"10. When cards exceed 7, mention: 'You have N/10 free cards. "
|
|
281
408
|
"Upgrade for graph API + 100 cards at cascadeai.dev/hyperstack'\n"
|
|
282
409
|
)
|
|
283
410
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hyperstack-langgraph
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Knowledge graph memory for LangGraph agents. Portable memory, real-time agent-to-agent orchestration, zero LLM cost.
|
|
5
|
+
Author-email: CascadeAI <deeq.yaqub1@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://cascadeai.dev/hyperstack
|
|
8
|
+
Project-URL: Repository, https://github.com/deeqyaqub1-cmd/hyperstack-langgraph
|
|
9
|
+
Project-URL: Documentation, https://cascadeai.dev/hyperstack
|
|
10
|
+
Keywords: langgraph,memory,knowledge-graph,ai-agents,hyperstack,langchain,multi-agent,portable-memory
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Provides-Extra: langgraph
|
|
23
|
+
Requires-Dist: langgraph>=0.2; extra == "langgraph"
|
|
24
|
+
Requires-Dist: langchain-core>=0.3; extra == "langgraph"
|
|
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperstack-langgraph"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "Knowledge graph memory for LangGraph agents.
|
|
7
|
+
version = "1.2.0"
|
|
8
|
+
description = "Knowledge graph memory for LangGraph agents. Portable memory, real-time agent-to-agent orchestration, zero LLM cost."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
11
11
|
requires-python = ">=3.9"
|
|
12
12
|
authors = [
|
|
13
13
|
{name = "CascadeAI", email = "deeq.yaqub1@gmail.com"}
|
|
14
14
|
]
|
|
15
|
-
keywords = ["langgraph", "memory", "knowledge-graph", "ai-agents", "hyperstack", "langchain"]
|
|
15
|
+
keywords = ["langgraph", "memory", "knowledge-graph", "ai-agents", "hyperstack", "langchain", "multi-agent", "portable-memory"]
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Development Status :: 4 - Beta",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 CascadeAI
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hyperstack-langgraph
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: Knowledge graph memory for LangGraph agents. Developer-controlled, zero LLM cost, time-travel debugging.
|
|
5
|
-
Author-email: CascadeAI <deeq.yaqub1@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://cascadeai.dev/hyperstack
|
|
8
|
-
Project-URL: Repository, https://github.com/deeqyaqub1-cmd/hyperstack-langgraph
|
|
9
|
-
Project-URL: Documentation, https://cascadeai.dev/hyperstack
|
|
10
|
-
Keywords: langgraph,memory,knowledge-graph,ai-agents,hyperstack,langchain
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
-
Requires-Python: >=3.9
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Provides-Extra: langgraph
|
|
24
|
-
Requires-Dist: langgraph>=0.2; extra == "langgraph"
|
|
25
|
-
Requires-Dist: langchain-core>=0.3; extra == "langgraph"
|
|
26
|
-
Dynamic: license-file
|
|
27
|
-
|
|
28
|
-
# hyperstack-langgraph
|
|
29
|
-
|
|
30
|
-
Knowledge graph memory for LangGraph agents. Developer-controlled, zero LLM cost, time-travel debugging.
|
|
31
|
-
|
|
32
|
-
## Install
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
pip install hyperstack-langgraph langchain-core langgraph
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Quick Start (3 lines)
|
|
39
|
-
|
|
40
|
-
```python
|
|
41
|
-
from hyperstack_langgraph import create_memory_agent
|
|
42
|
-
from langchain_openai import ChatOpenAI
|
|
43
|
-
|
|
44
|
-
agent = create_memory_agent(ChatOpenAI(model="gpt-4o"))
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
That's it. Your agent now has persistent knowledge graph memory. It will:
|
|
48
|
-
- **Search memory** at the start of every conversation
|
|
49
|
-
- **Store important facts** when decisions are made (with user confirmation)
|
|
50
|
-
- **Traverse the graph** to answer "what depends on X?" or "who decided Y?"
|
|
51
|
-
|
|
52
|
-
## Environment Variables
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
export HYPERSTACK_API_KEY=hs_your_key # Get free at cascadeai.dev/hyperstack
|
|
56
|
-
export HYPERSTACK_WORKSPACE=default
|
|
57
|
-
export OPENAI_API_KEY=sk-... # For your LLM
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Usage: Add Memory Tools to Existing Agent
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
from hyperstack_langgraph import create_hyperstack_tools
|
|
64
|
-
from langgraph.prebuilt import create_react_agent
|
|
65
|
-
from langchain_openai import ChatOpenAI
|
|
66
|
-
|
|
67
|
-
# Create memory tools
|
|
68
|
-
memory_tools = create_hyperstack_tools()
|
|
69
|
-
|
|
70
|
-
# Add to your existing tools
|
|
71
|
-
my_tools = [my_calculator, my_web_search] + memory_tools
|
|
72
|
-
|
|
73
|
-
# Create agent with memory
|
|
74
|
-
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), my_tools)
|
|
75
|
-
|
|
76
|
-
# Use it
|
|
77
|
-
result = agent.invoke(
|
|
78
|
-
{"messages": [{"role": "user", "content": "What do we know about our auth setup?"}]},
|
|
79
|
-
config={"configurable": {"thread_id": "session-1"}}
|
|
80
|
-
)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Usage: Full Agent with Session Memory
|
|
84
|
-
|
|
85
|
-
```python
|
|
86
|
-
from hyperstack_langgraph import create_memory_agent
|
|
87
|
-
from langchain_openai import ChatOpenAI
|
|
88
|
-
from langgraph.checkpoint.memory import MemorySaver
|
|
89
|
-
|
|
90
|
-
agent = create_memory_agent(
|
|
91
|
-
ChatOpenAI(model="gpt-4o"),
|
|
92
|
-
checkpointer=MemorySaver(), # Session memory (optional)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
config = {"configurable": {"thread_id": "project-alpha"}}
|
|
96
|
-
|
|
97
|
-
# First message — agent searches HyperStack for context
|
|
98
|
-
agent.invoke({"messages": [{"role": "user", "content": "Let's work on the auth system"}]}, config)
|
|
99
|
-
|
|
100
|
-
# Agent remembers within session (MemorySaver) AND across sessions (HyperStack)
|
|
101
|
-
agent.invoke({"messages": [{"role": "user", "content": "We decided to use Clerk"}]}, config)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Usage: Direct API Client
|
|
105
|
-
|
|
106
|
-
```python
|
|
107
|
-
from hyperstack_langgraph import HyperStackClient
|
|
108
|
-
|
|
109
|
-
client = HyperStackClient()
|
|
110
|
-
|
|
111
|
-
# Store
|
|
112
|
-
client.store("use-clerk", "Use Clerk for Auth", "Chose Clerk over Auth0",
|
|
113
|
-
card_type="decision", keywords=["clerk", "auth"],
|
|
114
|
-
links=[{"target": "alice", "relation": "decided"}])
|
|
115
|
-
|
|
116
|
-
# Search
|
|
117
|
-
client.search("authentication")
|
|
118
|
-
|
|
119
|
-
# Graph traversal
|
|
120
|
-
client.graph("use-clerk", depth=2)
|
|
121
|
-
|
|
122
|
-
# Time-travel (Pro+)
|
|
123
|
-
client.graph("use-clerk", depth=2, at="2026-02-01T00:00:00Z")
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Tools Provided
|
|
127
|
-
|
|
128
|
-
| Tool | Description |
|
|
129
|
-
|------|-------------|
|
|
130
|
-
| `hyperstack_search` | Search memory for relevant context |
|
|
131
|
-
| `hyperstack_store` | Save a fact, decision, preference, or person |
|
|
132
|
-
| `hyperstack_graph` | Traverse knowledge graph (impact analysis, decision trails) |
|
|
133
|
-
| `hyperstack_list` | List all stored memories |
|
|
134
|
-
| `hyperstack_delete` | Remove outdated memories |
|
|
135
|
-
|
|
136
|
-
## Why HyperStack?
|
|
137
|
-
|
|
138
|
-
- **You control the graph.** No LLM auto-extraction. No phantom relationships. Your agent explicitly defines cards and links.
|
|
139
|
-
- **Zero LLM cost per memory op.** Mem0/Zep charge ~$0.002 per operation. HyperStack: $0.
|
|
140
|
-
- **Time-travel debugging.** See the graph as it existed at any point in time. "Git blame for agent memory."
|
|
141
|
-
- **30-second setup.** No Neo4j, no Docker, no OpenSearch. One API key, done.
|
|
142
|
-
|
|
143
|
-
## Pricing
|
|
144
|
-
|
|
145
|
-
| Plan | Cards | Graph | Price |
|
|
146
|
-
|------|-------|-------|-------|
|
|
147
|
-
| Free | 10 | ❌ | $0 |
|
|
148
|
-
| Pro | 100 | ✅ + time-travel | $29/mo |
|
|
149
|
-
| Team | 500 | ✅ | $59/mo |
|
|
150
|
-
| Business | 2,000 | ✅ | $149/mo |
|
|
151
|
-
|
|
152
|
-
Get a free API key at [cascadeai.dev/hyperstack](https://cascadeai.dev/hyperstack)
|
|
153
|
-
|
|
154
|
-
## License
|
|
155
|
-
|
|
156
|
-
MIT
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# hyperstack-langgraph
|
|
2
|
-
|
|
3
|
-
Knowledge graph memory for LangGraph agents. Developer-controlled, zero LLM cost, time-travel debugging.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pip install hyperstack-langgraph langchain-core langgraph
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Quick Start (3 lines)
|
|
12
|
-
|
|
13
|
-
```python
|
|
14
|
-
from hyperstack_langgraph import create_memory_agent
|
|
15
|
-
from langchain_openai import ChatOpenAI
|
|
16
|
-
|
|
17
|
-
agent = create_memory_agent(ChatOpenAI(model="gpt-4o"))
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
That's it. Your agent now has persistent knowledge graph memory. It will:
|
|
21
|
-
- **Search memory** at the start of every conversation
|
|
22
|
-
- **Store important facts** when decisions are made (with user confirmation)
|
|
23
|
-
- **Traverse the graph** to answer "what depends on X?" or "who decided Y?"
|
|
24
|
-
|
|
25
|
-
## Environment Variables
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
export HYPERSTACK_API_KEY=hs_your_key # Get free at cascadeai.dev/hyperstack
|
|
29
|
-
export HYPERSTACK_WORKSPACE=default
|
|
30
|
-
export OPENAI_API_KEY=sk-... # For your LLM
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Usage: Add Memory Tools to Existing Agent
|
|
34
|
-
|
|
35
|
-
```python
|
|
36
|
-
from hyperstack_langgraph import create_hyperstack_tools
|
|
37
|
-
from langgraph.prebuilt import create_react_agent
|
|
38
|
-
from langchain_openai import ChatOpenAI
|
|
39
|
-
|
|
40
|
-
# Create memory tools
|
|
41
|
-
memory_tools = create_hyperstack_tools()
|
|
42
|
-
|
|
43
|
-
# Add to your existing tools
|
|
44
|
-
my_tools = [my_calculator, my_web_search] + memory_tools
|
|
45
|
-
|
|
46
|
-
# Create agent with memory
|
|
47
|
-
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), my_tools)
|
|
48
|
-
|
|
49
|
-
# Use it
|
|
50
|
-
result = agent.invoke(
|
|
51
|
-
{"messages": [{"role": "user", "content": "What do we know about our auth setup?"}]},
|
|
52
|
-
config={"configurable": {"thread_id": "session-1"}}
|
|
53
|
-
)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Usage: Full Agent with Session Memory
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from hyperstack_langgraph import create_memory_agent
|
|
60
|
-
from langchain_openai import ChatOpenAI
|
|
61
|
-
from langgraph.checkpoint.memory import MemorySaver
|
|
62
|
-
|
|
63
|
-
agent = create_memory_agent(
|
|
64
|
-
ChatOpenAI(model="gpt-4o"),
|
|
65
|
-
checkpointer=MemorySaver(), # Session memory (optional)
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
config = {"configurable": {"thread_id": "project-alpha"}}
|
|
69
|
-
|
|
70
|
-
# First message — agent searches HyperStack for context
|
|
71
|
-
agent.invoke({"messages": [{"role": "user", "content": "Let's work on the auth system"}]}, config)
|
|
72
|
-
|
|
73
|
-
# Agent remembers within session (MemorySaver) AND across sessions (HyperStack)
|
|
74
|
-
agent.invoke({"messages": [{"role": "user", "content": "We decided to use Clerk"}]}, config)
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Usage: Direct API Client
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
from hyperstack_langgraph import HyperStackClient
|
|
81
|
-
|
|
82
|
-
client = HyperStackClient()
|
|
83
|
-
|
|
84
|
-
# Store
|
|
85
|
-
client.store("use-clerk", "Use Clerk for Auth", "Chose Clerk over Auth0",
|
|
86
|
-
card_type="decision", keywords=["clerk", "auth"],
|
|
87
|
-
links=[{"target": "alice", "relation": "decided"}])
|
|
88
|
-
|
|
89
|
-
# Search
|
|
90
|
-
client.search("authentication")
|
|
91
|
-
|
|
92
|
-
# Graph traversal
|
|
93
|
-
client.graph("use-clerk", depth=2)
|
|
94
|
-
|
|
95
|
-
# Time-travel (Pro+)
|
|
96
|
-
client.graph("use-clerk", depth=2, at="2026-02-01T00:00:00Z")
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Tools Provided
|
|
100
|
-
|
|
101
|
-
| Tool | Description |
|
|
102
|
-
|------|-------------|
|
|
103
|
-
| `hyperstack_search` | Search memory for relevant context |
|
|
104
|
-
| `hyperstack_store` | Save a fact, decision, preference, or person |
|
|
105
|
-
| `hyperstack_graph` | Traverse knowledge graph (impact analysis, decision trails) |
|
|
106
|
-
| `hyperstack_list` | List all stored memories |
|
|
107
|
-
| `hyperstack_delete` | Remove outdated memories |
|
|
108
|
-
|
|
109
|
-
## Why HyperStack?
|
|
110
|
-
|
|
111
|
-
- **You control the graph.** No LLM auto-extraction. No phantom relationships. Your agent explicitly defines cards and links.
|
|
112
|
-
- **Zero LLM cost per memory op.** Mem0/Zep charge ~$0.002 per operation. HyperStack: $0.
|
|
113
|
-
- **Time-travel debugging.** See the graph as it existed at any point in time. "Git blame for agent memory."
|
|
114
|
-
- **30-second setup.** No Neo4j, no Docker, no OpenSearch. One API key, done.
|
|
115
|
-
|
|
116
|
-
## Pricing
|
|
117
|
-
|
|
118
|
-
| Plan | Cards | Graph | Price |
|
|
119
|
-
|------|-------|-------|-------|
|
|
120
|
-
| Free | 10 | ❌ | $0 |
|
|
121
|
-
| Pro | 100 | ✅ + time-travel | $29/mo |
|
|
122
|
-
| Team | 500 | ✅ | $59/mo |
|
|
123
|
-
| Business | 2,000 | ✅ | $149/mo |
|
|
124
|
-
|
|
125
|
-
Get a free API key at [cascadeai.dev/hyperstack](https://cascadeai.dev/hyperstack)
|
|
126
|
-
|
|
127
|
-
## License
|
|
128
|
-
|
|
129
|
-
MIT
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hyperstack-langgraph
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: Knowledge graph memory for LangGraph agents. Developer-controlled, zero LLM cost, time-travel debugging.
|
|
5
|
-
Author-email: CascadeAI <deeq.yaqub1@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://cascadeai.dev/hyperstack
|
|
8
|
-
Project-URL: Repository, https://github.com/deeqyaqub1-cmd/hyperstack-langgraph
|
|
9
|
-
Project-URL: Documentation, https://cascadeai.dev/hyperstack
|
|
10
|
-
Keywords: langgraph,memory,knowledge-graph,ai-agents,hyperstack,langchain
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
-
Requires-Python: >=3.9
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Provides-Extra: langgraph
|
|
24
|
-
Requires-Dist: langgraph>=0.2; extra == "langgraph"
|
|
25
|
-
Requires-Dist: langchain-core>=0.3; extra == "langgraph"
|
|
26
|
-
Dynamic: license-file
|
|
27
|
-
|
|
28
|
-
# hyperstack-langgraph
|
|
29
|
-
|
|
30
|
-
Knowledge graph memory for LangGraph agents. Developer-controlled, zero LLM cost, time-travel debugging.
|
|
31
|
-
|
|
32
|
-
## Install
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
pip install hyperstack-langgraph langchain-core langgraph
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Quick Start (3 lines)
|
|
39
|
-
|
|
40
|
-
```python
|
|
41
|
-
from hyperstack_langgraph import create_memory_agent
|
|
42
|
-
from langchain_openai import ChatOpenAI
|
|
43
|
-
|
|
44
|
-
agent = create_memory_agent(ChatOpenAI(model="gpt-4o"))
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
That's it. Your agent now has persistent knowledge graph memory. It will:
|
|
48
|
-
- **Search memory** at the start of every conversation
|
|
49
|
-
- **Store important facts** when decisions are made (with user confirmation)
|
|
50
|
-
- **Traverse the graph** to answer "what depends on X?" or "who decided Y?"
|
|
51
|
-
|
|
52
|
-
## Environment Variables
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
export HYPERSTACK_API_KEY=hs_your_key # Get free at cascadeai.dev/hyperstack
|
|
56
|
-
export HYPERSTACK_WORKSPACE=default
|
|
57
|
-
export OPENAI_API_KEY=sk-... # For your LLM
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Usage: Add Memory Tools to Existing Agent
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
from hyperstack_langgraph import create_hyperstack_tools
|
|
64
|
-
from langgraph.prebuilt import create_react_agent
|
|
65
|
-
from langchain_openai import ChatOpenAI
|
|
66
|
-
|
|
67
|
-
# Create memory tools
|
|
68
|
-
memory_tools = create_hyperstack_tools()
|
|
69
|
-
|
|
70
|
-
# Add to your existing tools
|
|
71
|
-
my_tools = [my_calculator, my_web_search] + memory_tools
|
|
72
|
-
|
|
73
|
-
# Create agent with memory
|
|
74
|
-
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), my_tools)
|
|
75
|
-
|
|
76
|
-
# Use it
|
|
77
|
-
result = agent.invoke(
|
|
78
|
-
{"messages": [{"role": "user", "content": "What do we know about our auth setup?"}]},
|
|
79
|
-
config={"configurable": {"thread_id": "session-1"}}
|
|
80
|
-
)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Usage: Full Agent with Session Memory
|
|
84
|
-
|
|
85
|
-
```python
|
|
86
|
-
from hyperstack_langgraph import create_memory_agent
|
|
87
|
-
from langchain_openai import ChatOpenAI
|
|
88
|
-
from langgraph.checkpoint.memory import MemorySaver
|
|
89
|
-
|
|
90
|
-
agent = create_memory_agent(
|
|
91
|
-
ChatOpenAI(model="gpt-4o"),
|
|
92
|
-
checkpointer=MemorySaver(), # Session memory (optional)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
config = {"configurable": {"thread_id": "project-alpha"}}
|
|
96
|
-
|
|
97
|
-
# First message — agent searches HyperStack for context
|
|
98
|
-
agent.invoke({"messages": [{"role": "user", "content": "Let's work on the auth system"}]}, config)
|
|
99
|
-
|
|
100
|
-
# Agent remembers within session (MemorySaver) AND across sessions (HyperStack)
|
|
101
|
-
agent.invoke({"messages": [{"role": "user", "content": "We decided to use Clerk"}]}, config)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Usage: Direct API Client
|
|
105
|
-
|
|
106
|
-
```python
|
|
107
|
-
from hyperstack_langgraph import HyperStackClient
|
|
108
|
-
|
|
109
|
-
client = HyperStackClient()
|
|
110
|
-
|
|
111
|
-
# Store
|
|
112
|
-
client.store("use-clerk", "Use Clerk for Auth", "Chose Clerk over Auth0",
|
|
113
|
-
card_type="decision", keywords=["clerk", "auth"],
|
|
114
|
-
links=[{"target": "alice", "relation": "decided"}])
|
|
115
|
-
|
|
116
|
-
# Search
|
|
117
|
-
client.search("authentication")
|
|
118
|
-
|
|
119
|
-
# Graph traversal
|
|
120
|
-
client.graph("use-clerk", depth=2)
|
|
121
|
-
|
|
122
|
-
# Time-travel (Pro+)
|
|
123
|
-
client.graph("use-clerk", depth=2, at="2026-02-01T00:00:00Z")
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Tools Provided
|
|
127
|
-
|
|
128
|
-
| Tool | Description |
|
|
129
|
-
|------|-------------|
|
|
130
|
-
| `hyperstack_search` | Search memory for relevant context |
|
|
131
|
-
| `hyperstack_store` | Save a fact, decision, preference, or person |
|
|
132
|
-
| `hyperstack_graph` | Traverse knowledge graph (impact analysis, decision trails) |
|
|
133
|
-
| `hyperstack_list` | List all stored memories |
|
|
134
|
-
| `hyperstack_delete` | Remove outdated memories |
|
|
135
|
-
|
|
136
|
-
## Why HyperStack?
|
|
137
|
-
|
|
138
|
-
- **You control the graph.** No LLM auto-extraction. No phantom relationships. Your agent explicitly defines cards and links.
|
|
139
|
-
- **Zero LLM cost per memory op.** Mem0/Zep charge ~$0.002 per operation. HyperStack: $0.
|
|
140
|
-
- **Time-travel debugging.** See the graph as it existed at any point in time. "Git blame for agent memory."
|
|
141
|
-
- **30-second setup.** No Neo4j, no Docker, no OpenSearch. One API key, done.
|
|
142
|
-
|
|
143
|
-
## Pricing
|
|
144
|
-
|
|
145
|
-
| Plan | Cards | Graph | Price |
|
|
146
|
-
|------|-------|-------|-------|
|
|
147
|
-
| Free | 10 | ❌ | $0 |
|
|
148
|
-
| Pro | 100 | ✅ + time-travel | $29/mo |
|
|
149
|
-
| Team | 500 | ✅ | $59/mo |
|
|
150
|
-
| Business | 2,000 | ✅ | $149/mo |
|
|
151
|
-
|
|
152
|
-
Get a free API key at [cascadeai.dev/hyperstack](https://cascadeai.dev/hyperstack)
|
|
153
|
-
|
|
154
|
-
## License
|
|
155
|
-
|
|
156
|
-
MIT
|
|
File without changes
|
{hyperstack_langgraph-1.0.0 → hyperstack_langgraph-1.2.0}/hyperstack_langgraph.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|