-
Notifications
You must be signed in to change notification settings - Fork 3
Core AI Employees
Scope note: this page documents
ragleap-core's engine (core/,channels/), not theragleap-rag/ragleap-graphpip packages covered by the rest of this wiki. See Home for the packages wiki index.
Nine role-based AI agents (manager, secretary, CEO, sales, support, HR, finance, marketing, operations), each with its own personality and its own persistent, learned memory — single-tenant, BYOK, open in this repo since #130/#133.
Not a static system prompt per role. Each role has:
- A personality — a fixed instruction block defining tone and focus
-
Role-scoped context — retrieved from a real pgvector-backed memory store (
employee_memorytable), combining owner instructions, business profile data, and learned patterns from past interactions - A business profile — owner-fillable fields (description, products, tone, language) plus an auto-learned summary that rebuilds from activity over time
POST /chat?question=&role=support
When role is set, core/chat.py's _build_system_prompt() layers the role's personality and context on top of the standard grounding instructions — it doesn't replace them, so citation/no-hallucination behavior is preserved regardless of role.
A model's recency bias in long prompts means an instruction stated once near the top is often ignored in favor of instructions near the actual question. The fix (core/chat.py's _augment_query_with_reminder()) appends a short reminder directly onto the query text sent to generation — separate from the query used for embedding/retrieval. Full debugging writeup: Discussion #137.
| File | What it does |
|---|---|
core/employees/defaults.py |
9 default roles, personalities, starter memory seeds |
core/employees/profile.py |
Single-row business profile (get/update/auto-learned) |
core/employees/roles.py |
Role CRUD, seeded on first /employees call |
core/employees/memory.py |
pgvector-backed learned memory — semantic + tag search, DB-level dedup |
core/employees/skills.py |
Role-scoped context retrieval for prompt injection |
core/employees/learning.py |
Every learn_from_* entry point + auto_learn_from_all()
|
| Route | Purpose |
|---|---|
GET /employees |
List roles (seeds 9 defaults on first call) |
GET /employees/{role} |
Get one role |
PATCH /employees/{role} |
Update a role's personality/channels/etc. |
GET /employees/{role}/context |
See exactly what context a role would inject — useful for debugging |
GET /profile |
Get the business profile |
PATCH /profile |
Update owner-filled fields |
POST /profile/learn |
Manually trigger a profile rebuild from current activity |
Multi-tenant per-workspace seeding, and integration with Manager AI (not yet open — see ROADMAP.md).