Duct tape for your LLM's leaky context window. Stop your chatbot from acting like a goldfish.
Project description
🧠 FrontalLobe
Give Your AI a devloped Brain!
If you've ever built an AI app, you know the pain: the second your LLM hits its context limit, it suffers from total amnesia. Standard advice tells you to spin up massive vector databases, deploy Redis clusters, and rewrite your entire stack just so your bot remembers a user's name 20 messages later.
That's exhausting. I built FrontalLobe so you can just write code and move on.
FrontalLobe gives your LLM an operating system. It uses a tiny, lightning-fast background model to act as a bouncer for your memory. It pins the absolute most important facts to a permanent "RAM" block, while quietly throwing casual conversational noise into a searchable archive.
It installs faster than you can boot up your IDE, and requires absolutely zero external databases.
Why use it?
- The Dual-Brain Setup: A cheap, fast background model manages the memory so your expensive, smart foreground model doesn't have to.
- Zero Infrastructure: Pure Python. No Milvus, no Pinecone, no headaches. If you can install
genai, you can run this. - No More Goldfish Memory: Stop your AI from dropping user preferences, rules, and crucial context into the void.
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. Tell the AI something important
user_text = "Before we start, remember that I hate writing in Java and my cat's name is Waffles."
memory.ingest_message("user", user_text)
# 2. Let FrontalLobe build the perfect, memory-injected prompt
optimized_prompt = memory.build_optimized_prompt(user_text)
# 3. Send it to your heavy, frontend model
response = client.models.generate_content(
model="gemini-2.0-flash",
contents=optimized_prompt
)
# 4. Save the response
memory.ingest_message("assistant", response.text)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frontal_lobe_memory-0.1.1.tar.gz.
File metadata
- Download URL: frontal_lobe_memory-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d87898c73a341cb5aebaa2cd0f3d60453efb4654c2cfa5f1fa569fdfc980e264
|
|
| MD5 |
3b1b93779433e0dd645f1b9e1ca2a40c
|
|
| BLAKE2b-256 |
267a6042d0f3a95781967049b5f49189ce0e01589197481994e10d26207be3e6
|
File details
Details for the file frontal_lobe_memory-0.1.1-py3-none-any.whl.
File metadata
- Download URL: frontal_lobe_memory-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a48198f628321c8fa0068501ec6325f8f423e1da487cfd72f8bf8d8c98d8bca
|
|
| MD5 |
e267ac29bfd4c5f0bec40a9a3e9afbf1
|
|
| BLAKE2b-256 |
88c1b44a702199a4123bf3531ca5c895a1e51ee69f58eaf923700d1cd6985de6
|