neural-memory 0.2.0__tar.gz → 0.3.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.
Files changed (56) hide show
  1. {neural_memory-0.2.0 → neural_memory-0.3.0}/PKG-INFO +1 -1
  2. {neural_memory-0.2.0 → neural_memory-0.3.0}/pyproject.toml +1 -1
  3. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/__init__.py +1 -1
  4. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/main.py +144 -0
  5. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/mcp/server.py +1 -1
  6. {neural_memory-0.2.0 → neural_memory-0.3.0}/.gitignore +0 -0
  7. {neural_memory-0.2.0 → neural_memory-0.3.0}/LICENSE +0 -0
  8. {neural_memory-0.2.0 → neural_memory-0.3.0}/README.md +0 -0
  9. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/__init__.py +0 -0
  10. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/__main__.py +0 -0
  11. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/config.py +0 -0
  12. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/storage.py +0 -0
  13. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/cli/tui.py +0 -0
  14. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/__init__.py +0 -0
  15. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/brain.py +0 -0
  16. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/brain_mode.py +0 -0
  17. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/fiber.py +0 -0
  18. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/memory_types.py +0 -0
  19. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/neuron.py +0 -0
  20. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/project.py +0 -0
  21. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/core/synapse.py +0 -0
  22. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/engine/__init__.py +0 -0
  23. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/engine/activation.py +0 -0
  24. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/engine/encoder.py +0 -0
  25. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/engine/retrieval.py +0 -0
  26. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/extraction/__init__.py +0 -0
  27. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/extraction/entities.py +0 -0
  28. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/extraction/parser.py +0 -0
  29. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/extraction/router.py +0 -0
  30. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/extraction/temporal.py +0 -0
  31. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/mcp/__init__.py +0 -0
  32. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/mcp/__main__.py +0 -0
  33. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/mcp/prompt.py +0 -0
  34. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/py.typed +0 -0
  35. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/safety/__init__.py +0 -0
  36. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/safety/freshness.py +0 -0
  37. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/safety/sensitive.py +0 -0
  38. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/__init__.py +0 -0
  39. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/app.py +0 -0
  40. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/dependencies.py +0 -0
  41. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/models.py +0 -0
  42. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/routes/__init__.py +0 -0
  43. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/routes/brain.py +0 -0
  44. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/routes/memory.py +0 -0
  45. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/server/routes/sync.py +0 -0
  46. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/__init__.py +0 -0
  47. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/base.py +0 -0
  48. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/factory.py +0 -0
  49. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/memory_store.py +0 -0
  50. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/shared_store.py +0 -0
  51. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/storage/sqlite_store.py +0 -0
  52. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/sync/__init__.py +0 -0
  53. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/sync/client.py +0 -0
  54. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/unified_config.py +0 -0
  55. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/utils/__init__.py +0 -0
  56. {neural_memory-0.2.0 → neural_memory-0.3.0}/src/neural_memory/utils/config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neural-memory
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Reflex-based memory system for AI agents - retrieval through activation, not search
5
5
  Project-URL: Homepage, https://github.com/nhadaututtheky/neural-memory
6
6
  Project-URL: Documentation, https://github.com/nhadaututtheky/neural-memory#readme
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "neural-memory"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Reflex-based memory system for AI agents - retrieval through activation, not search"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -13,7 +13,7 @@ from neural_memory.core.synapse import Direction, Synapse, SynapseType
13
13
  from neural_memory.engine.encoder import EncodingResult, MemoryEncoder
14
14
  from neural_memory.engine.retrieval import DepthLevel, ReflexPipeline, RetrievalResult
15
15
 
16
- __version__ = "0.2.0"
16
+ __version__ = "0.3.0"
17
17
 
18
18
  __all__ = [
19
19
  "__version__",
@@ -2768,6 +2768,150 @@ def prompt(
2768
2768
  typer.echo(text)
2769
2769
 
2770
2770
 
2771
+ @app.command(name="export")
2772
+ def export_brain_cmd(
2773
+ output: Annotated[
2774
+ str, typer.Argument(help="Output file path (e.g., my-brain.json)")
2775
+ ],
2776
+ brain: Annotated[
2777
+ str | None, typer.Option("--brain", "-b", help="Brain to export (default: current)")
2778
+ ] = None,
2779
+ ) -> None:
2780
+ """Export brain to JSON file for backup or sharing.
2781
+
2782
+ Examples:
2783
+ nmem export backup.json # Export current brain
2784
+ nmem export work.json -b work # Export specific brain
2785
+ """
2786
+ from pathlib import Path
2787
+
2788
+ from neural_memory.unified_config import get_config, get_shared_storage
2789
+
2790
+ async def _export() -> None:
2791
+ config = get_config()
2792
+ brain_name = brain or config.current_brain
2793
+ storage = await get_shared_storage(brain_name)
2794
+
2795
+ snapshot = await storage.export_brain(brain_name)
2796
+
2797
+ output_path = Path(output)
2798
+ export_data = {
2799
+ "brain_id": snapshot.brain_id,
2800
+ "brain_name": snapshot.brain_name,
2801
+ "exported_at": snapshot.exported_at.isoformat(),
2802
+ "version": snapshot.version,
2803
+ "neurons": snapshot.neurons,
2804
+ "synapses": snapshot.synapses,
2805
+ "fibers": snapshot.fibers,
2806
+ "config": snapshot.config,
2807
+ "metadata": snapshot.metadata,
2808
+ }
2809
+
2810
+ output_path.write_text(json.dumps(export_data, indent=2, default=str))
2811
+
2812
+ typer.echo(f"Exported brain '{brain_name}' to {output_path}")
2813
+ typer.echo(f" Neurons: {len(snapshot.neurons)}")
2814
+ typer.echo(f" Synapses: {len(snapshot.synapses)}")
2815
+ typer.echo(f" Fibers: {len(snapshot.fibers)}")
2816
+
2817
+ asyncio.run(_export())
2818
+
2819
+
2820
+ @app.command(name="import")
2821
+ def import_brain_cmd(
2822
+ input_file: Annotated[
2823
+ str, typer.Argument(help="Input file path (e.g., my-brain.json)")
2824
+ ],
2825
+ brain: Annotated[
2826
+ str | None, typer.Option("--brain", "-b", help="Target brain name (default: from file)")
2827
+ ] = None,
2828
+ merge: Annotated[
2829
+ bool, typer.Option("--merge", "-m", help="Merge with existing brain")
2830
+ ] = False,
2831
+ ) -> None:
2832
+ """Import brain from JSON file.
2833
+
2834
+ Examples:
2835
+ nmem import backup.json # Import as original brain name
2836
+ nmem import backup.json -b new # Import as 'new' brain
2837
+ nmem import backup.json --merge # Merge into existing brain
2838
+ """
2839
+ from pathlib import Path
2840
+
2841
+ from neural_memory.core.brain import BrainSnapshot
2842
+ from neural_memory.unified_config import get_shared_storage
2843
+
2844
+ async def _import() -> None:
2845
+ input_path = Path(input_file)
2846
+ if not input_path.exists():
2847
+ typer.echo(f"Error: File not found: {input_path}", err=True)
2848
+ raise typer.Exit(1)
2849
+
2850
+ data = json.loads(input_path.read_text())
2851
+
2852
+ brain_name = brain or data.get("brain_name", "imported")
2853
+ storage = await get_shared_storage(brain_name)
2854
+
2855
+ snapshot = BrainSnapshot(
2856
+ brain_id=data.get("brain_id", brain_name),
2857
+ brain_name=data["brain_name"],
2858
+ exported_at=datetime.fromisoformat(data["exported_at"]),
2859
+ version=data["version"],
2860
+ neurons=data["neurons"],
2861
+ synapses=data["synapses"],
2862
+ fibers=data["fibers"],
2863
+ config=data["config"],
2864
+ metadata=data.get("metadata", {}),
2865
+ )
2866
+
2867
+ imported_id = await storage.import_brain(snapshot, brain_name)
2868
+
2869
+ typer.echo(f"Imported brain '{brain_name}' from {input_path}")
2870
+ typer.echo(f" Neurons: {len(snapshot.neurons)}")
2871
+ typer.echo(f" Synapses: {len(snapshot.synapses)}")
2872
+ typer.echo(f" Fibers: {len(snapshot.fibers)}")
2873
+
2874
+ asyncio.run(_import())
2875
+
2876
+
2877
+ @app.command()
2878
+ def serve(
2879
+ host: Annotated[
2880
+ str, typer.Option("--host", "-h", help="Host to bind to")
2881
+ ] = "127.0.0.1",
2882
+ port: Annotated[
2883
+ int, typer.Option("--port", "-p", help="Port to bind to")
2884
+ ] = 8000,
2885
+ reload: Annotated[
2886
+ bool, typer.Option("--reload", "-r", help="Enable auto-reload for development")
2887
+ ] = False,
2888
+ ) -> None:
2889
+ """Run the NeuralMemory API server.
2890
+
2891
+ Examples:
2892
+ nmem serve # Run on localhost:8000
2893
+ nmem serve -p 9000 # Run on port 9000
2894
+ nmem serve --host 0.0.0.0 # Expose to network
2895
+ nmem serve --reload # Development mode
2896
+ """
2897
+ try:
2898
+ import uvicorn
2899
+ except ImportError:
2900
+ typer.echo("Error: uvicorn not installed. Run: pip install neural-memory[server]", err=True)
2901
+ raise typer.Exit(1)
2902
+
2903
+ typer.echo(f"Starting NeuralMemory API server on http://{host}:{port}")
2904
+ typer.echo("API docs: http://{host}:{port}/docs")
2905
+
2906
+ uvicorn.run(
2907
+ "neural_memory.server.app:create_app",
2908
+ host=host,
2909
+ port=port,
2910
+ reload=reload,
2911
+ factory=True,
2912
+ )
2913
+
2914
+
2771
2915
  @app.command()
2772
2916
  def version() -> None:
2773
2917
  """Show version information."""
@@ -603,7 +603,7 @@ async def handle_message(server: MCPServer, message: dict[str, Any]) -> dict[str
603
603
  "id": msg_id,
604
604
  "result": {
605
605
  "protocolVersion": "2024-11-05",
606
- "serverInfo": {"name": "neural-memory", "version": "0.2.0"},
606
+ "serverInfo": {"name": "neural-memory", "version": "0.3.0"},
607
607
  "capabilities": {"tools": {}, "resources": {}},
608
608
  },
609
609
  }
File without changes
File without changes
File without changes