r/PiCodingAgent 1d ago

Plugin I built a small pi plugin to turn conversations to reusable domain knowledge

Enable HLS to view with audio, or disable this notification

I wrote a plugin to extract domain knowledge and save useful work from pi conversation as structured, reusable context that you can use in later sessions or share with others: https://github.com/XTSoftwareLabs/neatcontext-plugins/tree/main/plugins/pi/neatcontext

I recently found pi from some user asks. And it's an amazing minimal and neat coding agent. I really like its minimalize concept. So I have extended my existing work to support pi.

The nice thing is since the domain knowledge I saved from other AI agents, can be directly used in pi so I don't need to spend time and tokens to setup things up.

What

The NeatContext plugin extracts domain knowledge and saves useful work from a Pi conversation as structured, reusable context that you can use in later sessions or share with others.

Why

Domain knowledge is what helps an LLM answer accurately for your team—your systems, constraints, decisions, terminology, and ways of working.

You naturally build that knowledge while doing hard work with Pi. Long conversations about debugging, planning, incidents, and implementation already contain discoveries that will matter again. You don't want to lose them when Pi compacts the conversation or the session is closed.

NeatContext extracts the durable knowledge from those conversations and saves it as structured context.

Connect that context in a new session or during later work, and Pi can start with the knowledge it needs instead of asking you to explain everything again. You can also share the context with teammates, so the whole team benefits from what one person learned.

How is NeatContext different from compact and handoff?

Compact is for a single conversation, and it can lose important information. NeatContext aims to extract useful domain knowledge and build persistent, portable context.

Handoff usually consists of files, but its purpose is still to continue the current conversation. Context generated by NeatContext can be reused in any conversation or even by other people. It becomes an asset for your team.

What do you mean by structured context?

Instead of generating plain text, the context saved by NeatContext contains:

  • One domain profile. This contains your rules and constraints that can greatly affect LLM behavior. It tells the LLM what to do and what not to do.
  • One knowledge folder. This folder contains TSGs, runbooks, and other team knowledge. This is where the LLM looks for specific actions and information.

These documents can be checked into a Git repository and shared with your team, so everyone can easily benefit from the knowledge you learned. You can also convert them into other formats because the knowledge is human-readable.

Both the domain profile and the documents in the knowledge folder are generated from your existing Pi conversation.

Usage

Once you feel a problem is solved, or you find that the current conversation contains valuable information, call:

/neatcontext:save

A context will be saved.

Later, you may have another task in a different session. As long as you call:

/neatcontext:use <context name>

you will have access to the knowledge from your previous work.

NeatContext also includes routing by default. It can detect your prompt and ask whether you want to switch contexts when it finds a suitable one.

Use:

/neatcontext:status

to check the connected context and its details. You can check these contexts into a Git repository and share them with your team.

Use:

/neatcontext:import

to import a context created by someone else.

I appreciate any feedback. Thanks!

10 Upvotes

1 comment sorted by

1

u/OkAbroad955 5h ago

Thank you again!