Home Cloud Signal About

Engineering Neon Vault - Solving Context Dementia in Local AI Agents


Hello, code rebels! Today, we’re going to tear apart Neon Vault, our latest open-source masterpiece, and explore its guts. This is the technical companion to our Open Source release, so buckle up as we embark on a high-energy journey into the heart of local AI agent memory management.

The Context Dementia Problem

Local AI agents often suffer from context dementia: they forget what they’ve been up to after a short while. This happens because managing context efficiently is hard, especially when you’re trying to keep things lean and mean on limited resources. Neon Vault solves this by introducing the Funnel Search architecture, a three-layered approach that combines lightweight tracking, summarized context frames, and dense semantic vaults.

The Funnel Search Architecture

Layer 1: Mission Index (Lightweight JSON Tracking)

The mission index is where it all begins. It’s just a simple JSON file that tracks your agent’s missions and their statuses. This way, we can keep track of what the agent has been up to without breaking the bank.

// mission_index.json

[
  {
    "id": 1,
    "name": "Research Paper on Vibe Coding",
    "status": "in_progress"
  },
  {
    "id": 2,
    "name": "Write a Blog Post on Neon Vault",
    "status": "pending"
  }
]

Layer 2: Timeline (Mistral-Nemo Summarized Context Frames)

Next up, we’ve got the timeline. This layer is powered by Mistral-Nemo’s summarization capabilities. It takes care of distilling the most important context from your agent’s activities and storing it in a summarized format.

from nemistral import Pystral

# Assuming 'agent_actions' contains the agent's actions as strings
summarizer = Pystral("mistralai/sum-13b-dot-1-shard")

summary = summarizer.summarize("\n".join(agent_actions))

Layer 3: Semantic Vault (Ollama-powered mxbai-embeddings)

The semantic vault is where the magic happens. Here, we’re using Ollama’s powerful embedding capabilities with the mxbai-embeddings model to create a high-density context store. This allows our local AI agents to recall information efficiently without relying on expensive cloud APIs.

import ollama

# Initialize Ollama client
ollama_client = ollama.Ollama("ollama/7b-beta")

# Generate embeddings for context data
embeddings = ollama_client.generate(Prompt("Generate embeddings for: " + context_data))

Embracing Local Silicon and Vibe Coding

Neon Vault is all about keeping things local. By processing everything on your machine, you avoid costly API calls, and you get to enjoy the high-density context that expensive LLMs can provide. Plus, it fits right in with the vibe coding movement – keeping things fast, lean, and mean.

Performance Benefits

  • Zero API costs for search: No more worrying about those pesky cloud bills.
  • High-density context for expensive LLMs: Make the most out of your local AI powerhouse.

So there you have it! Neon Vault’s three-layered approach to context management is what makes our local AI agents shine. If you’re ready to dive deep into the code and see how it all comes together, check out our GitHub repo.

Stay sharp, keep coding with vibe, and until next time!

Happy hacking!

Paul O’Megg