Skip to content

Instantly share code, notes, and snippets.

- After making changes, ALWAYS make sure to start up a new server so I can test it.
- Always look for existing code to iterate on instead of creating new code.
- Do not drastically change the patterns before trying to iterate on existing patterns.
- Always kill all existing related servers that may have been created in previous testing before trying to start a new server.
- Always prefer simple solutions
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
- Write code that takes into account the different environments: dev, test, and prod
- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d
from manim import *
import numpy as np
class DualRingHeatTransferAnimation(Scene):
def construct(self):
# Configuration
num_blocks = 20
num_around = 39
block_size = 0.4
outer_radius = 3.3
import geopandas as gpd
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.colors as mcolors
from shapely.geometry import Polygon, MultiPolygon
import shapely.ops
import os.path
def get_text_color(fill_color):
@ruvnet
ruvnet / notebook.ipynb
Last active January 31, 2025 23:08
5cdbbd43ab3a0c728fdd3e7a2a8aedd9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruvnet
ruvnet / README.md
Last active November 12, 2024 03:20

File Summarization API

This FastAPI application provides an API endpoint for uploading files and generating summaries using LlamaIndex. It supports a wide variety of file types including documents, images, audio, and video files.

Features

  • File upload endpoint
  • Automatic file type detection
  • Document summarization using LlamaIndex
  • Support for multiple file types (PDF, Word, PowerPoint, images, audio, video, etc.)
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 January 31, 2025 23:05
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 April 13, 2025 02:08
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.