Try embedding, semantic search, retrieval, and plugging the relevant parts into the prompt.
You may need: - summarizer prompt to summarize your project structure, main functions, methods. - vector store/database to store and retrieve your relevant code from code base - coder prompt to write code based on the retrieved part.
Check out langchain: https://langchain.readthedocs.io/