Metadata-Version: 2.4
Name: frontal-lobe-memory
Version: 0.1.1
Summary: Duct tape for your LLM's leaky context window. Stop your chatbot from acting like a goldfish.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: google-genai>=0.1.0

# 🧠 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

```python
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)
