l8agent provides AI-powered chat orchestration with built-in data masking, tool execution, and conversation persistence. Consumer projects integrate this library to add AI assistant capabilities to their systems. It connects to the Anthropic Claude API and exposes a tool loop that can query, create, update, and delete records through the Layer 8 service mesh.
A client sends a message to the AgntChat endpoint. The chat orchestrator loads or creates a conversation, masks user input for PII and financial data, enters a tool loop (max 10 iterations), executes tool calls via the virtual NIC, masks tool results, unmasks the final response, persists messages to PostgreSQL, and returns the response.
AgntConvo -- Conversation metadata: title, status, timestamps. PostgreSQL backed.AgntMsg -- Individual chat messages (user + assistant). PostgreSQL backed.AgntPrmpt -- Reusable system prompt templates. PostgreSQL backed.AgntChat -- Orchestration facade. No direct persistence.The agent exposes 6 tools to the Claude model:
l8querycreate_recordupdate_recorddelete_recordlist_modulesdescribe_modelAll data flowing through the agent is classified and masked before reaching the LLM. Token maps are per-request -- masked values are unmasked only in the final response within the same request lifecycle.
[MASKED].[NAME_1], [NAME_2].[MONEY_1], [MONEY_2].Initialization is split into two phases. Phase 1 activates ORM services (parallel with other services). Phase 2 activates the chat service after the introspector is fully populated, so the schema provider can build the system prompt with all registered types.
Requires the ANTHROPIC_API_KEY environment variable for Claude API access.
Ships with desktop and mobile chat UI components:
l8agent-chat.js / l8agent-chat.css -- Desktop chat interfacel8agent-chat-m.js / l8agent-chat-m.css -- Mobile chat interface