Best Practices for Building with Memex

Master the art of "agent engineering"—the skill of getting the most out of your AI development partner.

Understanding Agent Engineering

Just like "prompt engineering" helps you get better results from language models, "agent engineering" is a set of best practices to maximize your success with Memex. While Memex is powerful and intuitive, following these practices will significantly improve your outcomes, especially for complex projects.

Agent engineering is about designing thoughtful interactions with AI systems to ensure they operate reliably, efficiently, and successfully. Even as AI models become more sophisticated, these practices help guide them toward the results you want.

The Five Pillars of Successful Building

1. Separate Planning from Execution

Before diving into code, make sure you have clear requirements. If your project needs are still forming, start with collaborative planning:

I'm not sure about all the requirements for my project. I want to build a data dashboard for my team, but I need help working through the details. Don't start building until I give you the go-ahead.

Use Plan Mode to work through requirements systematically. This mode acts like an experienced technical product manager, asking the right questions and helping you scope appropriately.

2. Build Incrementally

The most common mistake is asking for too much at once. Break your project into small, achievable steps:

Instead of this:

Try this approach:

Then continue step by step:

This incremental approach has multiple benefits:

  • Higher success rate for each step

  • Easier to debug when issues arise

  • Natural checkpoints to save progress

  • Flexibility to change direction based on results

3. Verify Understanding Before Making Changes

When working with existing code, always ensure Memex understands the current system before asking for modifications.

The wrong approach:

The right approach:

This pattern is crucial for success with existing codebases. Just like human developers study code before modifying it, Memex needs guided exploration to understand how things work.

4. Manage Task Execution

Some tasks require multiple iterations. Instead of micromanaging every step, you can give Memex more autonomy:

For ongoing work:

For quick iterations:

When things get complex:

5. Handle Errors Effectively

When Memex gets stuck or makes mistakes, use these recovery strategies:

For spinning wheels or repeated failures:

For dependency or environment issues:

For complex debugging:

Common Success Patterns

a. The MVP-First Pattern

Always start with the minimum viable version:

  1. Core functionality only

  2. Add one feature at a time

  3. Enhance the user experience

b. The Context Pattern

For projects you'll return to later:

This helps with:

  • Context for future conversations

  • Onboarding team members

  • Maintaining project knowledge

c. The Version Control Pattern

Establish good practices early:

Regular commits create safety nets and clear progress markers.

d. The Testing Pattern

Build confidence in your code:

Debugging and Recovery Strategies

When Memex Says It Can't Do Something

"I need sudo privileges":

"I can't execute code on your machine":

"I don't have access to the latest API documentation":

When Data or Dependencies Are Missing

Missing datasets:

Dependency conflicts:

Interactive CLI tools:

When Projects Get Complex

Lost in complexity:

Performance or design issues:

Advanced Techniques

Context Management for Large Projects

As projects grow, help Memex maintain context:

Multi-Conversation Projects

When starting new conversations in existing projects:

Custom Instructions for Consistency

Set project-specific guidelines in your Custom Instructions:

Common Anti-Patterns to Avoid

1. The "Do Everything" Anti-Pattern

Don't ask for complex, multi-part applications in a single request. Break them down.

2. The "Too Specific" Anti-Pattern

Avoid being overly prescriptive about implementation details unless you have specific constraints.

3. The "No Verification" Anti-Pattern

Always ask Memex to test and verify its work rather than checking everything manually.

4. The "Context Overload" Anti-Pattern

Don't dump massive amounts of context at once. Introduce complexity gradually.

5. The "No Progress Saves" Anti-Pattern

Don't forget to commit working versions. Use git to create checkpoints at logical milestones.

Measuring Success

Good agent engineering leads to:

  • Higher success rates for complex tasks

  • Fewer iterations needed to achieve goals

  • More maintainable project outcomes

  • Better project continuity across conversations

  • Reduced frustration with debugging and errors

Community and Learning

  • Share your own patterns in our Discord community

  • Learn from others' approaches and contribute your discoveries

Remember: agent engineering is a skill that improves with practice. Start with these patterns, experiment with your own approaches, and don't hesitate to ask the community for advice when you encounter new challenges.

Last updated

Was this helpful?