Skip to content

Feature: Persistent Project-Aware Context Using RAG (Retrieval-Augmented Generation) #6

@D3vanshC

Description

@D3vanshC

Description

Currently, the context from reference repositories is used on a one-time basis during project initialization or code refinement.
To dramatically improve the quality and relevance of code suggestions, this feature proposes implementing a persistent, project-aware context management system using a Retrieval-Augmented Generation (RAG) approach.

This system would store embeddings of reference code in a vector database, allowing the extension to retrieve the most relevant snippets before generating suggestions.
The result: highly contextual, architecture-aware, and accurate AI outputs.


Proposed Solution

1. Ingestion & Storage

  • When a user adds a reference repository (own or public), the extension will process its files.
  • Code will be parsed, chunked into meaningful segments (functions, classes, etc.), and converted into vector embeddings.
  • These embeddings will be stored in a local or session-based vector database tied to the current project.

2. Retrieval-Augmented Generation (RAG)

  • When a user triggers an action such as getCodeRefinements:
    1. The staged code diff is converted into a query embedding.
    2. A similarity search is run against the stored embeddings to find the most relevant code chunks.
    3. These retrieved chunks (the augmented context) are prepended to the final prompt sent to the Gemini API.

Expected Outcome

  • Code suggestions and refactorings become highly accurate, contextually aware, and aligned with the project’s conventions.
  • The extension “learns” from the provided context, evolving into a smarter and more adaptive coding assistant.
  • This upgrade transforms GhostDev from a stateless tool into a stateful, project-aware assistant with persistent contextual understanding.

Note: You are free to suggest any other approach to implement this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthacktoberfestWelcoming contributions as a part of Hacktoberfest'25help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions