🤖 Note to AI Assistants: This document serves as the primary architectural mapping for the repository. When ingested via the context generator, use this document to understand module boundaries, data structures, and permission models before modifying code.
The Open Neuromorphic bot suite is a distributed system of specialized bots built on a shared context and pipeline framework. It serves three distinct organizational roles:
- Scribe (Knowledge & Reporting): The AI Context Engine. A retrieval and summarization system that turns the org's raw operational history (meeting transcripts, Discord logs) into queryable context, governed by a human-in-the-loop review queue.
- Content Ops (GitHub & Events): Project management, event calendar synchronization, and automated GitHub PR generation.
- Research (arXiv Pipeline): The ONR (Open Neuromorphic Research) listener, which tracks, scores, and facilitates community peer-review of incoming open-source neuromorphic papers.
Because outputs from this system inform governance and public documentation, the "how it works" sections below describe the exact mechanisms. AI-generated conclusions never silently become organizational record.
The repository strictly separates Discord UI, Data Pipelines, API wrappers, and data models:
cogs/- Discord UI Layer: Discord slash commands, interactive UI views, and modals. Defers business logic to pipelines.context_engine/- Data & Storage Layer: Manageslibrary.json, reads sources from disk, redacts secrets, and compiles Markdown bundles.core/- Application Lifecycle: CentralizedONMBotclass andmanifest.py(which defines the multi-bot routing and scopes).models/- Pydantic Schemas: Strong typing for the library, GitHub API, LLM requests, ONR tracking, and meta ledgers.pipeline/- Heavy Processing: Orchestrates ingest (GitHub, Discord, Fathom, arXiv), summarization (LLM digests), PR automation, and ONR state management.services/- External APIs: Wraps LLM routing (llm.pywith local/cloud fallback), caching, GitHub API, and Google Calendar.steps/- Google Workspace Subsystem: Standalone tools for auditing Google Docs revisions, comments, and emails.ops/- CLI Tooling: Standalone maintenance, syncs, review queues, and the main system control panel (main.py).utils/- Shared Helpers: Role checks, template rendering, and interactive UI session management (menu_framework.py).
The bot suite uses interactive UI dashboards and slash commands. Access is strictly governed by config.OPERATION_ROLES.
The easiest way to interact with the bots is through their interactive UI panels, which provide paginated, context-aware controls:
| Command | Bot | What it does | Permission |
|---|---|---|---|
/onm-scribe |
Scribe | Opens the Context Engine dashboard. View index stats, request bundles, run the summarizer, or process the AI Ledger review queue. | ec_admin |
/onm-content-ops |
Content Ops | Opens the GitHub Projects module. Browse active issues, generate PR drafts, and push to staging/production interactively. | volunteer_technical |
/onm-research |
Research | Opens the ONR Explorer. Browse recent arXiv discoveries, monitor active community discussion threads, and review paper metrics. | volunteer_technical |
| Command | What it does | Permission |
|---|---|---|
/onm-context build |
Compiles a full Markdown context bundle (logs + transcripts + GitHub docs) and DMs it or saves it to disk. | ec_admin |
/onm-context digest <source> <month> |
Retrieves a previously generated monthly digest. | ec_admin |
/onm-context thread-status |
Looks up organizational threads from the AI-generated Threads Ledger. | ec_admin |
/onm-context who-is <name> |
Looks up a person in the Entity Glossary to reconcile transcriptions, Discord handles, and real names. | ec_admin |
| Command | What it does | Permission |
|---|---|---|
/onm-pr preview <issue> |
Asks the LLM to draft a Hugo content page from a GitHub issue, using repo archetypes as guardrails. Pushes to Staging. | volunteer_technical |
/onm-pr set-images |
Overrides the vision model's logo/image selection for a PR draft. | volunteer_technical |
/onm-pr approve <draft> |
Pushes the approved draft's branch to Staging and opens a cross-repo PR to Production. | volunteer_technical |
/onm-event-setup |
Creates synchronized Google Calendar and Discord scheduled events, providing Markdown copy-paste for Hugo. | volunteer_technical |
| Command | What it does | Permission |
|---|---|---|
/onr recent |
Scans and lists recent open-source arXiv papers matching ONM criteria. | All |
/onr submit <url> |
Manually submits an arXiv paper to the QA pipeline for community review. | All |
/onm-ident-link <platform> <url> |
Initiates secure linking of a Discord handle to a real identity/social profile for publication attribution. | All |
/onm-ident-verify |
Admin command to verify an identity linking challenge. | ec_admin |
Scribe features commands like /onm-top-contributors-report, /onm-role-analysis-report, /onm-channel-topics-report, and /onm-generate-activity-digest to build text/CSV files of server state independent of the Context Engine.
Everything the bot can reason about must become a LibraryEntry in library.json. The engine processes:
- Sources: Discord logs, meeting transcripts, GitHub docs.
- Summaries: LLM-generated summaries to save token space.
- Ledgers: AI-proposed organizational updates (
threads_ledger.json).
Verification Control: When the monthly digest pipeline detects a change relevant to a strategic thread, it appends a proposal to meta/pending_review.json. A human must run the Review Queue (via /onm-scribe or CLI) to explicitly Accept or Reject the change. AI summarization never silently alters the institutional memory.
The bot routes opportunistically. services/llm.py always attempts to hit the local llama.cpp server (default http://127.0.0.1:8080) first.
- If the local server is running but times out, it falls back to the Gemini API.
- If the local server is offline, it instantly and silently falls back to the Gemini API.
- Vision Exception: Multimodal requests (e.g., PR image validation) are routed directly to Gemini, bypassing local text-only models.
See ops/tray_app.py for the exact llama-server invocation parameters used for staging.
main.py is the terminal control panel for system administration:
- Launch/Restart Master Service: Restarts bots via
systemctl --useror local PID tracking. - Compile Context Bundle: Dumps this repo's source code for AI analysis.
- Unified Sync: Syncs live Discord data, GitHub docs, and transcripts to
library.json. - Run Monthly Digest / Summarizer: Dispatches the LLM to process raw logs.
- Review AI Proposed Updates: The human-in-the-loop CLI for ledger approval.
Configuration is managed via .env (secrets) and bot_config.json (tuning). Key variables:
| Variable | Purpose |
|---|---|
DISCORD_TOKEN_SCRIBE, _CONTENT_OPS, _RESEARCH |
Individual bot tokens. Fallback is DISCORD_BOT_TOKEN. |
GEMINI_API_KEY |
Cloud LLM fallback authentication. |
GITHUB_TOKEN, GITHUB_TOKEN_BOT |
Read (docs) and Write (PR creation) GitHub permissions. |
EC_ADMIN_ROLE_IDS, VOLUNTEER_TECHNICAL_ROLE_IDS |
Comma-separated Discord Role IDs for clearance levels. |
- Fathom Integration is stubbed:
FathomApiClientlogic currently raisesNotImplementedError. Transcripts must be supplied manually to the disk schema. - ONR arXiv Scraping Limits: The arXiv pipeline respects a hard cap on polling to avoid
429 Too Many Requests. Syncs run on a configured hourly interval.