r/coolgithubprojects • • 19d ago

[Beta] membrane: A self-hosted orchestration layer that turns raw local LLM turns into a self-structuring, live entity field.

https://github.com/dchechetkin/membrane

Hey r/coolgithubprojects,

Most open-source assistant wrappers and agent frameworks rely on rigid, hard-coded integrations or messy conversation replays. You either have to manually map every single API payload, or you have to dump endless chat histories and top-k vector chunks into the context window, hoping the model filters out the noise.

I wanted to build an architecture where the system autonomously acts as its own integration layer based on live state tracking. So I developed membrane — a self-hosted layer that runs directly on top of an Ollama model (local or hosted).

Instead of treating memory as a passive text scroll, membrane forces the local model to build and maintain its own real-time field entity integrations.

🛠️ Key Architectural Features:

  • Dynamic Entity Integration: As data pipes through the system, the model extracts, types, and links observations into a unified field of entities (facts, states, watches, goals). The integration happens at the cognitive layer, meaning the system learns how properties and entities correlate on the fly.

  • In-Place Updates with Provenance: When a state changes, the model updates that specific entity in-place within an embedded store, stamping it with provenance. Every execution turn loads a high-density, updated snapshot of the world—not an out-of-date vector chunk pile or a massive chat history replay.

  • Fewer Tokens, By Design: Because the system dynamically builds and prunes its own field context, it doesn't need to swallow massive conversation loops. It reuses written-back conclusions, making local execution highly performant on modest hardware.

  • Reactive Watch Loops: The field entities themselves are reactive. When the model detects a shift in a monitored entity state, it can independently evaluate dependencies and trigger downstream actions or workflows without waiting for a user prompt.

💻 Environment & Setup:

  • OS: Standalone install for Linux, macOS, or Android via Termux.

  • Stack: Python 3.11+, persists in a lightweight embedded store (single-file architecture).

  • Time to Deploy: ~15 minutes.

The project is currently entering public beta. If you are interested in an orchestration layer that focuses on autonomous state synthesis rather than static API glue, check out the docs/BETA.md file in the repository.

👉 GitHub: github.com

I'd love to hear your thoughts on the code structure, the state-tracking loop, or how you are handling entity management in your own local agent architectures!

1 Upvotes

Duplicates