Live data from Hacker News

Show HN: I used Claude Code to discover connections between 100 books

trails.pieterma.es

151–159 of 159 posts

Re: Show HN: I used Claude Code to discover connections between 100 books

#151
post #77

Earlier quoted context omitted.

The one that you thought of in the shower has a much greater chance of being right, and also of being relevant to you.

Has it? Why?

Because humans aren't morons tasked with coming up with 100 connections.

Re: Show HN: I used Claude Code to discover connections between 100 books

#152
post #151

Earlier quoted context omitted.

Has it? Why?

Because humans aren't morons tasked with coming up with 100 connections.

Doesn't explain why a connection made in the shower has in essence more merit than a connection an LLM was instructed to come up with.

Re: Show HN: I used Claude Code to discover connections between 100 books

#153

I did something similar whereby I used pdfplumber to extract text from my pdf book collection. I dumped it into postgresql, then chunked the text into 100 char chunks w/ a 10 char overlap. These chunks were directly embedded into a 384D space using python sentence_transformers. Then I simply averaged all chunks for a doc and wrote that single vector back to postgresql. Then I used UMAP + HDBScan to perform dimensiona…

Thanks for the supportive comments. I'm definitely thinking I should release sooner rather than later. I have been using LLM for specific tasks and here is some sample stored procedure I had an LLM write for me.

-- -- Name: refresh_topic_tables(); Type: PROCEDURE; Schema: public; Owner: postgres --

CREATE PROCEDURE public.refresh_topic_tables() LANGUAGE plpgsql AS $$ BEGIN -- Drop tables in reverse dependency order DROP TABLE IF EXISTS topic_top_terms; DROP TABLE IF EXISTS topic_term_tfidf; DROP TABLE IF EXISTS term_df; DROP TABLE IF EXISTS term_tf; DROP TABLE IF EXISTS topic_terms;

    -- Recreate tables in correct dependency order
    CREATE TABLE topic_terms AS
    SELECT
        dt.term_id,
        dot.topic_id,
        COUNT(DISTINCT dt.document_id) as document_count,
        SUM(frequency) as total_frequency
    FROM document_terms dt
    JOIN document_topics dot ON dt.document_id = dot.document_id
    GROUP BY dt.term_id, dot.topic_id;

    CREATE TABLE term_tf AS
    SELECT
        topic_id,
        term_id,
        SUM(total_frequency) as term_frequency
    FROM topic_terms
    GROUP BY topic_id, term_id;

    CREATE TABLE term_df AS
    SELECT
        term_id,
        COUNT(DISTINCT topic_id) as document_frequency
    FROM topic_terms
    GROUP BY term_id;

    CREATE TABLE topic_term_tfidf AS
    SELECT
        tt.topic_id,
        tt.term_id,
        tt.term_frequency as tf,
        tdf.document_frequency as df,
        tt.term_frequency * LN( (SELECT COUNT(id) FROM topics) / GREATEST(tdf.document_frequency, 1)) as tf_idf
    FROM term_tf tt
    JOIN term_df tdf ON tt.term_id = tdf.term_id;

    CREATE TABLE topic_top_terms AS
    WITH ranked_terms AS (
        SELECT
            ttf.topic_id,
            t.term_text,
            ttf.tf_idf,
            ROW_NUMBER() OVER (PARTITION BY ttf.topic_id ORDER BY ttf.tf_idf DESC) as rank
        FROM topic_term_tfidf ttf
        JOIN terms t ON ttf.term_id = t.id
    )
    SELECT
        topic_id,
        term_text,
        tf_idf,
        rank
    FROM ranked_terms
    WHERE rank 
EXCEPTION WHEN OTHERS THEN RAISE EXCEPTION 'Error refreshing topic tables: %', SQLERRM; END; $$;

Re: Show HN: I used Claude Code to discover connections between 100 books

#154
post #151

Earlier quoted context omitted.

Because humans aren't morons tasked with coming up with 100 connections.

Doesn't explain why a connection made in the shower has in essence more merit than a connection an LLM was instructed to come up with.

Not sure how to make it clearer. Look at the quality of this post, and compare it to your shower thoughts. I imagine you're not as stupid as the machine was.

Re: Show HN: I used Claude Code to discover connections between 100 books

#156
Love this, it is interesting to see the links between topics, with things like father son relationship. I have a long queue of books to read that this year I finally set aside planned time on the calendar to read and walk. There are specific topics I want to read about so even if it just helped with finding some experts from books around a topic, it would help me decide. I think you're onto something here.

Re: Show HN: I used Claude Code to discover connections between 100 books

#158

You might enjoy my tool deciduous. It is for building knowledge trees and reference stuff exactly like this. The website tells a bit more http://notactuallytreyanastasio.github.io/deciduous/

Interesting. Was this inspired by the "Context Graphs" concept discussed on X?

No, I don’t hang out at the nazi bar.

Re: Show HN: I used Claude Code to discover connections between 100 books

#159

I did something similar whereby I used pdfplumber to extract text from my pdf book collection. I dumped it into postgresql, then chunked the text into 100 char chunks w/ a 10 char overlap. These chunks were directly embedded into a 384D space using python sentence_transformers. Then I simply averaged all chunks for a doc and wrote that single vector back to postgresql. Then I used UMAP + HDBScan to perform dimensiona…

I posted my code https://github.com/johnwatson11218/LatentTopicExplorer
Post reply on HN