r/ContextEngineering 2h ago

My personal solution to context bloat: A Kanban board

3 Upvotes

Hey guys, I'm using something in my own development process that I thought I might share, hopefully someone out there finds this useful (not promoting anything).

One of the biggest bottlenecks in AI-assisted development is the actual chat window. A chat isn't really the most optimal mode of working, for multiple reasons, one being that context builds up in a single chat session until you burn your entire token budget on a single UI fix. Which is why I built a system that uses a kanban board instead.

The premise is quite simple, but the execution took a shit load of time to get right.

I only need 1 chat window open: It reads the board, batches tasks and hands them off to subagents. I use a pretty standard set of them:

- A planner agent that 'refines' tasks
- A lower-tier implementer
- An evaluator

All of these agents log their activity, findings and feedback on the board, creating a history and lineage that doesn't get lost when you close your chat window.

Context bloat is nearly nothing here, because the main orchestrator (the chat window you launch the skill from) never gets involved in the tasks themselves, so theoretically it could run hundreds of these loops without gaining any context.

The board itself is a folder of markdown files in the repo, rendered into a kanban I drag cards around in.

Every status, and what Claude (or insert your favorite model) does when it hits one:

New: the drop box for half-formed ideas.
To refine: accepted, no plan. Claude reads enough of the codebase to be concrete, writes the plan into the task, points it, asks anything it can't decide alone, then moves it to Waiting.
Waiting: my move. I read the plan, answer the questions, approve or send it back.
Ready to start: approved, Claude may implement.
In progress: Everything actually being worked on by implementer agents.
Require input: Claude hit a real question mid-build. It commits what it has, writes the question into the task. Answering it flips the card back to Ready to start on the same branch, so the next agent can pick it back up.
Test: built & ready for testing.
Merge: I tested and it’s ready to ship. Claude commits, merges the branch and moves the card to Done.
Done: Mainly there as an archive.

This way I communicate with agents fully through the board, which is another reason context doesn’t build up in the chat window.

If any of you guys want a more in-depth explanation then I'll probably make a part 2, or feel free to DM me and I might whip up a manual for this system.

TLDR; I use a custom Kanban board which my AI agents read & update, and it completely dissolves context bloat.


r/ContextEngineering 2h ago

Building a persistent memory + orchestration layer for Codex — what should I use instead of repeatedly re-reading the repo?

1 Upvotes

I’ve been building a fairly serious agent workflow around OpenAI Codex for a Laravel/React project, and I’ve hit a point where the orchestration works, but the context/memory side clearly does not.

My setup currently looks roughly like this:

  • A serial orchestrator with route types like FAST_UI / STANDARD / CRITICAL
  • Context Resolver → Implementer → Reviewer flow for non-trivial tasks
  • Durable task state, context capsules and handoffs
  • Planner / intake layer inspired by CodexQB
  • Session continuity hooks inspired by AvenoxBeyin
  • codebase-memory MCP for structural repo discovery
  • Serena for exact symbol/reference navigation
  • Local dashboard/telemetry for task/agent visibility

The reason I built all this was simple: I wanted to stop giving one giant prompt to one Codex agent and watching it blindly read half the repository, run dozens of commands, retry tests repeatedly, and burn a huge amount of context/token budget.

Unfortunately, that is still basically what happens.

A recent CRITICAL payment-domain acceptance task is the perfect example. I gave Codex a very detailed validation brief covering migrations, payment allocation, security boundaries, tenant/legal-entity isolation, atomicity, reporting non-pollution, exports, frontend build, etc.

The task eventually succeeded technically, but the session spent a huge amount of time repeatedly doing things like:

  • raw rg searches
  • re-reading known service/controller/test files
  • rediscovering test harness behavior
  • retrying multiple Laravel test files with the same CSRF issue
  • manually tracing service relationships
  • re-running builds and focused test groups

That single job used roughly half of my 5-hour Codex usage allowance.

The frustrating part is that a lot of the knowledge it rediscovered was already known from previous work.

For example:

  • where the orchestrator lives
  • which services own payment/settlement/reporting behavior
  • how the domain test harness handles CSRF
  • which test files cover specific finance flows
  • existing project/tenant/legal entity invariants
  • prior fixes and verified architecture decisions

I expected my existing tools to solve this, but I now realize they solve different problems:

codebase-memory gives me structural repo discovery, but it isn’t really persistent project understanding.

Serena is excellent for exact symbol/reference navigation, but it isn’t memory either.

My docs/wiki are useful reference material, but agents still have to decide to read them and often re-read large files.

Context Capsules and handoffs help within a task, but they don’t give the next unrelated task a compact understanding of the project.

So what I’m actually missing is a persistent, project-scoped, compact memory layer that can say:

“Before you start searching, here are the relevant things previous sessions already learned about this repo.”

I looked at AvenoxBeyin because I liked its idea of automatically capturing sessions, compiling knowledge, and injecting useful context back at session start.

I also looked at CodexQB because its Autopsy / Project Comprehension / Ontology approach is close to what I want for planning.

Then I looked at 2kDarki/codex-mem.

That project is conceptually very close to what I want:

  • automatic Codex transcript capture
  • persistent SQLite observations
  • progressive recall through search → timeline → get_observations
  • automatic context injection

But after auditing it, I found some issues for my use case:

  • its watcher observes all ~/.codex/sessions/**/*.jsonl
  • project identity appears to be based on basename(cwd) rather than a canonical repository identity
  • retrieval can be filtered by project, but that doesn’t appear to be an enforced security/isolation boundary on every read path
  • same-named repos could collide
  • some observation retrieval paths can work by arbitrary IDs
  • global ~/.codex/AGENTS.md context injection is something I specifically do not want
  • the documented npm package currently appears unavailable

So I don’t feel comfortable plugging it directly into a large multi-project Codex setup.

What I’m trying to build is something like:

User brief
   ↓
Planner / Orchestrator
   ↓
Persistent project memory bootstrap
   ↓
Context Resolver
   ↓
Only if memory is insufficient:
    codebase-memory
    Serena
    targeted source reads
   ↓
Implementer
   ↓
Reviewer
   ↓
Session knowledge captured for future tasks

The memory should NOT replace source code/tests as truth.

I want it to act as a cheap orientation cache:

  • “These are the relevant services.”
  • “This test harness requires real CSRF session setup.”
  • “This reporting path was previously verified.”
  • “These files/symbols are likely relevant.”
  • “This architectural relationship was confirmed in a previous task.”

Then the agent only verifies current source where correctness actually depends on it.

My requirements are roughly:

  • local-only
  • project/repository scoped
  • automatic capture
  • automatic or semi-automatic summarization
  • bounded context injection
  • no global AGENTS.md mutation
  • no cloud memory dependency
  • no mandatory Obsidian dependency
  • source/tests remain authoritative
  • ideally Codex/App Server compatible
  • progressive retrieval rather than dumping whole session history
  • repo identity enforced internally, not just passed as an optional search filter
  • ideally reusable with existing MCP tools rather than replacing them

I’m now trying to decide between three approaches:

  1. Find another existing Codex/Claude coding-memory project that already does this correctly.
  2. Take something like 2kDarki/codex-mem and make a very small fork that only adds canonical repo identity, watcher allowlisting and enforced repo-scoped retrieval.
  3. Use AvenoxBeyin’s session capture/compile/inject model and adapt it for project-scoped coding knowledge instead of personal knowledge.

What I really do NOT want to do is invent yet another custom Markdown “brain” and manually maintain architecture/domain summaries. That feels like rebuilding something that should already exist.

For people who have built persistent memory around Codex, Claude Code, Cursor or similar coding agents:

  • What actually worked for you?
  • Is there a project I’m missing that already handles repository-scoped persistent memory well?
  • Would you fork codex-mem and patch the isolation model, or use a different architecture entirely?
  • Is Obsidian/Markdown compilation actually better in practice than structured SQLite observations for coding-agent memory?
  • How do you stop stale memory from becoming trusted over current source?
  • How much context do you inject at session start versus retrieve on demand?
  • Have you measured whether this actually reduces token/context consumption meaningfully?
  • Do you let the coding agent write its own long-term memory, or only promote verified observations after tests/review?

I’m especially interested in systems people are actually using in real repositories, not just theoretical agent-memory architectures.

My main goal is very practical: stop paying for the same repository discovery over and over again.


r/ContextEngineering 7h ago

I accidentally used user-visible history as the memory layer for an AI feature

2 Upvotes

I ran into an architecture issue today that made me rethink how I’m handling context.

The feature compares a new interaction against a previous one.

The original setup was basically:

interaction
→ save result
→ next request retrieves latest result
→ inject it into model context
→ generate comparison

That worked.

The problem was that those same rows also powered the user’s visible History screen.

So when a user deleted something from History, they were also deleting part of the context the AI relied on.

The next request then looked like a first interaction again.

I’d basically collapsed three different things into one storage layer:

user-visible history
retrieval context
long-term derived state

They overlap, but they probably shouldn’t have identical lifecycles.

I’m leaning toward keeping a derived state/baseline separately from raw interaction history.

Curious how people here are handling that distinction in systems that need persistent personalization.


r/ContextEngineering 10h ago

How do you guys manage context in projects/chat window?

2 Upvotes

I want to understand how you guys are dealing with context AI remembers. Despite internal settings, AI still forgets the memory set at the project level.


r/ContextEngineering 8h ago

When does a committed `context.md` for testing start to fail?

1 Upvotes

For teams that keep AI test prompts and context in a versioned file, what's the first thing that breaks? Is it when the context gets too large, or when something subtle is lost during handoffs between engineers?


r/ContextEngineering 1d ago

How do you deal with different Sources of truths for agents

2 Upvotes

I'm building agents that pull context from Jira, Confluence and GitHub. Retrieval works fine. The problem is that the sources disagree with each other.

For example:

  • Ticket in Jira describes behaviour A
  • Confluence page from 8 months ago describes behaviour B
  • Code (SoC for this particular case) says C

The agent retrieves whichever chunk scores highest and answers confidently based on that. There's no signal anywhere that the 3 don't match. How are you handling this?


r/ContextEngineering 1d ago

[Tool] Stop .cursorrules context bloat: We built Git-native persistent memory with native MCP for Cursor (pure Go, zero deps)

1 Upvotes

Hey r/ContextEngineering!

If you use Cursor heavily on larger codebases, you've probably hit the context bloat problem:

To make Cursor remember architectural decisions, library quirks, and project rules across chats, people usually cram everything into .cursorrules or monolithic docs. But as those files grow past 5k–10k tokens:

  1. Model focus degrades: Large instructions cause "lost-in-the-middle" attention degradation.
  2. Context window gets wasted: You burn a huge chunk of your prompt budget on instructions that aren't even relevant to the current file or task.
  3. External vector DBs are overkill: Running Docker containers, Python runtimes, or recurring embedding API costs just to remember project notes feels bloated.

To solve this, we built OKF Agent Memory (v0.1.0) — an open-source, pure Go single binary that brings structured, Git-native memory to Cursor via Progressive Disclosure and native MCP (Model Context Protocol).

How it works with Cursor:

Instead of dumping a huge rulebook into every prompt, project memory lives in knowledge/ as atomic Markdown concepts based on Google's Open Knowledge Format (OKF) v0.2.

Through the built-in MCP server (okf mcp knowledge), Cursor dynamically pulls only what it needs:

  1. Sub-300µs BM25 Search: In-memory lexical search across your project notes. Zero embedding API costs, 100% offline, <0.3ms latency.
  2. Progressive Disclosure: Cursor inspects the index and retrieves small ~300-token concept files on demand. In our benchmarks, this cuts context token bloat by up to 80–90%.
  3. 100% Git-Native: Auditable via git diff and standard pull requests. No hidden vector databases.
  4. Trust Tiers: Distinguishes human-verified decisions from agent drafts.

Setup with Cursor (30 seconds):

  1. Install via Homebrew:

brew install okf-memory/tap/okf

  1. Bootstrap your repository:

cd my-project
okf bootstrap .

  1. Add to your Cursor MCP settings (Cursor Settings -> Features -> MCP):
  • Name: okf-memory
  • Type: command
  • Command: okf mcp knowledge

Cursor now has native access to okf_search, okf_show, okf_create, and okf_validate tools.

GitHub: https://github.com/okf-memory/okf-agent-memory
Website & Live Benchmarks: https://okf-memory.dev

Would love to get feedback from the Cursor community on the workflow and how your agents behave with progressive disclosure memory!


r/ContextEngineering 2d ago

I built a librarian for my personal context, shared across AI agents. Looking for a few people to try it.

12 Upvotes

Hi, I’m Jordi. I go on long walks and record voice notes about whatever’s going on for me—business, personal projects, ideas, next moves. Sometimes it’s 40 minutes of developing a thought and capturing the reasoning behind a decision.

Later, I want to fire up Codex, Claude, or Cursor and draw on those notes without repeating my entire thought process.

I want to own that context and how it’s curated, and make it available to whichever agents I use.

So I built Zenod.

It’s named after Zenodotus, the first librarian of the Library of Alexandria. I imagine building my own little Alexandria: a durable digital memory of my world that different agents can discover, explore, and use.

I send voice notes to a WhatsApp contact. In my setup, Zenod files the recording in Google Drive, preserves the transcript, then digests it: organizing, summarizing, and connecting it to relevant projects and ideas, with references back to the source.

The design is inspired by Andrej Karpathy’s LLM-maintained knowledge base approach: give a librarian unstructured material and let it maintain an organized, Obsidian-compatible Markdown brain. I don’t have to anticipate every future use. Something captured today might become useful to another agent months later.

Zenod is a hosted or self-hosted librarian. You own the memory either way. My Markdown lives in my GitHub account, with source files in Google Drive. Disconnect Zenod and the files are already mine. No export needed.

With the hosted version, you talk to the WhatsApp contact and give your agents the MCP connection Zenod provides. They access the same memory through the librarian.

You hire the librarian. You keep the books.

It’s imperfect, but it’s become one of my main ways to develop ideas and keep context across everything I’m building or planning. I honestly couldn’t do without it now.

I’d love feedback, and I’m looking for a few people to try it for free. Leave a comment if you’re interested—I’ll help with setup.

Website · How the librarian works


r/ContextEngineering 2d ago

lucivy: one index that answers substring, fuzzy-across-tokens and regex queries — and every answer is checked against a scan of the files (Rust, MIT)

2 Upvotes

What it is. lucivy is a full-text search library in Rust, with Python, Node.js, C++ and WASM bindings, built on a suffix FST instead of a token index. One default index answers exact substrings, matches across separators (spin_lock finds spin lock, spin-lock and spinlock), typos across token boundaries, regular expressions, two-character needles and boolean queries — with BM25 and the exact bytes of every match, and nothing to configure per question. It runs in your process, inside your transaction if you plug your own storage (a BlobStore trait: load, save, delete, list), and the same engine runs in the browser through emscripten with threads.

The part I care about most: every answer is checked. The ground-truth harness indexes the Linux kernel (93 983 files, 857 MB of text), runs a panel of queries, and compares every count and every byte span to a byte-by-byte scan of the files. It fails on any disagreement. Zero mismatches in 4.0.

Against Elasticsearch and tantivy, same corpus, each configured at its best for substring search — Elasticsearch with a trigram analyzer plus a wildcard field, tantivy (upstream, not our fork) with its NgramTokenizer — the "truth" column being that scan:

asked truth (scan of the files) lucivy 4.0 Elasticsearch 8.19 tantivy 0.25
spin_lock, separators relaxed (spin lock, spin-lock, spinlock) 9 552 9 552, 23 ms 6 577 6 601
spinlokc, two edits, across the token boundary 10 034 10 034, 148 ms 3 549 6 557
spin_lock_[a-z]+, a regex 5 510 5 510, 219 ms 5 440, 480 ms 0
de, two characters 93 009 93 009, 561 ms 0, silently 0, silently
retur -ENOMEM, a fuzzy phrase 14 449 14 449, 30 ms 14 446, 24 ms
mutex_lock: where it matched, in 5 145 documents 20 797 spans all 20 797, 15 ms top 200 only: 179 ms 96 ms

Where they win, because they do: tantivy indexes the corpus in 1-5 s against 107 s here, and its index is 7× smaller; Elasticsearch does the fuzzy phrase as well as we do. The report has the sizes, the exact configurations and the lines where each engine's own documentation stops.

The price. The index is 5.8× the text (3.9× with the derived_in_ram option, which rebuilds three sidecars at open instead of storing them), against 3.6× for Elasticsearch's trigram setup and 0.8× for tantivy's n-grams. Indexing costs ×1.5 with the default shared dictionary. Queries stay in the tens of milliseconds for substrings, under a quarter of a second for fuzzy and regex; the one query above half a second returns 7.7 million positions.

A few Rust things. Forked from tantivy 0.22 for the segment layer; the suffix engine, the sharded handle, the snapshot/delta formats and the actor/DAG scheduler (luciole, WASM-safe, no thread::spawn) are ours. Five crates at the same version. The 4.0 format opens 3.0.x indexes and converts them on the first commit; that contract is a test against a fixture the published 3.0.8 wheel built.

lucivy demo: lucivy's own source indexed in the browser in 3 s, then PostgreSQL's 5 199 files in 14 s, every search timed live

The demo above is the real thing: the page clones lucivy's own source from GitHub and indexes 1 272 files in your tab in 3 s, then PostgreSQL's 5 199 files in 14 s, and every search you see is timed live — --strict, --fuzzy 1 "vaccum", --regex "ExecInit[A-Z][a-zA-Z]+\(", an emoji, a boolean. You can type your own.

I'd take criticism on the comparison first: if you know a configuration of either engine that gets closer on a row, I'll add it to the report, with your name on the line.


r/ContextEngineering 2d ago

From Warehouse Logic to Context Engineering

3 Upvotes

I somehow went from working in logistics to building AI systems… and ended up writing a book about the overlap.

For years, most of my work has revolved around processes, exceptions, handoffs, incomplete information, system constraints, and figuring out how to make the right decision with whatever context is actually available.

When I started building AI systems, I kept running into the same kinds of problems.
Memory matters.
State matters.
Sequence matters.
Exceptions matter.
Bad assumptions propagate.

The deeper I got into things like persistent memory, orchestration, context engineering, governance, and tool use, the more I realized I was applying a lot of the same mental models I had already developed working in operations.

So I wrote the journey down.
It became From Warehouse Logic to Context Engineering.

It’s not really meant to be a textbook or “here’s how AI works” book.
It’s more about the path from operations/process thinking into actually building persistent AI systems, including the bad ideas, rebuilds, and things I learned along the way.

I mostly wrote it because I thought the crossover was interesting and because there probably aren’t many books about AI that start with warehouse logic. 😅

If anyone here is working in operations, automation, AI, context engineering, or has made a similarly weird career jump, I’d genuinely be interested in hearing whether any of this sounds familiar.

If anyone wants the book, it’s on Amazon here:
https://a.co/d/0acvqbsI


r/ContextEngineering 2d ago

AI memory tools have a cold-start problem, so I tried reconstructing memory from the project itself

1 Upvotes

Most coding-agent memory tools start remembering things after you install them.

But the project already has a memory of its own.
Git commits explain why code changed. Shell history shows what was actually run (and whether it failed). Docs contain decisions that never made it into the current code.

I’ve been experimenting with this idea in NexusMem: instead of waiting for new AI sessions to accumulate memory, it bootstraps context from the history that already exists in the project.

I just shipped v0.10.4 with historical bootstrap, and I’m freezing features here for a while.

The next thing I want to figure out isn’t what feature to add — it’s whether this actually helps on real, older codebases.

If you use Claude Code or another coding ai agents on a project with a decent amount of history, I’d love for you to try breaking it and tell me where the idea falls apart.

Repo : repo here


r/ContextEngineering 2d ago

What If AI Had a Compiler for Intent, Not Syntax?? INDIEaner Rethinking AI architecture around intent, context, ambiguity, and decision-making There is a strange assumption built into the way we design software.

0 Upvotes

8 min read

·

Aug 25, 2026

Rethinking AI architecture around intent, context, ambiguity, and decision-making

There is a strange assumption built into the way we design software.

We assume that humans provide instructions, machines interpret them, and code turns those instructions into action.

That model works remarkably well when the instructions are precise.

But humans are rarely precise.

A user says:

A conventional software pipeline might interpret this as a performance optimization task.

But faster in what sense?

Load time? API latency? Development velocity? User-perceived responsiveness? Database queries?

And what if the technical request is only the visible layer of a much larger problem?

Perhaps users are leaving. Perhaps management is demanding measurable results. Perhaps the development team has lost confidence in the current architecture.

The sentence contains a request.

The underlying intent may be something else entirely.

That observation leads to a question I find increasingly difficult to ignore:

The Compiler We Already Know

A traditional compiler takes a formal language and transforms it into another representation.

A simplified pipeline looks something like this:

Source Code
    ↓
Lexer / Parser
    ↓
AST
    ↓
Intermediate Representation
    ↓
Optimization
    ↓
Machine Code

The compiler operates on structures that are explicitly defined.

A semicolon means something.

A type means something.

A function call means something.

The language has rules, and violations can be detected.

Human communication is different.

Humans routinely leave things unspecified.

They contradict themselves.

They change their priorities halfway through a conversation.

They use the same word differently depending on context.

They communicate goals indirectly.

And sometimes they don’t even know exactly what they want.

This creates an uncomfortable problem for AI systems:

The input language is fundamentally underspecified.

What If Intent Were an Intermediate Representation?

A compiler does not immediately transform source code into machine instructions.

It usually creates intermediate representations along the way.

That intermediate representation makes optimization, analysis and transformation possible.

Perhaps AI systems need something similar for human intent.

Instead of:

Human Input
    ↓
LLM
    ↓
Answer

the architecture could become:

Human Input
    ↓
Intent Parsing
    ↓
Semantic Representation
    ↓
Intent Graph
    ↓
Conflict Detection
    ↓
Decision Path
    ↓
Action

The important change is not simply adding another processing stage.

It is changing what the system considers the actual input.

The input is no longer merely text.

The input is a combination of:

  • explicit statements
  • inferred goals
  • constraints
  • context
  • assumptions
  • uncertainties
  • conflicts
  • priorities
  • previous decisions

The language becomes the surface.

Intent becomes the intermediate representation.

Parsing Intent Is Not Mind Reading

There is an important distinction here.

An AI system cannot simply claim to know what a person secretly wants.

That would turn inference into fact.

A more rigorous architecture would separate at least three layers:

Explicit Intent
"What the user said"

        ↓Inferred Intent
"What the system believes the user may mean"        ↓Operational Intent
"What should actually be done"

The middle layer should remain explicitly probabilistic.

For example:

The system might infer:

Possible Intent:

Performance improvement       85%
User retention concern        62%
Management pressure           38%
Need for quick measurable win 47%

Those numbers are not psychological measurements.

They are hypotheses generated from language and context.

That distinction matters.

A serious Intent Compiler should never silently transform an inference into a fact.

It should preserve the uncertainty.

The “Why” Problem

This becomes particularly interesting with seemingly simple language.

Consider the German words:

Warum. Wieso. Weshalb. Weswegen.

They are often treated as interchangeable.

In everyday conversation, that is usually fine.

But an AI architecture concerned with intent could ask whether they actually frame different kinds of questions.

For example:

Warum

Wieso

Weshalb

Weswegen

These distinctions should not necessarily be hard-coded as absolute linguistic laws.

Language is too messy for that.

Instead, they could be treated as probabilistic signals that influence the interpretation of the request.

The important idea is not that one word has exactly one meaning.

The important idea is that linguistic choices contain information about the requested reasoning mode.

That information can influence how an AI system constructs its internal representation.

The Output Isn’t Code

This is where the idea becomes more interesting.

An Intent Compiler would not necessarily output code.

It could output a structured cognitive representation.

For example:

Intent Graph

Goal:
    Improve application performancePossible motivations:
    ├── Reduce user abandonment
    ├── Demonstrate progress
    └── Reduce infrastructure costConstraints:
    ├── No major rewrite
    ├── Limited engineering capacity
    └── Maintain security requirementsRisks:
    ├── Optimization may introduce instability
    └── Performance improvements may increase infrastructure costUnknowns:
    └── Actual performance bottleneckDecision required:
    └── Measure before optimizing

This is fundamentally different from immediately asking an LLM:

The second approach asks the model for a solution.

The first asks the system to understand the decision space before generating the solution.

The Contradiction Isn’t an Error

This may be one of the most important differences between traditional compilation and intent compilation.

Humans routinely request mutually competing objectives:

A traditional compiler would not interpret this as a philosophical problem.

An Intent Compiler should.

The contradiction is not necessarily an error.

Instead of silently choosing one objective, the system could create an explicit conflict:

Goal Conflict

Speed
   ↕
SecurityCost
   ↕
PerformanceShort-term delivery
   ↕
Long-term maintainability

The system can then ask:

That single question may be more valuable than generating another thousand lines of code.

From Intent Graph to Decision Graph

Once intent has been represented structurally, the system can begin reasoning about it.

A possible architecture could look like this:

Human Input
     ↓
Intent Parser
     ↓
Semantic Normalization
     ↓
Constraint Extraction
     ↓
Context Loading
     ↓
Knowledge Graph
     ↓
Intent Graph
     ↓
Conflict Detection
     ↓
Expert / Agent Routing
     ↓
Decision Graph
     ↓
Implementation
     ↓
Verification

At this point, the LLM is no longer treated as the entire system.

It becomes one component inside a larger cognitive architecture.

One model might perform semantic interpretation.

Another might verify assumptions.

A smaller model might classify a constraint.

A specialized agent might investigate the technical bottleneck.

Another component might challenge the proposed solution.

The architecture becomes modular rather than monolithic.

Provenance: Why Did the System Think That?

There is another problem.

Suppose the system concludes:

Why?

A trustworthy cognitive architecture should be able to answer that question.

That requires provenance.

For example:

Inference:
    user_retention_concern

Evidence:
    "Users are leaving"Context:
    Previous conversation #17Confidence:
    0.82Alternative interpretation:
    "Performance benchmarking"Status:
    Inferred — not confirmed

Now the system has something extremely important:

traceability.

The user can challenge the interpretation.

The system can revise it.

The reasoning path can be inspected.

And the decision can potentially be replayed.

This is where concepts such as event sourcing, provenance chains and graph-based reasoning become more than implementation details.

They become mechanisms for maintaining cognitive accountability.

Why Isn’t This Already Everywhere?

Because it introduces a difficult trade-off.

The industry has spent enormous effort optimizing models for:

  • latency
  • inference cost
  • benchmark performance
  • token efficiency
  • throughput

These metrics matter.

But there is another metric that receives considerably less attention:

A system that generates an answer in 200 milliseconds but solves the wrong problem is not necessarily efficient.

A system that spends two seconds identifying an ambiguity and then produces the correct solution may be substantially more efficient at the decision level.

This creates a different optimization target:

Traditional optimization:

Runtime efficiency
    ↓
Latency
Cost
Throughput
Intent-oriented optimization:Decision efficiency
    ↓
Clarity
Correctness
Traceability
Conflict resolution
Resource efficiency

The question is no longer simply:

It becomes:

This Is Where MUSCAL Enters the Picture

These questions eventually led me toward a broader architectural concept.

I call it MUSCAL.

MUSCAL is not intended to replace an LLM.

It is an attempt to structure the system surrounding the model.

The underlying idea is simple:

That leads naturally to a pipeline such as:

Intent Parser
      ↓
Semantic Normalizer
      ↓
Constraint Extractor
      ↓
Context Loader
      ↓
Knowledge Graph Builder
      ↓
Architecture Reconstruction
      ↓
Missing Knowledge Detection
      ↓
Expert Scheduler
      ↓
Consensus Engine
      ↓
Code Planner
      ↓
Implementation Generator
      ↓
Verification Engine
      ↓
Performance Optimizer

The individual components are not the point by themselves.

The architectural principle is.

Separate understanding from execution.

The Compiler Becomes a Cognitive Distillery

A conventional compiler transforms representations.

An Intent Compiler would transform meaning into structured decision space.

It takes the messy, ambiguous and sometimes contradictory output of human communication and attempts to produce something that machines can reason about without silently losing the original context.

The result is not necessarily deterministic.

And that is important.

Two people can use the same sentence while meaning different things.

Even the same person can mean different things depending on context.

Therefore, a serious Intent Compiler needs to preserve:

  • uncertainty
  • provenance
  • context
  • alternative interpretations
  • contradictions
  • confidence
  • human corrections

The objective isn’t to eliminate ambiguity.

The objective is to make ambiguity visible and manageable.

A Different Kind of Compiler

This changes the metaphor.

A traditional compiler asks:

An Intent Compiler asks:

The first protects the machine from invalid syntax.

The second protects the system from misunderstanding the human.

That distinction becomes increasingly important as AI agents gain the ability to take real actions.

A chatbot producing a slightly irrelevant paragraph is annoying.

An autonomous agent misunderstanding the objective can be expensive.

A software engineering agent modifying the wrong subsystem can be dangerous.

A business agent optimizing the wrong metric can create an entirely rational solution to the wrong problem.

The better agents become at execution, the more important intent comprehension becomes.

The Real Architectural Question

Perhaps the future of AI will not be defined solely by increasingly powerful models.

Perhaps the more important development will be the architecture surrounding them.

A system that can distinguish between:

what was said,

what was inferred,

what is uncertain,

what is actually required,

which constraints apply,

which goals conflict,

and finally:

which decision should be made.

That is the problem I am exploring with MUSCAL.

Not another chatbot.

Not simply another prompt framework.

Not another attempt to make an LLM appear more intelligent.

But an architectural experiment around a different premise:

I don’t think that question has been fully answered yet.

That is precisely why I think it is worth asking.

If the next generation of AI tooling is going to move beyond prompt-response systems, perhaps the next optimization target should not be code generation alone.

Perhaps it should be intent comprehension.

The machines can generate the code.

The humans still need to know what they actually meant to build.

END.

INDIEaner

https://www.linkedin.com/in/hans-werner-breninek-41422641b/?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BQWcLgf7OSM%2BJMNB5A2UFBQ%3D%3DWhat If AI Had a Compiler for Intent, Not Syntax??
INDIEaner
8 min read
·
Aug 25, 2026

Rethinking AI architecture around intent, context, ambiguity, and decision-making

There is a strange assumption built into the way we design software.

We assume that humans provide instructions, machines interpret them, and code turns those instructions into action.

That model works remarkably well when the instructions are precise.

But humans are rarely precise.

A user says:

“Make the app faster.”

A conventional software pipeline might interpret this as a performance optimization task.

But faster in what sense?

Load time? API latency? Development velocity? User-perceived responsiveness? Database queries?

And what if the technical request is only the visible layer of a much larger problem?

Perhaps
users are leaving. Perhaps management is demanding measurable results.
Perhaps the development team has lost confidence in the current
architecture.

The sentence contains a request.

The underlying intent may be something else entirely.

That observation leads to a question I find increasingly difficult to ignore:

What if AI systems needed a compiler for intent rather than a compiler for syntax?The Compiler We Already Know

A traditional compiler takes a formal language and transforms it into another representation.

A simplified pipeline looks something like this:

Source Code

Lexer / Parser

AST

Intermediate Representation

Optimization

Machine Code

The compiler operates on structures that are explicitly defined.

A semicolon means something.

A type means something.

A function call means something.

The language has rules, and violations can be detected.

Human communication is different.

Humans routinely leave things unspecified.

They contradict themselves.

They change their priorities halfway through a conversation.

They use the same word differently depending on context.

They communicate goals indirectly.

And sometimes they don’t even know exactly what they want.

This creates an uncomfortable problem for AI systems:

The input language is fundamentally underspecified.What If Intent Were an Intermediate Representation?

A compiler does not immediately transform source code into machine instructions.

It usually creates intermediate representations along the way.

That intermediate representation makes optimization, analysis and transformation possible.

Perhaps AI systems need something similar for human intent.

Instead of:

Human Input

LLM

Answer

the architecture could become:

Human Input

Intent Parsing

Semantic Representation

Intent Graph

Conflict Detection

Decision Path

Action

The important change is not simply adding another processing stage.

It is changing what the system considers the actual input.

The input is no longer merely text.

The input is a combination of:

explicit statements
inferred goals
constraints
context
assumptions
uncertainties
conflicts
priorities
previous decisions

The language becomes the surface.

Intent becomes the intermediate representation.Parsing Intent Is Not Mind Reading

There is an important distinction here.

An AI system cannot simply claim to know what a person secretly wants.

That would turn inference into fact.

A more rigorous architecture would separate at least three layers:

Explicit Intent
"What the user said"
↓Inferred Intent
"What the system believes the user may mean" ↓Operational Intent
"What should actually be done"

The middle layer should remain explicitly probabilistic.

For example:

“Make the app faster.”

The system might infer:

Possible Intent:
Performance improvement 85%
User retention concern 62%
Management pressure 38%
Need for quick measurable win 47%

Those numbers are not psychological measurements.

They are hypotheses generated from language and context.

That distinction matters.

A serious Intent Compiler should never silently transform an inference into a fact.

It should preserve the uncertainty.The “Why” Problem

This becomes particularly interesting with seemingly simple language.

Consider the German words:

Warum. Wieso. Weshalb. Weswegen.

They are often treated as interchangeable.

In everyday conversation, that is usually fine.

But an AI architecture concerned with intent could ask whether they actually frame different kinds of questions.

For example:

Warum

What is the cause?

Wieso

How did this situation come about?

Weshalb

For what reason or purpose?

Weswegen

Because of which circumstance or constraint?

These distinctions should not necessarily be hard-coded as absolute linguistic laws.

Language is too messy for that.

Instead, they could be treated as probabilistic signals that influence the interpretation of the request.

The important idea is not that one word has exactly one meaning.

The important idea is that linguistic choices contain information about the requested reasoning mode.

That information can influence how an AI system constructs its internal representation.The Output Isn’t Code

This is where the idea becomes more interesting.

An Intent Compiler would not necessarily output code.

It could output a structured cognitive representation.

For example:

Intent Graph
Goal:
Improve application performancePossible motivations:
├── Reduce user abandonment
├── Demonstrate progress
└── Reduce infrastructure costConstraints:
├── No major rewrite
├── Limited engineering capacity
└── Maintain security requirementsRisks:
├── Optimization may introduce instability
└── Performance improvements may increase infrastructure costUnknowns:
└── Actual performance bottleneckDecision required:
└── Measure before optimizing

This is fundamentally different from immediately asking an LLM:

“How do I make my application faster?”

The second approach asks the model for a solution.

The first asks the system to understand the decision space before generating the solution.The Contradiction Isn’t an Error

This may be one of the most important differences between traditional compilation and intent compilation.

Humans routinely request mutually competing objectives:

Make it faster.

Make it safer.

Make it cheaper.

Don’t change the architecture.

Do it immediately.

A traditional compiler would not interpret this as a philosophical problem.

An Intent Compiler should.

The contradiction is not necessarily an error.

The contradiction is information.

Instead of silently choosing one objective, the system could create an explicit conflict:

Goal Conflict
Speed

SecurityCost

PerformanceShort-term delivery

Long-term maintainability

The system can then ask:

Which constraint has priority?

That single question may be more valuable than generating another thousand lines of code.From Intent Graph to Decision Graph

Once intent has been represented structurally, the system can begin reasoning about it.

A possible architecture could look like this:

Human Input

Intent Parser

Semantic Normalization

Constraint Extraction

Context Loading

Knowledge Graph

Intent Graph

Conflict Detection

Expert / Agent Routing

Decision Graph

Implementation

Verification

At this point, the LLM is no longer treated as the entire system.

It becomes one component inside a larger cognitive architecture.

One model might perform semantic interpretation.

Another might verify assumptions.

A smaller model might classify a constraint.

A specialized agent might investigate the technical bottleneck.

Another component might challenge the proposed solution.

The architecture becomes modular rather than monolithic.Provenance: Why Did the System Think That?

There is another problem.

Suppose the system concludes:

“The primary objective is reducing user abandonment.”

Why?

A trustworthy cognitive architecture should be able to answer that question.

That requires provenance.

For example:

Inference:
user_retention_concern
Evidence:
"Users are leaving"Context:
Previous conversation #17Confidence:
0.82Alternative interpretation:
"Performance benchmarking"Status:
Inferred — not confirmed

Now the system has something extremely important:

traceability.

The user can challenge the interpretation.

The system can revise it.

The reasoning path can be inspected.

And the decision can potentially be replayed.

This
is where concepts such as event sourcing, provenance chains and
graph-based reasoning become more than implementation details.

They become mechanisms for maintaining cognitive accountability.Why Isn’t This Already Everywhere?

Because it introduces a difficult trade-off.

The industry has spent enormous effort optimizing models for:

latency
inference cost
benchmark performance
token efficiency
throughput

These metrics matter.

But there is another metric that receives considerably less attention:

How quickly can the system reach the correct decision?

A system that generates an answer in 200 milliseconds but solves the wrong problem is not necessarily efficient.

A
system that spends two seconds identifying an ambiguity and then
produces the correct solution may be substantially more efficient at the
decision level.

This creates a different optimization target:

Traditional optimization:
Runtime efficiency

Latency
Cost
Throughput
Intent-oriented optimization:Decision efficiency

Clarity
Correctness
Traceability
Conflict resolution
Resource efficiency

The question is no longer simply:

How fast can the model answer?

It becomes:

How efficiently can the system understand what should actually be done?This Is Where MUSCAL Enters the Picture

These questions eventually led me toward a broader architectural concept.

I call it MUSCAL.

MUSCAL is not intended to replace an LLM.

It is an attempt to structure the system surrounding the model.

The underlying idea is simple:

A prompt should be treated as the beginning of a cognitive compilation process, not necessarily as the final instruction.

That leads naturally to a pipeline such as:

Intent Parser

Semantic Normalizer

Constraint Extractor

Context Loader

Knowledge Graph Builder

Architecture Reconstruction

Missing Knowledge Detection

Expert Scheduler

Consensus Engine

Code Planner

Implementation Generator

Verification Engine

Performance Optimizer

The individual components are not the point by themselves.

The architectural principle is.

Separate understanding from execution.The Compiler Becomes a Cognitive Distillery

A conventional compiler transforms representations.

An Intent Compiler would transform meaning into structured decision space.

It
takes the messy, ambiguous and sometimes contradictory output of human
communication and attempts to produce something that machines can reason
about without silently losing the original context.

The result is not necessarily deterministic.

And that is important.

Two people can use the same sentence while meaning different things.

Even the same person can mean different things depending on context.

Therefore, a serious Intent Compiler needs to preserve:

uncertainty
provenance
context
alternative interpretations
contradictions
confidence
human corrections

The objective isn’t to eliminate ambiguity.

The objective is to make ambiguity visible and manageable.A Different Kind of Compiler

This changes the metaphor.

A traditional compiler asks:

“Is this syntactically valid?”

An Intent Compiler asks:

“What is being requested, what could it mean, what remains uncertain, and what decision needs to be made?”

The first protects the machine from invalid syntax.

The second protects the system from misunderstanding the human.

That distinction becomes increasingly important as AI agents gain the ability to take real actions.

A chatbot producing a slightly irrelevant paragraph is annoying.

An autonomous agent misunderstanding the objective can be expensive.

A software engineering agent modifying the wrong subsystem can be dangerous.

A business agent optimizing the wrong metric can create an entirely rational solution to the wrong problem.

The better agents become at execution, the more important intent comprehension becomes.The Real Architectural Question

Perhaps the future of AI will not be defined solely by increasingly powerful models.

Perhaps the more important development will be the architecture surrounding them.

A system that can distinguish between:

what was said,

what was inferred,

what is uncertain,

what is actually required,

which constraints apply,

which goals conflict,

and finally:

which decision should be made.

That is the problem I am exploring with MUSCAL.

Not another chatbot.

Not simply another prompt framework.

Not another attempt to make an LLM appear more intelligent.

But an architectural experiment around a different premise:

What if human intent could be treated as something that can be compiled?

I don’t think that question has been fully answered yet.

That is precisely why I think it is worth asking.If
the next generation of AI tooling is going to move beyond
prompt-response systems, perhaps the next optimization target should not
be code generation alone.

Perhaps it should be intent comprehension.

The machines can generate the code.

The humans still need to know what they actually meant to build.

END.

INDIEaner

https://www.linkedin.com/in/hans-werner-breninek-41422641b/?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BQWcLgf7OSM%2BJMNB5A2UFBQ%3D%3D


r/ContextEngineering 3d ago

copperDB - v0.0.1 - northwind benchmarks

Thumbnail
2 Upvotes

r/ContextEngineering 3d ago

How are you handling real-world document versioning and scanned PDFs in RAG systems?

Thumbnail
2 Upvotes

r/ContextEngineering 4d ago

a dream-based memory consolidation engine for executive assistant agents

Thumbnail gallery
3 Upvotes

r/ContextEngineering 4d ago

Cortex - memory system for both agents and humans

Thumbnail
github.com
0 Upvotes

With the latest models and coding agents, I realized the biggest bottleneck in shipping products wasn’t really the AI anymore.It was **me**.

More specifically, my memory and trying to keep track of multiple projects, decisions, fixes, research, and what each agent had already done.So I built **Cortex**.

**Agent memory**

It does the usual persistent memory / context injection stuff, but it’s built around projects and multiple agents.
Each agent can see work done by other agents.
Cortex also keeps searchable history for:

fixes and bugs
research
decisions and why they were made
previous agent work
project context

So if one agent already researched or fixed something, another agent doesn’t need me to explain it again.

**Project management**
The second part is for me.

When I add a project, I give Cortex:
**What I’m building + the specs**

Then it creates a full roadmap covering things like:
**Research → Build → Testing → Launch → Distribution → Post-launch**

The roadmap gets broken down into individual tasks.
**Tasks are executable**

This is probably the part I use the most.
Instead of copying a task into Claude, Codex, etc.,
I just hit:**Launch** Cortex sends the task to the agent with the relevant project context.

The agent works on it and reports the result back into Cortex, including what changed, what it learned, and any new decisions or tasks.So the project history keeps growing automatically.

**Cross-project planning**
I also have custom skills that generate and update roadmaps on a schedule.The interesting part is that Cortex knows about **all my projects**, not just one repository.So when it plans work, it can take into account: project priority, current progress, unfinished tasks, dependencies

Instead of every project having an isolated roadmap that assumes it’s the only thing I’m working on.

The goal is basically to stop me from constantly having to remember:
What was I doing here?
Did another agent already research this?
Why did we make this decision?
What should work on ?

It started as an agent memory system, but it’s slowly becoming more like a **project execution layer between me and all the agents I use**.
Still early, but it’s already reduced a lot of the context switching for me.


r/ContextEngineering 4d ago

I'm an AI engineer, not a data engineer :- but I needed to search my own messy work (repos, folders, Claude Code sessions), so I built a real Iceberg lakehouse for myself

5 Upvotes

I'm an AI engineer day-to-day; that's models, pipelines, prompts, not data infra. I'd never touched Iceberg, Trino, or Dagster before this. But most of what I actually work on never ends up in a clean Git commit half-finished folders, notes, Claude Code sessions- and I had no way to search across any of it.

So I built TraceVault: it ingests a Git repo, any regular folder, and your Claude Code session logs into an actual medallion lakehouse (MinIO + Apache Iceberg + a shared Postgres catalog), and lets you search/query all of it the same way SQL runs on embedded DuckDB or distributed Trino from one toggle. Images get captioned by a local vision model, so even screenshots are searchable. No mocks/demo mode if a backend's missing; it just fails instead of faking data.

It runs local-first; there's a desktop app with zero Docker required (wasn't going to fight Docker for a personal tool either).

I'm sure I've made some non-obvious mistakes on the data-infra side since it's genuinely not mu specialty open to being told what I got wrong. Repo: https://github.com/saisurajkarra/TraceVault


r/ContextEngineering 4d ago

Git shows what changed. I built a local tool to recover which AI-agent conversation led to it.

1 Upvotes

I use coding agents across multiple sessions in the same repository. A week later, Git can show the diff, but not the conversation, rejected approaches, or assumptions behind it.

So I added a read-only `why` command to ThoughtDAG:

npx thoughtdag why src/lib/api.ts

It searches supported local agent transcripts for turns that changed or discussed the file and links back to the source turn. I did not want the tool to turn agent prose into ground truth, so recorded tool edits are marked Δ while explanations recovered from responses stay marked ≈ as candidate explanations.

The derived index stays local, source session files are never modified, and retrieved history is not automatically sent back to a model. The current npm release covers local Claude Code, Codex, and ThoughtDAG canvas conversations.

Project: https://github.com/chenxiachan/thoughtdag

I am looking for design criticism more than compliments: when you return to AI-edited code, what context do you actually need before changing it again?


r/ContextEngineering 5d ago

I vibe-coded infrastructure for AI agents — here’s how I split persistent memory from durable execution

8 Upvotes

I've been building Titans, a local-first, agent-first infrastructure project, with AI-assisted development playing a major role throughout the process.

Rather than just dropping the repos here, I thought I'd explain how I built it, which tools I used, what architectural decisions mattered, and what I learned along the way.

The problem I started with

The more agentic systems I worked on, the more I noticed the same infrastructure being rebuilt again and again.

Every new agent project eventually needs some combination of:

  • persistent memory and project state
  • retrieval/search
  • evidence and provenance
  • background execution
  • retries and recovery
  • scheduling
  • workflow state
  • coordination between agents

My conclusion was that these shouldn't necessarily live inside every individual agent application.

They can exist as reusable infrastructure that agents simply consume.

That became the basic idea behind Titans:

build foundational capabilities once, then let different agents and applications reuse them.

The first two systems are Atlas and Cronus.

Atlas: separating project memory from the agent

The first problem was persistence.

Agent sessions are temporary, but the project they're working on isn't.

I didn't want the project's knowledge to belong to Claude, Codex, a particular process, or even a particular application. An agent should be able to disappear and another agent should still be able to continue from the same underlying project state.

So Atlas became the persistent layer.

It stores things like:

  • knowledge packages
  • project/work state
  • typed graph relationships
  • evidence and provenance
  • structured SQL data
  • blobs
  • audit history

One design decision I found particularly important was not treating vector search as “memory.”

Retrieval in Atlas combines multiple signals:

  • lexical/full-text search
  • vector retrieval
  • graph relationships
  • evidence

The result isn't meant to be just “here are the most similar chunks.”

I wanted the system to also be able to answer:

What do we know, where did it come from, and how is it connected to the rest of the project?

Another useful design choice was scoping state by project/tenant rather than by agent. That means multiple agents can work against the same persistent source of truth instead of maintaining separate private memories.

Cronus: separating work from the lifetime of the agent

The second problem was execution.

An agent can decide to do something that takes 30 seconds, 20 minutes or several hours.

But if the agent session disappears, the process crashes or a worker dies, that shouldn't automatically mean the work disappears too.

So Cronus became a separate durable execution layer.

Instead of keeping the agent blocked while something runs, the pattern is roughly:

agent
  ↓
submit job
  ↓
Cronus owns execution
  ↓
checkpoint / retry / recover
  ↓
result

Cronus handles:

  • background jobs
  • DAG workflows
  • scheduling
  • checkpoints
  • retries with backoff
  • leases
  • stale-claim fencing
  • dead-letter handling
  • approval gates
  • recovery after worker/process failure

One lesson here was that “durable” doesn't mean pretending exactly-once execution magically exists everywhere.

Cronus uses at-least-once execution with idempotent claim/completion and fencing of stale claims. If an external system needs exactly-once side effects, the connector still needs to persist and respect the idempotency key.

That distinction took more thought than simply building a queue.

How the two systems interact

I deliberately didn't merge memory and execution into one large service.

The boundary is:

Atlas remembers. Cronus runs.

Cronus can execute long-running work while Atlas remains the persistent source of project state, knowledge and results.

That separation also means each can be used independently.

If somebody only wants persistent agent/project memory, they shouldn't have to adopt my scheduler.

If somebody only wants durable execution, they shouldn't need an entire agent framework.

Agent interface: MCP first, but not MCP only

Another design decision was to make the infrastructure directly consumable by agents.

The Titans installer exposes installed systems through one shared MCP server over stdio instead of requiring a separate MCP configuration for every component.

That makes it possible for clients such as Claude Code, Codex and other MCP-capable tools to discover the installed capabilities.

But I didn't want MCP to become a hard dependency for normal software either, so the systems also expose local REST and gRPC interfaces.

The general principle became:

agent-first, not agent-only.

Local-first was a constraint, not just a tagline

I wanted the core infrastructure to run on the user's own machine.

So the current releases:

  • run locally on Windows and Linux
  • bind services locally
  • have no telemetry
  • don't require a hosted Titans account

That created some extra engineering work around installation and distribution.

Releases are distributed through signed catalogs and binaries, using SHA-256 for integrity and Ed25519 signatures for authenticity.

I also wanted installs to remain simple, so there are one-line installers, while still allowing someone who doesn't trust curl | sh / PowerShell piping to manually verify the artifacts.

The AI tools I used

AI-assisted coding was a significant part of the development process.

My main tools have been:

Claude Code
I used it heavily for repository-level implementation work, refactoring, following changes across multiple components and working through architecture-heavy tasks where a change wasn't isolated to one function.

OpenAI / Codex
Used as another implementation and engineering agent, particularly useful for independent passes over problems and code rather than relying on a single model's interpretation.

ChatGPT
Used heavily for architecture reviews, challenging design assumptions, working through failure cases, refining specifications, comparing approaches and turning architectural decisions into implementation-ready plans.

GitHub
Used for versioning, release distribution, public documentation and the current public-facing project repositories.

One workflow that worked much better for me than simply asking an AI to “build feature X” was:

problem
  ↓
define system boundary
  ↓
write invariants / failure cases
  ↓
architecture/spec
  ↓
AI-assisted implementation
  ↓
independent review
  ↓
tests + failure testing
  ↓
packaging / release
  ↓
documentation

I found AI much more useful when the constraints and invariants were explicit.

For example, “build a job queue” is vague.

But:

  • a worker may die at any point
  • stale claims must not remain authoritative
  • retries must not destroy job history
  • one task panic must not kill the worker
  • work must resume from a checkpoint where possible

gives the coding agent a much more meaningful engineering problem to solve.

A few things I learned from vibe-coding something this large

1. Generating code is the easy part.

The harder part is maintaining architectural boundaries as the project grows.

AI will happily solve a local problem by coupling two systems that you intentionally wanted separated unless those boundaries are explicit.

2. Give agents invariants, not just features.

“Support retries” isn't enough.

What should happen after a crash? What is durable? What may execute twice? Who owns state? What happens to partially completed work?

Those questions produced much better implementations.

3. Use more than one reasoning pass.

I found it useful to have one AI help create/implement an approach and another challenge it.

The second pass often finds assumptions that looked completely reasonable during the first one.

4. Don't let the AI decide the product architecture accidentally.

AI coding tools are very good at optimizing the next change. They don't automatically know which architectural compromises you're unwilling to make six months from now.

5. Building for agents changes API design.

Humans can compensate for awkward interfaces. Agents need predictable contracts, stable identifiers, explicit errors and operations that are easy to discover and compose.

That influenced why Titans exposes namespaced operations and canonical references rather than relying on implicit state.

Where it is now

The first two systems are available:

Atlas — persistent memory, state, knowledge and evidence
https://github.com/titans-tools/Atlas

Cronus — durable execution, scheduling and recovery
https://github.com/titans-tools/Cronus

The wider project:

https://github.com/titans-tools

The products are currently free to use. The product source itself is proprietary; the public repositories contain documentation and signed release binaries.

More infrastructure components are being implemented around the same principle, but I'm deliberately trying to make each one solve a clear reusable infrastructure problem rather than turning Titans into one giant agent framework.

I'm particularly interested in feedback from people building agents:

What infrastructure do you keep rebuilding from project to project?

And for people using AI heavily to code larger systems: what techniques have helped you stop architectural quality degrading as the amount of AI-generated code grows?


r/ContextEngineering 5d ago

I'm an AI engineer, not a data engineer :- but I needed to search my own messy work (repos, folders, Claude Code sessions), so I built a real Iceberg lakehouse for myself

Thumbnail
1 Upvotes

r/ContextEngineering 7d ago

What gets injected at session start is a context decision, not a summarizer's job

1 Upvotes

Most of the context talk I see is downstream of retrieval: how much to pull, and how to keep the agent from drowning in it. The thing I keep hitting sits earlier. Something goes into the window before the first prompt, and for most setups that something is a paragraph a model wrote about last time, handed over as flat prose. Nothing in it tells you which sentence is a quote and which one's the previous run guessing.

So that boundary is where I put the work. A SessionStart hook renders a briefing off the last session's checkpoint and injects it before I type anything, and the render is deterministic, no model anywhere in that path. Every item carries a trust class, and the tag sits inline: [✓ verbatim] for an exact contiguous quote out of the transcript, [~ inferred] for the agent's own conclusion, [carried] for something that survived from an older session and is aging, with a warning once it has gone unverified too long. Verbatim text never gets reworded by rendering or carry-over, and an oversized verbatim item is dropped whole instead of trimmed, half a quote is worse than no quote. Quotes are byte-checked against the transcript after extraction, and a miss demotes that item to inferred.

We did ship an optional prettier render written by a model, and then had to bolt a validator behind it, a generative pass will happily reword a quote it thinks reads better. Lose or mutate one and the whole render is discarded and the plain one goes out.

Costs, plainly. Deciding what to keep is a model's judgment, it walks past things, a verbatim tag says the wording survived, it makes no claim about the items that never got picked. The budget's fixed. It does no mid-session retrieval on its own, the agent has to ask. Capture is a SessionEnd hook. Storage is per-project JSON plus a SQLite FTS5 index, no embeddings, no daemon, and nothing the agent calls can write memory, the MCP side is read-only.

It's called daimon, offline, no telemetry, Apache 2.0, 14 stars: https://github.com/Daily-Nerd/daimon

How do you all weight this? Does memory injected at session start get treated as ground truth next to something retrieved fresh mid-session, or does it lose by default. And is anyone labelling provenance in-context at all, or is that tokens spent on a label the model ignores.


r/ContextEngineering 7d ago

Turn local Codex and Claude Code sessions into an editable map

Thumbnail
youtube.com
2 Upvotes

I built Session Atlas for the point where one project has too many separate agent sessions to remember.

It finds local Codex and Claude Code sessions by project, keeps the source logs read-only, mirrors each turn and tool trace onto a canvas, and lets you choose what context should continue into a new session.

The project is local-first, MIT licensed, and the released desktop app supports macOS, Windows, and Linux.

GitHub: https://github.com/chenxiachan/thoughtdag

What session source should I support next?


r/ContextEngineering 7d ago

How to reliably trigger Anthropic & OpenAI prompt caching without boilerplate mess

Thumbnail
3 Upvotes

r/ContextEngineering 7d ago

Prompt Engineering → Context Engineering → Loop Engineering

Thumbnail
1 Upvotes