hipp0-memory 0.1.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.
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: hipp0-memory
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Hipp0 multi-agent memory and decision platform.
5
+ Author: Perlantir
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/perlantir/Hipp0
8
+ Project-URL: Documentation, https://github.com/perlantir/Hipp0
9
+ Project-URL: Repository, https://github.com/perlantir/Hipp0
10
+ Keywords: hipp0,multi-agent,memory,decisions,sdk
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: requests>=2.28.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Requires-Dist: pytest-cov; extra == "dev"
25
+ Requires-Dist: responses>=0.23; extra == "dev"
26
+ Requires-Dist: mypy>=1.0; extra == "dev"
27
+ Requires-Dist: ruff>=0.4; extra == "dev"
28
+
29
+ # hipp0-sdk
30
+
31
+ Official Python SDK for the [Hipp0](https://github.com/perlantir/Hipp0) multi-agent memory and decision platform.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install hipp0-sdk
37
+ ```
38
+
39
+ Or for local development:
40
+
41
+ ```bash
42
+ cd python-sdk
43
+ pip install -e ".[dev]"
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ from hipp0_sdk import Hipp0Client
50
+
51
+ client = Hipp0Client(base_url="http://localhost:3100", api_key="my-key")
52
+
53
+ # Create a project
54
+ project = client.create_project("My Project", "A demonstration project")
55
+
56
+ # Register an agent
57
+ agent = client.create_agent(
58
+ project_id=project["id"],
59
+ name="architect-agent",
60
+ role="architect",
61
+ capabilities=["design", "review"],
62
+ )
63
+
64
+ # Record a decision
65
+ decision = client.create_decision(
66
+ project_id=project["id"],
67
+ title="Use PostgreSQL",
68
+ description="All persistent data will be stored in PostgreSQL.",
69
+ reasoning="Team expertise and strong JSONB support.",
70
+ made_by="architect-agent",
71
+ tags=["database", "infrastructure"],
72
+ )
73
+
74
+ # Compile context for another agent
75
+ context = client.compile_context(
76
+ project_id=project["id"],
77
+ agent_name="coder-agent",
78
+ task_description="Implement user authentication service.",
79
+ max_tokens=4096,
80
+ )
81
+ print(context["compiled_text"])
82
+
83
+ # Send a conversation to the distillery
84
+ result = client.distill(
85
+ project_id=project["id"],
86
+ conversation_text="...<full chat log>...",
87
+ agent_name="coder-agent",
88
+ )
89
+ print(f"Extracted {len(result['decisions_created'])} decisions")
90
+ ```
91
+
92
+ ## API Reference
93
+
94
+ See the inline docstrings in `hipp0_sdk/client.py` for the full API surface.
@@ -0,0 +1,66 @@
1
+ # hipp0-sdk
2
+
3
+ Official Python SDK for the [Hipp0](https://github.com/perlantir/Hipp0) multi-agent memory and decision platform.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install hipp0-sdk
9
+ ```
10
+
11
+ Or for local development:
12
+
13
+ ```bash
14
+ cd python-sdk
15
+ pip install -e ".[dev]"
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```python
21
+ from hipp0_sdk import Hipp0Client
22
+
23
+ client = Hipp0Client(base_url="http://localhost:3100", api_key="my-key")
24
+
25
+ # Create a project
26
+ project = client.create_project("My Project", "A demonstration project")
27
+
28
+ # Register an agent
29
+ agent = client.create_agent(
30
+ project_id=project["id"],
31
+ name="architect-agent",
32
+ role="architect",
33
+ capabilities=["design", "review"],
34
+ )
35
+
36
+ # Record a decision
37
+ decision = client.create_decision(
38
+ project_id=project["id"],
39
+ title="Use PostgreSQL",
40
+ description="All persistent data will be stored in PostgreSQL.",
41
+ reasoning="Team expertise and strong JSONB support.",
42
+ made_by="architect-agent",
43
+ tags=["database", "infrastructure"],
44
+ )
45
+
46
+ # Compile context for another agent
47
+ context = client.compile_context(
48
+ project_id=project["id"],
49
+ agent_name="coder-agent",
50
+ task_description="Implement user authentication service.",
51
+ max_tokens=4096,
52
+ )
53
+ print(context["compiled_text"])
54
+
55
+ # Send a conversation to the distillery
56
+ result = client.distill(
57
+ project_id=project["id"],
58
+ conversation_text="...<full chat log>...",
59
+ agent_name="coder-agent",
60
+ )
61
+ print(f"Extracted {len(result['decisions_created'])} decisions")
62
+ ```
63
+
64
+ ## API Reference
65
+
66
+ See the inline docstrings in `hipp0_sdk/client.py` for the full API surface.
@@ -0,0 +1,23 @@
1
+ """Hipp0 Memory — zero-config decision memory for multi-agent teams."""
2
+
3
+ from hipp0_sdk.client import Hipp0Client
4
+ from .server import Hipp0Server
5
+
6
+ _server = None
7
+
8
+ def init(db_path="./hipp0.db", port=3100):
9
+ """Start Hipp0 with zero config. One line."""
10
+ global _server
11
+ _server = Hipp0Server(db_path=db_path, port=port)
12
+ _server.start()
13
+ return Hipp0Client(
14
+ base_url=f"http://localhost:{port}",
15
+ api_key=_server.api_key
16
+ )
17
+
18
+ def stop():
19
+ """Stop the running Hipp0 server."""
20
+ global _server
21
+ if _server:
22
+ _server.stop()
23
+ _server = None
@@ -0,0 +1,41 @@
1
+ """CLI entry point for hipp0-memory."""
2
+
3
+ import argparse
4
+ import sys
5
+
6
+ def main():
7
+ parser = argparse.ArgumentParser(prog="hipp0-memory", description="Hipp0 decision memory server")
8
+ subparsers = parser.add_subparsers(dest="command")
9
+
10
+ init_parser = subparsers.add_parser("init", help="Initialize a new Hipp0 project")
11
+ init_parser.add_argument("name", nargs="?", default=".", help="Project directory name")
12
+ init_parser.add_argument("--port", type=int, default=3100, help="Server port")
13
+
14
+ subparsers.add_parser("start", help="Start the Hipp0 server")
15
+ subparsers.add_parser("stop", help="Stop the Hipp0 server")
16
+
17
+ args = parser.parse_args()
18
+
19
+ if args.command == "init":
20
+ from .server import Hipp0Server
21
+ server = Hipp0Server(port=args.port)
22
+ print(f"Starting Hipp0 in {args.name}...")
23
+ server.start()
24
+ print(f"Hipp0 is running on http://localhost:{args.port}")
25
+ print(f"API Key: {server.api_key}")
26
+ try:
27
+ server._process.wait()
28
+ except KeyboardInterrupt:
29
+ server.stop()
30
+ elif args.command == "start":
31
+ from .server import Hipp0Server
32
+ server = Hipp0Server()
33
+ server.start()
34
+ print(f"Hipp0 started on http://localhost:{server.port}")
35
+ elif args.command == "stop":
36
+ print("Stop not implemented — use Ctrl+C on the running process")
37
+ else:
38
+ parser.print_help()
39
+
40
+ if __name__ == "__main__":
41
+ main()
@@ -0,0 +1,93 @@
1
+ """Manages the Hipp0 Node.js server process."""
2
+
3
+ import subprocess
4
+ import platform
5
+ import time
6
+ import os
7
+ import secrets
8
+ from pathlib import Path
9
+
10
+ class Hipp0Server:
11
+ def __init__(self, db_path="./hipp0.db", port=3100):
12
+ self.db_path = str(Path(db_path).resolve())
13
+ self.port = port
14
+ self.api_key = os.environ.get("DECIGRAPH_API_KEY", f"nx_{secrets.token_hex(20)}")
15
+ self._process = None
16
+
17
+ def start(self):
18
+ binary = self._get_binary_path()
19
+ if not binary:
20
+ raise RuntimeError(
21
+ "Hipp0 server binary not found. "
22
+ "Install Node.js and run: npx @hipp0/cli start"
23
+ )
24
+ env = {
25
+ **os.environ,
26
+ "DECIGRAPH_DB_PATH": self.db_path,
27
+ "PORT": str(self.port),
28
+ "DECIGRAPH_API_KEY": self.api_key,
29
+ }
30
+ self._process = subprocess.Popen(
31
+ [str(binary), "start"],
32
+ env=env,
33
+ stdout=subprocess.PIPE,
34
+ stderr=subprocess.PIPE,
35
+ )
36
+ self._wait_for_health()
37
+ return self
38
+
39
+ def stop(self):
40
+ if self._process:
41
+ self._process.terminate()
42
+ try:
43
+ self._process.wait(timeout=10)
44
+ except subprocess.TimeoutExpired:
45
+ self._process.kill()
46
+ self._process = None
47
+
48
+ def _get_binary_path(self):
49
+ system = platform.system().lower()
50
+ machine = platform.machine().lower()
51
+ if "arm" in machine or "aarch64" in machine:
52
+ arch = "arm64"
53
+ else:
54
+ arch = "x64"
55
+
56
+ name = f"hipp0-{system}-{arch}"
57
+ if system == "windows":
58
+ name += ".exe"
59
+
60
+ # Check bundled binaries
61
+ bin_dir = Path(__file__).parent / "bin"
62
+ binary = bin_dir / name
63
+ if binary.exists():
64
+ return binary
65
+
66
+ # Fall back to npx
67
+ import shutil
68
+ npx = shutil.which("npx")
69
+ if npx:
70
+ return None # Caller should use npx @hipp0/cli start instead
71
+
72
+ return None
73
+
74
+ def _wait_for_health(self, timeout=30):
75
+ import urllib.request
76
+ start = time.time()
77
+ while time.time() - start < timeout:
78
+ try:
79
+ req = urllib.request.urlopen(
80
+ f"http://localhost:{self.port}/api/health"
81
+ )
82
+ if req.status == 200:
83
+ return
84
+ except Exception:
85
+ time.sleep(0.5)
86
+ raise TimeoutError("Hipp0 server did not start within timeout")
87
+
88
+ def __enter__(self):
89
+ self.start()
90
+ return self
91
+
92
+ def __exit__(self, *args):
93
+ self.stop()
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: hipp0-memory
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Hipp0 multi-agent memory and decision platform.
5
+ Author: Perlantir
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/perlantir/Hipp0
8
+ Project-URL: Documentation, https://github.com/perlantir/Hipp0
9
+ Project-URL: Repository, https://github.com/perlantir/Hipp0
10
+ Keywords: hipp0,multi-agent,memory,decisions,sdk
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: requests>=2.28.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Requires-Dist: pytest-cov; extra == "dev"
25
+ Requires-Dist: responses>=0.23; extra == "dev"
26
+ Requires-Dist: mypy>=1.0; extra == "dev"
27
+ Requires-Dist: ruff>=0.4; extra == "dev"
28
+
29
+ # hipp0-sdk
30
+
31
+ Official Python SDK for the [Hipp0](https://github.com/perlantir/Hipp0) multi-agent memory and decision platform.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install hipp0-sdk
37
+ ```
38
+
39
+ Or for local development:
40
+
41
+ ```bash
42
+ cd python-sdk
43
+ pip install -e ".[dev]"
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ from hipp0_sdk import Hipp0Client
50
+
51
+ client = Hipp0Client(base_url="http://localhost:3100", api_key="my-key")
52
+
53
+ # Create a project
54
+ project = client.create_project("My Project", "A demonstration project")
55
+
56
+ # Register an agent
57
+ agent = client.create_agent(
58
+ project_id=project["id"],
59
+ name="architect-agent",
60
+ role="architect",
61
+ capabilities=["design", "review"],
62
+ )
63
+
64
+ # Record a decision
65
+ decision = client.create_decision(
66
+ project_id=project["id"],
67
+ title="Use PostgreSQL",
68
+ description="All persistent data will be stored in PostgreSQL.",
69
+ reasoning="Team expertise and strong JSONB support.",
70
+ made_by="architect-agent",
71
+ tags=["database", "infrastructure"],
72
+ )
73
+
74
+ # Compile context for another agent
75
+ context = client.compile_context(
76
+ project_id=project["id"],
77
+ agent_name="coder-agent",
78
+ task_description="Implement user authentication service.",
79
+ max_tokens=4096,
80
+ )
81
+ print(context["compiled_text"])
82
+
83
+ # Send a conversation to the distillery
84
+ result = client.distill(
85
+ project_id=project["id"],
86
+ conversation_text="...<full chat log>...",
87
+ agent_name="coder-agent",
88
+ )
89
+ print(f"Extracted {len(result['decisions_created'])} decisions")
90
+ ```
91
+
92
+ ## API Reference
93
+
94
+ See the inline docstrings in `hipp0_sdk/client.py` for the full API surface.
@@ -0,0 +1,16 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ hipp0_memory/__init__.py
5
+ hipp0_memory/cli.py
6
+ hipp0_memory/server.py
7
+ hipp0_memory.egg-info/PKG-INFO
8
+ hipp0_memory.egg-info/SOURCES.txt
9
+ hipp0_memory.egg-info/dependency_links.txt
10
+ hipp0_memory.egg-info/entry_points.txt
11
+ hipp0_memory.egg-info/requires.txt
12
+ hipp0_memory.egg-info/top_level.txt
13
+ hipp0_sdk/__init__.py
14
+ hipp0_sdk/client.py
15
+ hipp0_sdk/exceptions.py
16
+ hipp0_sdk/types.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ hipp0-memory = hipp0_memory.cli:main
@@ -0,0 +1,8 @@
1
+ requests>=2.28.0
2
+
3
+ [dev]
4
+ pytest>=7.0
5
+ pytest-cov
6
+ responses>=0.23
7
+ mypy>=1.0
8
+ ruff>=0.4
@@ -0,0 +1,2 @@
1
+ hipp0_memory
2
+ hipp0_sdk
@@ -0,0 +1,80 @@
1
+ """
2
+ hipp0-sdk
3
+ =========
4
+ Official Python SDK for the Hipp0 multi-agent memory and decision platform.
5
+
6
+ Quick start::
7
+
8
+ from hipp0_sdk import Hipp0Client
9
+
10
+ client = Hipp0Client(base_url="http://localhost:3100", api_key="my-key")
11
+
12
+ project = client.create_project("My Project")
13
+ decision = client.create_decision(
14
+ project_id=project["id"],
15
+ title="Use PostgreSQL",
16
+ description="Primary data store will be PostgreSQL.",
17
+ reasoning="Team expertise and excellent JSONB support.",
18
+ made_by="architect-agent",
19
+ )
20
+ context = client.compile_context(
21
+ project_id=project["id"],
22
+ agent_name="coder-agent",
23
+ task_description="Implement the user authentication service.",
24
+ )
25
+ """
26
+
27
+ from .client import Hipp0Client
28
+ from .exceptions import (
29
+ Hipp0ApiError,
30
+ Hipp0AuthError,
31
+ Hipp0ConnectionError,
32
+ Hipp0Error,
33
+ Hipp0NotFoundError,
34
+ Hipp0ValidationError,
35
+ )
36
+ from .types import (
37
+ Agent,
38
+ Artifact,
39
+ ContextPackage,
40
+ Contradiction,
41
+ Decision,
42
+ DecisionEdge,
43
+ DistilleryResult,
44
+ FeedbackRecord,
45
+ GraphResult,
46
+ ImpactAnalysis,
47
+ Notification,
48
+ Project,
49
+ SessionSummary,
50
+ Subscription,
51
+ )
52
+
53
+ __version__ = "0.1.0"
54
+
55
+ __all__ = [
56
+ # Client
57
+ "Hipp0Client",
58
+ # Exceptions
59
+ "Hipp0Error",
60
+ "Hipp0ApiError",
61
+ "Hipp0NotFoundError",
62
+ "Hipp0AuthError",
63
+ "Hipp0ValidationError",
64
+ "Hipp0ConnectionError",
65
+ # Types
66
+ "Project",
67
+ "Agent",
68
+ "Decision",
69
+ "DecisionEdge",
70
+ "GraphResult",
71
+ "Artifact",
72
+ "SessionSummary",
73
+ "Notification",
74
+ "Subscription",
75
+ "Contradiction",
76
+ "ContextPackage",
77
+ "DistilleryResult",
78
+ "ImpactAnalysis",
79
+ "FeedbackRecord",
80
+ ]