Skip to main content

A latent memory and active inference engine for AI agents.

Project description

Paradox: Latent Memory & Simulation Engine

Paradox is a lightweight, hardware-agnostic cognitive architecture for AI agents. It provides a dynamic "Latent Memory" that doesn't just store data but allows for active simulation, evolution, and reasoning.

🎯 The Main Point

"Extreme Efficiency through Abstraction."

We have too much data and not enough hardware. Paradox solves this by replacing heavy "Real Objects" with lightweight "Latent Vectors", allowing you to perform Supercomputer-scale tasks on a Laptop.

  • Don't store the Cake (100MB Object).
  • Store the Recipe (1KB Vector).
  • Bake it on demand.

🚀 Key Features

  • Multimodal Intelligence (v0.7.0): Unified encoding for Images and Text using CLIP.
  • Semantic Proximity (v0.8.0): Weighted "Attention" search to prioritize specific features (e.g., Color vs Shape).
  • Latent Reasoning (v0.9.0): Perform concept arithmetic (King - Man + Woman = Queen) directly in vector space.
  • Temporal Intelligence (v0.10.0): Track thought trajectories and predict future states.
  • Intelligence APIs (v0.11.0): High-level methods like imagine(), predict_future(), and conceptual_search().
  • Hybrid Compute: Automatically runs on GPU (PyTorch) if available, gracefully falls back to CPU (NumPy/MMap).

📦 Installation

git clone https://github.com/ethcocoder/paradoxlf.git
cd paradoxlf
pip install .[ai,ui]

⚡ Quick Start: Intelligence Layer

from paradox.engine import LatentMemoryEngine
from paradox.media.clip_module import CLIPEncoder

# 1. Initialize the Brain
encoder = CLIPEncoder() # Loads CLIP Model
engine = LatentMemoryEngine(dimension=encoder.dimension)
engine.set_encoder(encoder)

# 2. Learn Concepts
engine.add("Telephone", {"name": "Telephone"})
engine.add("Computer", {"name": "Computer"})
engine.add("Smartphone", {"name": "Smartphone"})

# 3. Imagine New Concepts (Blending)
# What is half phone, half computer?
new_idea = engine.imagine("Telephone", "Computer", ratio=0.5)

# 4. Search for Meaning
results = engine.conceptual_search(new_idea, k=1)
print(f"Imagined Concept is closest to: {results[0][2]['name']}")

🧠 Advanced Capabilities

1. Temporal Prediction (Forecasting)

Predict where a sequence of thoughts or video frames is heading.

history = [vector_t0, vector_t1, vector_t2]
future_vector = engine.predict_future(history, steps=1)

2. Semantic Search with Attention

Search for "Red Car", but tell the engine that Color is 10x more important than Shape.

weights = [10.0, 1.0, ...] # Heavy weight on first dimensions
results = engine.query(query_vec, weights=weights)

3. Visual Dashboard

Explore your memory space interactively.

streamlit run paradox/ui/dashboard.py

🌍 Innovation Impact

Paradox is a fundamental engine for Massive Scale Simulation:

Domain Problem Paradox Solution
Cognitive AI LLMs are stateless/expensive. Paradox provides a cheap, evolvable long-term memory.
Scientific Sim Simulating millions of particles is slow. Latent physics allows interacting with millions of entities.
Big Data Searching billions of logs is slow. Proximity search finds anomalies instantly (O(1) approx).

🌐 Distributed & Networked Memory (v0.12.0+)

Paradox can now scale horizontally across multiple processes or machines.

1. Local Cluster (Multi-Threaded)

Simulate a distributed system on a single machine.

from paradox.distributed import LatentCluster
cluster = LatentCluster(num_shards=4)
cluster.add(vector) # Round-robin distribution
cluster.query(vector) # Map-reduce query

2. Networked Memory (Client-Server)

Run shards on different servers (Cloud/Edge).

Server (Node A):

# Start a shard server on port 8000
python -c "from paradox.distributed import start_server; start_server(port=8000)"

Client (Node B):

from paradox.distributed import RemoteShard
client = RemoteShard(host="192.168.1.5", port=8000)
client.add(vector)

Hybrid Cluster: Combine local and remote shards into one brain.

cluster = LatentCluster(num_shards=0)
cluster.shards.append(RemoteShard(host="node_1"))
cluster.shards.append(RemoteShard(host="node_2"))
# Now queries search the entire network!

🤝 Contributing

Open source contributions are welcome. Please submit a PR for review.

📄 License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paradoxlf-0.15.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paradoxlf-0.15.0-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file paradoxlf-0.15.0.tar.gz.

File metadata

  • Download URL: paradoxlf-0.15.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for paradoxlf-0.15.0.tar.gz
Algorithm Hash digest
SHA256 bba9a0e81f29e9fb2ddca9b4a22a0343cdbe70a4a5c6d62320a11f03338393c9
MD5 880afa20fb1c015034e217ebb075c9c4
BLAKE2b-256 8924e27a693b65dbe47bc21e8457ef9f0bbe9b2ca6cdf661ed0c4b019f0acd1a

See more details on using hashes here.

File details

Details for the file paradoxlf-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: paradoxlf-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for paradoxlf-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 876c8132a84f26a2e90494721f8af7e311dfb548e2d342653a9fc65578cd9f3f
MD5 69663ddfa74a3acbf2dcd6f3d0458ae2
BLAKE2b-256 5266590bdd5472b85c48e095018dc697ceb5c6ca185227fe1ce84e00c9b31517

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page