@mp-lb/agents-framework
v0.4.5
Published
Langfuse-backed agent definitions, boot-time prompt caching, typed tools, and inspectable agent metadata.
Downloads
1,507
Maintainers
Readme
@mp-lb/agents-framework
Backend-resolved agent definitions and runtimes for MAP Lab apps.
Code owns the agent contract: agent ids, instruction prompt keys, input prompt keys, required variables, tools, runtime context, and inspectable metadata. The configured backend owns prompt storage, LLM calls, tracing, and prompt/run metadata.
const agents = createAgentRuntime({
app: "instantagent",
environment: "local",
backend: langfuseBackend({
llm: openAICompatibleLlm({
apiKey: process.env.OPENROUTER_API_KEY,
baseUrl: "https://openrouter.ai/api/v1",
model: "openai/gpt-5.5",
}),
}),
agents: [conciergeAgent],
});
await agents.boot();
const result = await agents.run("concierge", {
context: {
PRODUCT_NAME: "InstantAgent",
userMessage: "Can you check this lease?",
},
});Use prompt(...) for backend-resolved instruction and input templates:
export const conciergeAgent = defineAgent({
id: "concierge",
name: "Concierge",
instructions: [
prompt("instantagent/concierge-system", {
variables: ["PRODUCT_NAME"],
}),
],
input: prompt("instantagent/concierge-input", {
variables: ["userMessage"],
}),
tools: [lookupPolicy],
});