{"id":27976941,"url":"https://github.com/neo4j-examples/sec-edgar-notebooks","last_synced_at":"2025-11-09T23:04:46.061Z","repository":{"id":224561919,"uuid":"763589633","full_name":"neo4j-examples/sec-edgar-notebooks","owner":"neo4j-examples","description":"Active WIP for experimenting with GraphRAG and Knowledge Graphs","archived":false,"fork":false,"pushed_at":"2024-04-23T17:51:26.000Z","size":28352,"stargazers_count":66,"open_issues_count":0,"forks_count":15,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-08T01:43:09.903Z","etag":null,"topics":["graph-rag","knowledge-graph","neo4j"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j-examples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-26T15:21:17.000Z","updated_at":"2025-04-10T23:32:41.000Z","dependencies_parsed_at":"2025-05-08T01:53:17.391Z","dependency_job_id":null,"html_url":"https://github.com/neo4j-examples/sec-edgar-notebooks","commit_stats":null,"previous_names":["neo4j-examples/sec-edgar-notebooks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neo4j-examples/sec-edgar-notebooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-examples%2Fsec-edgar-notebooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-examples%2Fsec-edgar-notebooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-examples%2Fsec-edgar-notebooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-examples%2Fsec-edgar-notebooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-examples","download_url":"https://codeload.github.com/neo4j-examples/sec-edgar-notebooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-examples%2Fsec-edgar-notebooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259521513,"owners_count":22870446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-rag","knowledge-graph","neo4j"],"created_at":"2025-05-08T01:43:06.801Z","updated_at":"2025-11-09T23:04:46.031Z","avatar_url":"https://github.com/neo4j-examples.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphRAG with SEC Edgar Knowledge Graph\n\nCode and data for performing GraphRAG with an example SEC Edgar Knowledge Graph. The knowledge graph contains information about companies, their financial reports, and the relationships between them. \n\n\u003cimg width=\"934\" alt=\"edgar-kg-model\" src=\"https://github.com/neo4j-examples/sec-edgar-notebooks/assets/53756/58e3fcba-3def-459b-843b-c3403176b048\"\u003e\n\n## Knowledge Graph Model\n\nFrom the Edgar database, two forms are used to construct a knowledge graph that mixes structured and unstructured data. The two forms are:\n\n1. Form 10-K: the annual report that publicly traded companies must file with the SEC. It provides a comprehensive summary of a company's financial performance.\n2. Form 13: filed by institutional managers who manage $100 million or more in assets.\n\n### Form 13\n\nForm 13 is used as structured data about the investments made by institutional managers. The form contains information about the companies in which the manager has invested, the number of shares owned, and the value of the investment.\n\n```cypher\n(:Manager)-[:OWNS_STOCK_IN]-\u003e(:Company)\n```\n\n### From 10-K\n\nForm 10-K is used as a source of unstructured data about the company's financial performance. The form contains sections such as \"Risk Factors\", \"Management's Discussion and Analysis of Financial Condition and Results of Operations\", and \"Financial Statements and Supplementary Data\".\n\n```cypher\n(:Company)-[:FILED]-\u003e(:Form)\n```\n\nThe form is divided into sections, and each section is split into chunks. The chunks contain the text of the form plus a vector embedding to enable vector similarity search.\n\n```cypher\n(:Form)-[:SECTION]-\u003e(:Chunk) // first chunk of a section\n(:Chunk)-[:PART_OF]-\u003e(:Form) // each chunk connects back up to the form\n(:Chunk)-[:NEXT]-\u003e(Chunk)    // the chunks are connected in a linked list\n```\n\n## Knowledge Graph Construction - quickstart\n\n[kg-construction.cypher](notebooks/kg-construction/kg-construction.cypher) is a multi-statement Cypher script that constructs the knowledge graph. To create the knowledge graph, run the script in the Neo4j Browser.\n\n1. Start a Neo4j database \n2. Set the OpenAI API Key at the top of the script\n3. Run the script\n\n*Note*: If you are using Neo4j Aura, the query interface does not support client-side commands in multi-statement scripts. So, you should first run the `:params` statement by itself to set query parameters. Then, run the rest of the script.\n\n## Knowledge Graph Construction - step-by-step\n\nTo understand all the details about how the knowledge graph is constructed, follow the step-by-step guide in the [kg-construction](notebooks/kg-construction) directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-examples%2Fsec-edgar-notebooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-examples%2Fsec-edgar-notebooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-examples%2Fsec-edgar-notebooks/lists"}