In a world where privacy increasingly seems like an afterthought, Our Own AI's "Cognitive Management Framework" represents empowerment and control for users.
The OOAI Cognitive Management Framework is an open-source project that aims to empower individuals by democratising access to AI-powered messaging at scale. By leveraging decentralised architectures and prioritising user privacy, OOAI seeks to create a more equitable and transparent ecosystem where users, rather than corporations, control their digital identities.
OOAI builds upon the foundation laid by the BigBot project, repurposing proven technologies and lessons learned to bridge the gap between the promise and the reality of AI in the web3 era. For more information on the project's background and motivation, refer to the Whitepaper, Section 1.3.
The framework offers a range of innovative components, including:
- PII Handler for privacy protection
- Intelligent communication systems for efficient messaging
- Personalised event recommendations for enhanced user experiences
- Adaptive learning mechanisms for continuous improvement
These features work together to create a platform that prioritises digital privacy while delivering personalised, intelligent user experiences. For an overview of the project's key components, see the Light Paper.
OOAI's library of modules is a work in progress, and we will soon be accepting code contributions focused on hardening the following capabilities for production runtimes:
- Data exchange
- Message processing
- APIs
- Learning optimisation
- Natural language binding defaults
By contributing to these core features, developers can help solidify OOAI's position as a comprehensive, user-centric platform for building sophisticated conversational AI and data-driven applications.
We invite developers to join us in our mission to democratise AI and empower individuals in the web3 era. By collaborating on this open-source project, we can create a future where decentralised architectures, user-centric design, and intelligent systems converge to provide secure and equitable digital experiences for all.
Central to OOAI's mission of returning data ownership to users is the PII Handler, a sophisticated module designed to identify, manage, and protect Personally Identifiable Information (PII). This technology ensures that users can interact with digital services without surrendering their privacy.
Key Functionalities:
- Pattern Recognition and Redaction: Utilising advanced regular expressions, the PII Handler can identify a wide range of PII types within text data, from email addresses and phone numbers to more sensitive information like social security and credit card numbers. Once identified, these data points can be redacted, preserving user privacy.
- Customisation for User Control: Beyond predefined patterns, the PII Handler supports extensive customisation. Users can define their own PII patterns and specify how identified information should be redacted, tailoring the balance between privacy and functionality to their individual preferences.
The framework's messaging, classification, and routing system demonstrates OOAI's commitment to not only privacy but also to creating intelligent and efficient communication pathways.
Key Features:
- Natural Language Understanding: By leveraging the spaCy library for natural language processing, OOAI can analyse messages, extracting and understanding entities and intents. This allows the framework to categorise messages accurately based on their content and context.
- Dynamic Message Routing: With its advanced classification capabilities, OOAI ensures messages are routed to the appropriate destinations, whether they're Kafka topics or MQTT channels. This process is governed by user preferences and rules, maintaining the user's control over their data and how it's shared.
At the intersection of privacy and personalisation, the RecommendHandler module stands out. It exemplifies how OOAI uses data responsibly to enhance user experiences through tailored event recommendations.
How It Works:
- Graph-Based Event Discovery: Leveraging a Neo4j graph database, the system can identify events aligned with the user's interests and preferences without compromising their privacy. This approach ensures recommendations are both relevant and respectful of the user's data sharing choices.
- Configurable Recommendation Engine: The recommendation process, encompassing event recall, filtering, and sorting, is highly configurable. Users can set their own parameters, defining how events are recommended based on proximity, preferences, and other factors.
OOAI's approach to continuous improvement and adaptation is encapsulated in the "run_reinforcement_learning" function. This feature harnesses the power of reinforcement learning to optimise the conversational AI's interactions and decision-making processes based on user feedback.
Technical Insights:
- Q-Learning Algorithm: At the core of this process is a Q-learning agent, tasked with navigating the "UserGraph" — a complex structure representing the states (user scenarios) and actions (AI responses) possible within the conversational AI system.
- Adaptive Learning Loop: The learning loop is where the magic happens. The agent selects actions, simulates outcomes, receives feedback, and updates its knowledge base (Q-values). This loop is fine-tuned through an adjustable exploration rate, ensuring the AI balances between exploring new strategies and exploiting known successful paths.
- Early Stopping and Progress Monitoring: To ensure efficiency, the learning process includes an early stopping mechanism, halting the loop when improvements plateau. Throughout, key metrics are logged, allowing developers and stakeholders to monitor progress and tweak parameters as needed.
One of the framework's standout features is its ability to automatically generate and suggest chart types based on user inputs and data schemas, blending Natural Language Processing (NLP) and knowledge graphs to interpret user requests and visualise data effectively.
Key Components and Workflow:
- QueryMapping and Utterance Processing: At the forefront, the QueryMapping struct and utterance_to_query_mapping function work together to analyse user utterances, extracting entities and slots that detail the user's data visualisation needs. This process relies on spaCy's NLP capabilities to parse natural language into structured queries.
- Dynamic Query Generation and Chart Suggestion: Following analysis, generate_query_from_mapping crafts a GraphQL query to fetch suitable chart suggestions and data fields from a knowledge graph. This ensures recommendations are tailored to the user's specific context and requirements.
- Data Preparation for Visualisation: Once chart suggestions are retrieved, the prepare_data_for_chart function organises data according to visualisation needs, leveraging structs like DataBin and ChartPlot to ready data for rendering.
- Integration with Bokeh for Rendering: Utilising the bokeh_bindings::plot_figure function, OOAI seamlessly interfaces with the Bokeh charting library, bringing the suggested charts to life. This step epitomises the framework's capacity to turn abstract user desires into concrete, insightful visual representations.
OOAI introduces a sophisticated system for creating, managing, and executing various types of blocks and skills, ensuring conversational AI can adapt and respond to user inputs dynamically.
Core Features:
- Versatile Block Management: The system uses the Warp framework to establish HTTP endpoints for block creation, handling everything from skill execution blocks to data processing and visualisation blocks. This modular approach allows for the flexible composition of conversational AI responses.
- Asynchronous Skill Processing: Through traits like SkillProcessor and structures such as SkillExecutor, OOAI facilitates the asynchronous processing of skills. This capability ensures the AI can manage complex dialogues and tasks efficiently, scaling to user demands.
- ChannelState and OAuth Integration: State management via ChannelState and components like OAuthComponent illustrate the framework's readiness to handle nuanced interaction scenarios, including secure authentication and personalised content delivery.
Addressing the critical need for secure and decentralised data storage, OOAI leverages the InterPlanetary File System (IPFS) for encrypting and uploading files, reinforcing user privacy and data sovereignty.
Implementation Highlights:
- Encryption Before Upload: The handle_upload function encapsulates the process of encrypting file data before its storage on IPFS, ensuring data security and privacy.
- Asynchronous IPFS Communication: Through non-blocking uploads and advanced error handling, OOAI ensures efficient and reliable file storage, even for large datasets.
- Metadata Management for Access Control: Metadata storage capabilities facilitate access control and lifecycle management of uploaded files, aligning with the framework's commitment to user control over personal data.
Integrating reinforcement learning, OOAI optimises conversational AI based on user interactions, employing a QLearning
Agent to refine decision-making and enhance user experiences over time.
Advanced Learning Mechanisms:
- Experience Replay and Eligibility Traces: These features enable the AI to learn from past interactions more effectively, speeding up the convergence to optimal response strategies.
- Softmax Action Selection: Moving beyond simple exploration strategies, softmax action selection allows for a more nuanced approach to learning, balancing between known strategies and new possibilities.
OOAI's capacity to evaluate event significance through the EventSignificance struct ensures that conversational AI can prioritise responses and actions based on the relative importance of events, enriching user interaction and operational efficiency.
Functional Overview:
- Dynamic Significance Calculation: By assessing events based on their types and attributes, OOAI can dynamically allocate attention and resources, ensuring users receive timely and relevant responses to significant occurrences.
The framework's secure messaging module, leveraging technologies like Ockam, MongoDB, Kafka, and UDP, establishes end-to-end encrypted communication channels, guaranteeing the confidentiality and integrity of user conversations.
Security and Efficiency Core to Communication:
- Encrypted Message Handling: With specialised workers for encryption, decryption, and key exchange, OOAI ensures that every message is securely transmitted and stored, maintaining user privacy at every step.
At the core of the framework's data handling capabilities is the BigBot Data Exchange module, designed for high-performance, asynchronous message processing. It employs CloudEvents for standardised event management, ensuring compatibility and easy integration across diverse systems.
Key Innovations:
- Generic Data Handling: Through the use of generics, the DataExchange structure abstracts over various sources and sinks, making the module incredibly versatile and adaptable to different data streams and processing needs.
- Asynchronous Stream Processing: Leveraging Rust's powerful asynchronous features, the module processes incoming data streams efficiently, ensuring swift and error-resistant data handling.
- CloudEvents Integration: By standardising on CloudEvents, OOAI ensures that data exchanged across its components is interoperable, well-structured, and easily understood by other systems that support CloudEvents.
The framework offers comprehensive support for integrating with various messaging systems, including Kafka and MQTT, providing robust capabilities for data exchange across different protocols and platforms.
- KafkaDataExchangeImpl and MqttKafkaDataExchange: These implementations showcase OOAI's ability to seamlessly interact with Kafka and MQTT, respectively, offering a unified approach to message exchange that leverages the strengths of each protocol.
- Flexible Message Routing: The framework's design allows for dynamic routing of messages, ensuring that data flows efficiently from sources to destinations, facilitated by the sophisticated use of streams and sinks.
OOAI introduces a GraphQL schema and context for its service APIs, making it easier to interact with and extend the framework's functionalities. This approach provides a structured, queryable interface for accessing and manipulating data, significantly enhancing the extensibility and usability of OOAI.
- HasuraContext and QueryRoot: These components facilitate the creation of GraphQL queries and mutations, allowing for dynamic interactions with the framework's underlying services and data layers.
- Service Object Integration: By integrating service objects into the GraphQL schema, OOAI enables direct access to payment providers, calendar services, and other functionalities, streamlining the development of sophisticated, data-driven applications.
The introduction of a replay buffer structure underscores the framework's commitment to advanced learning and optimisation techniques. This component is crucial for reinforcement learning algorithms, enabling them to learn from past experiences more effectively.
- Fixed-Size Buffer for Experiences: The replay buffer stores a collection of experiences, allowing learning algorithms to sample and learn from past interactions, enhancing the AI's ability to make informed decisions.
- Randomised Experience Sampling: By replacing older experiences with new ones and sampling randomly, the replay buffer ensures a diverse learning experience, contributing to the robustness and adaptability of the AI models.
OOAI leverages the PyO3 crate to facilitate integration with Python, allowing for the execution of asynchronous tasks within Python's ecosystem. This bridge between Rust's asynchronous runtime and Python enhances the performance and scalability of Python applications that interact with OOAI.
- RustTokioRuntime: This component exposes a wrapped Tokio runtime to Python, enabling Python scripts to run asynchronous tasks efficiently, thereby enhancing interoperability and performance in mixed-language projects.
The delegate model represents a sophisticated approach to analysing and organising information from natural language inputs. By structuring data into attributes and connections, OOAI enhances its natural language processing capabilities, enabling the extraction of meaningful insights from complex inputs.
- Attribute and Delegate Structures: These components capture and organise characteristics and relationships identified in natural language inputs, facilitating the construction of knowledge graphs and the extraction of actionable insights.
The framework includes configurable structures like the TedPolicyConfig, which allows for the customisation of learning policies. This flexibility ensures that learning algorithms can be fine-tuned to meet specific requirements, optimising their performance and effectiveness.
- Flexible Configuration Options: With adjustable parameters for aspects like the number of layers, hidden size, and learning rate, OOAI provides a high degree of control over the learning process, accommodating a wide range of applications and use cases.
The OOAI Cognitive Management Framework paves the way for a future where digital privacy and personalised user experiences coexist harmoniously. Through its innovative PII Handler, intelligent communication systems, personalised event recommendations, and adaptive learning mechanisms, OOAI is not just a platform but a paradigm shift. It represents a bold step toward empowering users, ensuring they remain in control of their data, their privacy, and their digital identities. With OOAI, the future of conversational AI is not only intelligent and engaging but also respectful and user-centric.
The OOAI Cognitive Management Framework's library of modules is a work in progress. We will soon be accepting code contributions with an emphasis on hardening these capabilities for production runtimes: The data exchange, message processing, APIs, learning optimisation, and natural language binding defaults. These core features will solidify OOAI's position as a comprehensive, user-centric platform for developing sophisticated conversational AI and data-driven applications.