Menu

#7 Implement Repository Learner

closed
nobody
P0 (19)
2025-12-17
2025-12-07
Anonymous
No

Originally created by: alirezamshi
Originally owned by: alirezamshi

Description

The RepoLearner extracts knowledge from Git repositories and adds it to the wiki. Currently has placeholder implementation.

Location: src/knowledge/learners/repo_learner.py

Goal

Implement the full repository learning pipeline that:

  1. Clones a Git repository
  2. Parses and extracts knowledge
  3. Creates wiki pages from extracted knowledge

What to Extract

  • README and documentation → Text chunks, overview pages
  • Code structure and patterns → Implementation pages
  • Docstrings and comments → Principle/concept pages
  • Project organization → Workflow pages
  • Config files → Artifact pages

Input Format

{"url": "https://github.com/user/repo", "branch": "main"}

Implementation Steps

  1. Clone repo to temp directory
  2. Parse README.md → text chunks
  3. Parse Python/JS files → code chunks
  4. Extract docstrings → concept chunks
  5. Analyze structure → workflow chunks
  6. Convert chunks to wiki pages
  7. Index into knowledge graph

Deliverable

  1. Full implementation of RepoLearner.learn() method
  2. Wiki page generation from repository content
  3. Integration with wiki indexer

Test

  1. Call expert.learn(Source.Repo("https://github.com/huggingface/trl"))
  2. Verify wiki pages created in data/wikis/
  3. Verify knowledge indexed and searchable

References

  • src/knowledge/learners/repo_learner.py - Current placeholder
  • src/knowledge/learners/base.py - Base class and KnowledgeChunk
  • src/knowledge/wiki_structure/extension_of_product.md - Wiki page structure

Dependencies

Related

Tickets: #2
Tickets: #22
Tickets: #4
Tickets: #5

Discussion

  • Anonymous

    Anonymous - 2025-12-14
     
  • Anonymous

    Anonymous - 2025-12-14

    Originally posted by: alirezamshi

    [#40]

     

    Related

    Tickets: #40

  • Anonymous

    Anonymous - 2025-12-17

    Ticket changed by: alirezamshi

    • status: open --> closed
     

Log in to post a comment.