Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@usametov
usametov / avatar-therapy.md
Created April 2, 2025 17:47
GenAI avatars use case for Social Skills Training for autistic children

The paper you provided, "Robot-mediated therapy: Emotion Recognition and Social Skills Training for children with ASD. Analysis of the use of Zoomorphic Robot Brian - preliminary reports," explores how a zoomorphic robot named Brian can enhance emotion recognition and social skills training for children with autism spectrum disorder (ASD). The study demonstrates that children with ASD respond more readily to verbal commands from the robot, show improved recognition of emotional states on the robot’s face compared to a human face, and exhibit enhanced social communication and imitation behaviors during robot-assisted sessions compared to traditional therapist-led therapy. These findings suggest that robot-assisted therapy can be an effective tool in supporting ASD treatment by leveraging predictable, engaging, and simplified interactions.

To adapt this approach for use with generative AI, such as avatars, we can translate the core principles of the robot Brian study—simplicity, engagement, emotional expressiv

@usametov
usametov / 1.auto-diff-storm.md
Last active March 30, 2025 15:50
auto-diff research tool

To address your query, I'll first analyze the similarities and differences between the LLM-AutoDiff framework (as described in the provided document) and DSPy, focusing on their approaches to automatic prompt engineering and optimization for large language models (LLMs). Then, I'll outline how you could adapt LLM-AutoDiff to develop a tool similar to STORM, which is a knowledge curation system that leverages LLMs to generate Wikipedia-like articles.

Similarities Between LLM-AutoDiff and DSPy

  1. Automation of Prompt Engineering:
  • LLM-AutoDiff: Treats prompts as trainable parameters and uses a "backward engine" LLM to generate textual feedback (akin to gradients) for iterative refinement. This automates the tuning of prompts across multi-step workflows, reducing manual effort.
@usametov
usametov / chunking.md
Last active March 30, 2025 03:59
CRAM chunk processing with R

Let’s dive into processing your 70 GB CRAM file on a machine with 32 GB RAM, focusing first on using R and then exploring alternatives. Your setup is ambitious, but with the right approach, it’s absolutely doable.

Processing a 70 GB CRAM File in R with 32 GB RAM

Based on the document, a 70 GB CRAM file likely contains around 700–1,400 million reads (assuming the 10 GB = 100–200 million reads scaling holds). Loading this entirely into memory would require 35–140 GB of RAM, far exceeding your 32 GB. So, a full load is off the table. However, the document highlights strategies to make this manageable, and I’ll tailor them to your case.

Is It Possible in R?

Yes, it’s possible, but you’ll need to avoid loading the whole file at once. The key is chunk-based processing, which keeps memory usage constant regardless of file size. For a 70 GB CRAM, chunk processing can work within 500 MB to 1 GB of RAM per chunk, well within your 32 GB limit. Even with overhead from R and other operations, you can stay

@usametov
usametov / midgard.md
Last active March 30, 2025 03:32
ouroboros - game theory

Thank you for providing the Midgard L2 whitepaper. Based on the document titled "Midgard L2: Scaling Cardano with Optimistic Rollups" (working draft, 2025-01-18, by Anastasia Labs and FluidTokens), I’ll analyze how Midgard employs game theory in its design, particularly in its optimistic rollup consensus protocol built on Cardano’s Layer 1 (L1). I’ll also revisit the interplay with Ouroboros, given Midgard’s explicit integration with Cardano, and provide a detailed breakdown.


1. How Midgard Uses Game Theory

Midgard is an optimistic rollup protocol designed to scale Cardano by processing transactions off-chain (Layer 2, L2) while anchoring security and finality to Cardano’s L1. Game theory is central to its economic incentive structure, which ensures the integrity and efficiency of the protocol by aligning the interests of operators (who commit blocks) and watchers (who monitor for fraud). Below, I’ll detail the key game-theoretic mechanisms:

**A. Economic Incentives and the Operator-Watche

@usametov
usametov / HF-indeference-api.md
Created March 30, 2025 02:37
HF inference API howto

To run the TheBloke/Mistral-7B-OpenOrca-AWQ model on Hugging Face infrastructure using a Clojure clj-http client, you’ll need to leverage Hugging Face's Inference API, which allows you to make HTTP requests to run models hosted on their platform. Since you have a Hugging Face Pro account, you can use this API with your authentication token for enhanced access (e.g., higher rate limits or access to private models, though this specific model is public).

Here’s a step-by-step guide to achieve this:


Step 1: Prerequisites

@usametov
usametov / graphrag-hybrid-qdrant-neo4j.md
Last active March 31, 2025 20:54
hybridsearch algorithm

To modify the previous implementation to use Qdrant for hybrid search (vector + keyword search) while keeping Neo4j for Cypher queries in Clojure, we’ll integrate the Qdrant database for the hybrid search part and use Neo4j solely for graph-based Cypher retrieval. Below, I’ll adapt the code assuming you have a Qdrant instance running and a Neo4j database populated with graph data. We’ll use the Qdrant REST API via clj-http for simplicity, as there’s no official Clojure client for Qdrant (though you could use a gRPC client if preferred).


Prerequisites

  1. Qdrant Instance: Running locally (e.g., http://localhost:6333) or on a remote server, with a collection set up for hybrid search (vector embeddings + text payloads).
  2. Neo4j Database: Populated and accessible via Bolt (e.g., bolt://localhost:7687).
  3. Clojure Dependencies: Add clj-http and cheshire (for JSON parsing) to your project.clj:
@usametov
usametov / rest-kit-clj.md
Created March 28, 2025 05:35
kit clj rest api example

The Kit framework (https://kit-clj.github.io/) is a lightweight, modular framework for scalable web development in Clojure. It uses Reitit for routing and Integrant for system management, making it well-suited for building REST APIs. Below is an example of how you can create a simple REST API using Kit, based on its conventions and structure.

This example assumes you’ve set up a Kit project (e.g., yourname/guestbook) and will demonstrate a basic REST API with endpoints to manage a list of messages (e.g., a guestbook). I'll walk you through the key parts.


Example: Simple Guestbook REST API

1. Project Setup

If you haven’t already, create a Kit project:

@usametov
usametov / reasoning-agent.md
Created March 26, 2025 16:51
reasoning agent

I’ve reviewed the page at reasoningagent, which describes the ReasoningAgent in AG2 (formerly AutoGen). This agent implements a Tree of Thoughts (ToT) reasoning framework with beam search to enhance LLM problem-solving by exploring multiple reasoning paths systematically. Let’s evaluate whether this can be improved using a reasoning model (assuming you mean enhancing its reasoning capabilities further with Grok or a similar approach) and propose new prompts to achieve that.

Analysis of Current ReasoningAgent

The ReasoningAgent:

  • Purpose: Enhances LLM reasoning for complex problems by simulating a tree-like exploration of solution paths using beam search.
  • Key Features:
    • Beam search with configurable beam_size (e.g., 1 for Chain-of-Thought, >1 for multi-path exploration).
  • Depth-limited search (max_depth) to control complexity.
@usametov
usametov / frugal-tractor.md
Last active March 17, 2025 18:08
DIY tractor

-- cost-effective, open-source solutions for building farming equipment, such as a cheap DIY tractor.


Dedicated DIY Farming Forums

  1. Farm Hack Community Forum      - Description: Farm Hack is a worldwide community of farmers, engineers, and innovators who build, modify, and share tools for resilient, small-scale agriculture. Their online forum is a hub for discussing DIY farming tools, sharing innovations, and collaborating on projects. It’s an excellent place to connect with others working on DIY tractor designs or similar equipment.    - Access: Visit the Farm Hack forum to browse discussions, post questions, or share ideas. Topics include tractor modifications, tool designs, and sustainable farming practices.    - Relevance: This forum is ideal for networking with like-minded DIY enthusiasts and accessing practical advice on building low-cost farming equipment, including tractors.
@usametov
usametov / extenal-insulation.md
Last active March 17, 2025 18:58
cheap foundation for modular home

Living through a Canadian winter means dealing with extreme cold, so effective insulation is key to keeping your home warm and energy costs down. Here are some cheap and effective DIY external insulation solutions tailored for Canadian winters, where temperatures can drop well below freezing:

1. Rigid Foam Board Insulation

  • What It Is: Rigid foam boards (like expanded polystyrene (EPS), extruded polystyrene (XPS), or polyisocyanurate) are affordable, lightweight, and provide excellent thermal resistance (R-value).
  • Why It Works: These boards can be applied to exterior walls to reduce heat loss, especially in older homes with poor insulation. XPS is particularly good for moisture resistance, which is crucial in snowy and wet Canadian winters.
  • How to DIY:
    1. Measure the exterior walls of your home and purchase enough foam boards to cover the area. XPS typically offers R-5 per inch of thickness.
    2. Clean and dry the exterior walls, removing any loose paint or debris.