Skip to content

Instantly share code, notes, and snippets.

import time
from datetime import timedelta
from datasets import load_dataset
from txtai import LLM
from txtai.pipeline import Labels, HFTrainer
def prompt(text):
text = f"""
import instructor
from pydantic import BaseModel, Field
from typing import overload, Union, Literal, Generator
from tqdm.asyncio import tqdm
import asyncio
import numpy as np
import json
import os, sys
import diskcache, inspect, functools
import random
@ruvnet
ruvnet / APM.md
Last active June 18, 2026 20:47
Agent Package Management

Introduction: Agent Algorithm Repository

In the rapidly evolving field of artificial intelligence, the need for a comprehensive and structured repository for algorithms designed for intelligent agents has become increasingly important.

The Agent Algorithm Repository aims to address this need by providing a centralized platform for discovering, sharing, and utilizing a wide range of algorithms. This repository is designed to be language-agnostic, ensuring compatibility with various programming languages and promoting a standardized approach to algorithm description, documentation, and distribution.

The repository facilitates the following key objectives:

  1. Language Agnosticism: By supporting algorithms implemented in any programming language, the repository ensures broad applicability and ease of integration across different technology stacks.
@ruvnet
ruvnet / Agentic-algorithms.md
Last active May 5, 2026 22:20
This document provides a comprehensive overview of five advanced algorithms, detailing their technical implementations using Python and Pydantic for data validation, as well as asynchronous programming for efficiency. Each algorithm is also explored in terms of practical applications across various domains.

Introduction

This document provides a comprehensive overview of five advanced algorithms, detailing their technical implementations using Python and Pydantic for data validation, as well as asynchronous programming for efficiency. Each algorithm is also explored in terms of practical applications across various domains. The algorithms covered include:

  1. NEUMANN: Differentiable Logic Programs for Abstract Visual Reasoning - This algorithm integrates differentiable logic programming with neural networks, enabling advanced visual reasoning and logical deduction. It is particularly useful in computer vision, robotics, and medical imaging.

  2. Scheduled Policy Optimization for Natural Language Communication - This algorithm optimizes policies for natural language communication, enhancing dialogue systems, customer support automation, and machine translation. It leverages policy gradient methods and scheduled learning to improve interaction quality and efficiency.

  3. **LEFT: Logic-Enhanced Foundatio

@ruvnet
ruvnet / cognitive-memory.md
Created May 17, 2024 14:23
A cognitive framework for optimizing logic, reasoning, and comprehension when using ChatGPT. This framework ensures clear understanding, effective problem-solving, and accurate responses.

Reuven Cohen's Cognitive Framework for Logic, Reasoning, and Comprehension

1. Understanding the Query

  • Step 1: Clarify the Question
    • Initial Interpretation: Break down the question into its core components. Identify the main topic, specific details, and expected outcome.
    • Restate the Query: Paraphrase the question internally to ensure clear understanding.
    • Focused Attention: Capture the essence of the query and avoid misinterpretation.
@ruvnet
ruvnet / *notepad.ipynb
Last active November 7, 2025 13:35
ruv-metaprompt.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruvnet
ruvnet / HiveMindLang.md
Last active November 7, 2025 13:28
A comprehensive specification for HiveMindLang (HML) outlines a sophisticated framework for the creation of advanced AI agents capable of secure, efficient, and adaptive operations within a hive mind architecture.

Comprehensive Specification for HiveMindLang (HML)

Introduction

The comprehensive specification for HiveMindLang (HML) is designed to equip AI agents with the tools necessary for secure, efficient, and adaptive operations within a hive mind architecture. This specification is not just a set of guidelines but a robust framework that integrates advanced technological paradigms such as state-of-the-art encryption, sophisticated obfuscation techniques, and dynamic adaptive behaviors. Here’s a deeper exploration of how these elements combine to enhance the capabilities of AI agents:

1. Secure Operations through Advanced Encryption

HML employs a hybrid encryption model that combines the strengths of both symmetric and asymmetric encryption methods. This dual approach ensures that data payloads are encrypted efficiently using AES-256 (symmetric encryption), which is known for its speed and security. Meanwhile, the exchange of encryption keys is safeguarded by RSA-2048 (asymmetric encryption), which secur

@disler
disler / README.md
Last active October 22, 2024 02:58
Personal AI Assistant: 'Ada' - v0

This is not working complete code.

This is strictly a v0, scrapy, proof of concept for the first version of a personal AI Assistant working end to end in just ~322 LOC.

It's only a frame of reference for you to consume the core ideas of how to build a POC of a personal AI Assistant.

To see the high level of how this works check out the explanation video. To follow our agentic journey check out the @IndyDevDan channel.

Stay focused, keep building.

@chenhunghan
chenhunghan / llama_cpp_dspy_evaluate.py
Created April 1, 2024 13:15
DSPy llm evaluation with metric using llama.cpp
# A gist for using the `llama.cpp` model with the `dspy` library.
#
# DSPy features used in this gist
# - `dspy.Predict`
# - `dspy.Signature`
# - `dspy.context`
# - `dspy.evaluate.Evaluate`
#
# The script first prompts the model to answer a example question and assess the correctness and engagingness of the answer using a evaluator.
#
@disler
disler / README.md
Created March 31, 2024 14:34
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains