The G-Brain Company Brain Primitive: continuously compiles Slack, Jira, and Gmail into an executable, conflict-resolved operational state for AI agents.
Project description
ain-state-compiler
The G-Brain Company Brain Primitive: continuously compiles Slack, Jira, and Gmail into an executable, conflict-resolved operational state for AI agents.
Overview
The ain-state-compiler operates 100% offline at the source level, parsing and aggregating enterprise communication and issue-tracking streams to produce internally consistent state representations. It prevents AI agents from executing against stale, fragmented, or conflicting corporate knowledge.
Key Outputs
- Institutional Memory Modules (IMMs): Markdown-based, human- and machine-readable state snapshots.
- Operational Execution Graphs (OEGs): Optimized YAML topologies representing resolution paths.
- Active Conflict Reports: Discrepancy matrices identifying contradictions between engineering, marketing, and support data.
Installation
pip install ain-state-compiler
Usage
from ain_state_compiler.compiler import StateCompiler
# The project directory should contain a 'mock_data' folder with slack_history.json, jira_issues.json, and emails.json
compiler = StateCompiler(project_dir="/path/to/project")
summary = compiler.compile()
print(f"Processed {summary['processed_slack_events']} Slack events.")
print(f"Detected {summary['detected_conflicts']} active state conflicts.")
Core Architecture
"Ponytail" Lazy Gatekeepers
Internalizes the spirit of the "lazy senior dev" reductionist mindset directly into the core architecture:
- LazyStateFilter: A strict deterministic "No-Op" filter that drops incoming data if it does not meaningfully mutate the operational state.
- StateReuseEngine: Scans a historical cache of previously resolved conflicts. If a highly similar transformation exists, the compiler clones and adapts rather than generating from scratch.
- StateCompilerEngine: Enforces rigid bounds (
max_tokens, length limits) on LLM compilation passes, aborting cleanly to naive primitives if structural code bloat occurs.
Conflict Detection & Optimization
- ConflictDetector: Runs rule-based, deterministic logic to spot discrepancies before invoking generation.
- TokenOptimizer: Compresses verbose JSON state outputs into highly dense YAML representations, minimizing token footprint for downstream agent ingestion.
Changelog
v0.9.0 (Current)
- LLM-Native Retrieval Revamp: Shifted away from raw Markdown context dumps to token-efficient Retrieval-Augmented Generation (RAG).
- FTS5 Fast Search: Extracted tight, context-rich snippets (truncated to scale) instead of unbounded document loads.
- MCP Server: Added
mcp_server.pyusingFastMCPexposingsearch_ain_contextandsearch_ain_by_tagto tools like Claude Desktop and Codex. - Native Ollama Tools: Added
ollama_plugin.pyto route local queries securely through tool-calling pipelines.
v0.8.3
- Rebranding: Updated GitHub URLs and package author metadata to That-Tech-Geek.
v0.8.1
- Ponytail Architecture: Introduced
LazyStateFilter,StateReuseEngine, andStateCompilerEngineprogrammatic gatekeepers. - State Minimization: Implemented deterministic noise filtering and semantic hash comparisons to prevent unnecessary compilation.
- Token/Complexity Penalties: Set rigid metric constraints for generative compilation steps to minimize complexity.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ain_state_compiler-0.9.0.tar.gz.
File metadata
- Download URL: ain_state_compiler-0.9.0.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa43d098c0190f2017334d69959f68260b1a30bd3604edcbfc98e823463cf67c
|
|
| MD5 |
729530af7d587d8f649f5ba68a8d14b1
|
|
| BLAKE2b-256 |
3ea09db729a1cf2205d3d76f457048c957795dcbec4342d3eafd07250505d4e4
|
File details
Details for the file ain_state_compiler-0.9.0-py3-none-any.whl.
File metadata
- Download URL: ain_state_compiler-0.9.0-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d66f2507bc190c3eae950ad4b207aec05edb5831b69e3526d2db08c78bfbb8e
|
|
| MD5 |
38cbb65879aa889f49ed1f3ef6ebe7ec
|
|
| BLAKE2b-256 |
d2e8f3ec1215ff799a5672a465de9f0d8e82d21c5a29b2acf86e3d36c1502817
|