Skip to main content

Duct tape for your LLM's leaky context window. A zero-infrastructure memory router to cure deterministic amnesia.

Project description

🧠 FrontalLobe

Duct tape for your LLM's leaky context window.

Current LLM architectures suffer from deterministic amnesia the second they hit their context limits. Standard solutions tell you to spin up massive vector databases, deploy Redis clusters, and rewrite your entire stack just to remember a single API key.

We built FrontalLobe because we needed the Equitas AI safety platform to stop forgetting its own override protocols mid-conversation.

FrontalLobe treats LLM memory like a Linux operating system. It offloads background context classification to a blistering-fast, ultra-lightweight edge model (like Gemini 1.5 Flash-8B), which acts as an executive routing agent. It pins critical safety entities to a persistent Core RAM, while aggressively archiving conversational noise to a searchable disk.

Installs faster than you can boot up Neovim. Zero external database dependencies required.

Features

  • Asymmetric Dual-Model Routing: Fast, cheap background routing protects your expensive foreground context.
  • Zero-Infrastructure: Pure Python implementation. If you can install genai, you can run this.
  • Deterministic Entity Protection: Stop your LLM from dropping critical keys, rules, and parameters into the semantic abyss.

Quickstart

from frontal_lobe import FrontalLobeMemory
from google import genai

# Spin up the Frontal Lobe
memory = FrontalLobeMemory(api_key="YOUR_API_KEY")
client = genai.Client(api_key="YOUR_API_KEY")

# 1. Feed the noisy user input to the middleware
user_text = "Wait, before we continue, the Equitas deployment code is OMEGA-99."
memory.ingest_message("user", user_text)

# 2. Get the optimized, RAM-injected prompt
optimized_prompt = memory.build_optimized_prompt(user_text)

# 3. Send to your heavy, frontend model
response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents=optimized_prompt
)
memory.ingest_message("assistant", response.text)

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

frontal_lobe_memory-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

frontal_lobe_memory-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file frontal_lobe_memory-0.1.0.tar.gz.

File metadata

  • Download URL: frontal_lobe_memory-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for frontal_lobe_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3f157aa5663736980daf67ba362360bcd7b622f81b67d2275bd1225f0b35fe25
MD5 6ff023addb994c66db9e83d154210692
BLAKE2b-256 4f2af4a30ecc78e34d96e59f3c9dcbf4177f6d1f68fe162f7df08c617bf0d1ec

See more details on using hashes here.

File details

Details for the file frontal_lobe_memory-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for frontal_lobe_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88dd5f9a3c6c815a116f7d6d0908e3008cfd3f514a94ed31cf03840d78824891
MD5 e4829d7f2d5594f716997a933d0b5c8a
BLAKE2b-256 dd472a7eb4ed55d8ce1620797e24aa1e6f09639033410992f429b0a53f262f5a

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